mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 06:04:15 +00:00
FBReactKit: use indirect jumps to external functions
Reviewed By: as106 Differential Revision: D3105839 fb-gh-sync-id: 24a8a215f65908b577891fb4b38366bad35cf6fc fbshipit-source-id: 24a8a215f65908b577891fb4b38366bad35cf6fc
This commit is contained in:
parent
2115664456
commit
2bcf4bef2b
@ -35,7 +35,10 @@ SYMBOL_NAME(RCTProfileTrampoline):
|
||||
* profile
|
||||
*/
|
||||
mov r0, #0xc
|
||||
bl SYMBOL_NAME(malloc)
|
||||
|
||||
ldr ip, LCPI_malloc
|
||||
blx ip
|
||||
|
||||
/**
|
||||
* r4 is the callee saved register we'll use to refer to the allocated memory,
|
||||
* store its initial value, so we can restore it later
|
||||
@ -87,10 +90,20 @@ SYMBOL_NAME(RCTProfileTrampoline):
|
||||
ldr r1, [r4, #0x8]
|
||||
ldr r4, [r4]
|
||||
push {r1} // save the caller on the stack
|
||||
bl SYMBOL_NAME(free)
|
||||
|
||||
ldr ip, LCPI_free
|
||||
blx ip
|
||||
|
||||
pop {lr} // pop the caller
|
||||
pop {r0} // pop the return value
|
||||
bx lr // jump to the calleer
|
||||
|
||||
trap
|
||||
|
||||
.p2align 2
|
||||
LCPI_malloc:
|
||||
.long SYMBOL_NAME(malloc)
|
||||
LCPI_free:
|
||||
.long SYMBOL_NAME(free)
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user