Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index c3c3367b10937d9b8223f8db099d81300733c8ac..8769f0079daf9e19db3ce4050b868df518f3fada 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -2828,11 +2828,6 @@ void InternalArrayConstructorStub::Generate(MacroAssembler* masm) { |
static const int kCallApiFunctionSpillSpace = 4; |
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
- return static_cast<int>(ref0.address() - ref1.address()); |
-} |
- |
- |
// Calls an API function. Allocates HandleScope, extracts returned value |
// from handle and propagates exceptions. |
// 'stack_space' is the space to be unwound on exit (includes the call JS |
@@ -2962,6 +2957,9 @@ static void CallApiFunctionAndReturn( |
__ JumpIfNotRoot(x5, Heap::kTheHoleValueRootIndex, |
&promote_scheduled_exception); |
+ // Check if the function returned a valid JavaScript value. |
+ __ AssertApiCallResult(x0); |
+ |
if (stack_space_operand != NULL) { |
__ Drop(x2, 1); |
} else { |
@@ -3039,6 +3037,12 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) { |
// return value, return value default, isolate, holder. |
__ Push(call_data, call_data, isolate_reg, holder); |
+ if (!is_store()) { |
+ __ Mov(x0, argc()); |
+ __ Jump(masm->isolate()->builtins()->CallFunctionCallback(), |
+ RelocInfo::CODE_TARGET); |
+ } |
+ |
// Prepare arguments. |
Register args = x6; |
__ Mov(args, masm->StackPointer()); |