Index: src/arm/stub-cache-arm.cc |
=================================================================== |
--- src/arm/stub-cache-arm.cc (revision 9277) |
+++ src/arm/stub-cache-arm.cc (working copy) |
@@ -553,9 +553,10 @@ |
} |
-static MaybeObject* GenerateFastApiDirectCall(MacroAssembler* masm, |
- const CallOptimization& optimization, |
- int argc) { |
+static MaybeObject* GenerateFastApiDirectCall( |
+ MacroAssembler* masm, |
+ const CallOptimization& optimization, |
+ int argc) { |
// ----------- S t a t e ------------- |
// -- sp[0] : holder (set by CheckPrototypes) |
// -- sp[4] : callee js function |
@@ -616,9 +617,11 @@ |
ExternalReference ref = ExternalReference(&fun, |
ExternalReference::DIRECT_API_CALL, |
masm->isolate()); |
+ AllowExternalCallThatCantCauseGC scope(masm); |
return masm->TryCallApiFunctionAndReturn(ref, kStackUnwindSpace); |
} |
+ |
class CallInterceptorCompiler BASE_EMBEDDED { |
public: |
CallInterceptorCompiler(StubCompiler* stub_compiler, |
@@ -794,7 +797,7 @@ |
miss_label); |
// Call a runtime function to load the interceptor property. |
- __ EnterInternalFrame(); |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
// Save the name_ register across the call. |
__ push(name_); |
@@ -811,7 +814,8 @@ |
// Restore the name_ register. |
__ pop(name_); |
- __ LeaveInternalFrame(); |
+ |
+ // Leave the internal frame. |
} |
void LoadWithInterceptor(MacroAssembler* masm, |
@@ -820,18 +824,19 @@ |
JSObject* holder_obj, |
Register scratch, |
Label* interceptor_succeeded) { |
- __ EnterInternalFrame(); |
- __ Push(holder, name_); |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ Push(holder, name_); |
- CompileCallLoadPropertyWithInterceptor(masm, |
- receiver, |
- holder, |
- name_, |
- holder_obj); |
+ CompileCallLoadPropertyWithInterceptor(masm, |
+ receiver, |
+ holder, |
+ name_, |
+ holder_obj); |
- __ pop(name_); // Restore the name. |
- __ pop(receiver); // Restore the holder. |
- __ LeaveInternalFrame(); |
+ __ pop(name_); // Restore the name. |
+ __ pop(receiver); // Restore the holder. |
+ } |
// If interceptor returns no-result sentinel, call the constant function. |
__ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex); |
@@ -1288,42 +1293,44 @@ |
// Save necessary data before invoking an interceptor. |
// Requires a frame to make GC aware of pushed pointers. |
- __ EnterInternalFrame(); |
+ { |
+ FrameScope frame_scope(masm(), StackFrame::INTERNAL); |
- if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { |
- // CALLBACKS case needs a receiver to be passed into C++ callback. |
- __ Push(receiver, holder_reg, name_reg); |
- } else { |
- __ Push(holder_reg, name_reg); |
- } |
+ if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { |
+ // CALLBACKS case needs a receiver to be passed into C++ callback. |
+ __ Push(receiver, holder_reg, name_reg); |
+ } else { |
+ __ Push(holder_reg, name_reg); |
+ } |
- // Invoke an interceptor. Note: map checks from receiver to |
- // interceptor's holder has been compiled before (see a caller |
- // of this method.) |
- CompileCallLoadPropertyWithInterceptor(masm(), |
- receiver, |
- holder_reg, |
- name_reg, |
- interceptor_holder); |
+ // Invoke an interceptor. Note: map checks from receiver to |
+ // interceptor's holder has been compiled before (see a caller |
+ // of this method.) |
+ CompileCallLoadPropertyWithInterceptor(masm(), |
+ receiver, |
+ holder_reg, |
+ name_reg, |
+ interceptor_holder); |
- // Check if interceptor provided a value for property. If it's |
- // the case, return immediately. |
- Label interceptor_failed; |
- __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex); |
- __ cmp(r0, scratch1); |
- __ b(eq, &interceptor_failed); |
- __ LeaveInternalFrame(); |
- __ Ret(); |
+ // Check if interceptor provided a value for property. If it's |
+ // the case, return immediately. |
+ Label interceptor_failed; |
+ __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex); |
+ __ cmp(r0, scratch1); |
+ __ b(eq, &interceptor_failed); |
+ frame_scope.GenerateLeaveFrame(); |
+ __ Ret(); |
- __ bind(&interceptor_failed); |
- __ pop(name_reg); |
- __ pop(holder_reg); |
- if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { |
- __ pop(receiver); |
+ __ bind(&interceptor_failed); |
+ __ pop(name_reg); |
+ __ pop(holder_reg); |
+ if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { |
+ __ pop(receiver); |
+ } |
+ |
+ // Leave the internal frame. |
} |
- __ LeaveInternalFrame(); |
- |
// Check that the maps from interceptor's holder to lookup's holder |
// haven't changed. And load lookup's holder into |holder| register. |
if (interceptor_holder != lookup->holder()) { |