Chromium Code Reviews| Index: src/arm/builtins-arm.cc |
| =================================================================== |
| --- src/arm/builtins-arm.cc (revision 8110) |
| +++ src/arm/builtins-arm.cc (working copy) |
| @@ -582,10 +582,11 @@ |
| __ bind(&convert_argument); |
| __ push(function); // Preserve the function. |
| __ IncrementCounter(counters->string_ctor_conversions(), 1, r3, r4); |
| - __ EnterInternalFrame(); |
| - __ push(r0); |
| - __ InvokeBuiltin(Builtins::TO_STRING, CALL_FUNCTION); |
| - __ LeaveInternalFrame(); |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + __ push(r0); |
| + __ InvokeBuiltin(Builtins::TO_STRING, CALL_FUNCTION); |
| + } |
| __ pop(function); |
| __ mov(argument, r0); |
| __ b(&argument_is_string); |
| @@ -601,10 +602,11 @@ |
| // create a string wrapper. |
| __ bind(&gc_required); |
| __ IncrementCounter(counters->string_ctor_gc_required(), 1, r3, r4); |
| - __ EnterInternalFrame(); |
| - __ push(argument); |
| - __ CallRuntime(Runtime::kNewStringWrapper, 1); |
| - __ LeaveInternalFrame(); |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + __ push(argument); |
| + __ CallRuntime(Runtime::kNewStringWrapper, 1); |
| + } |
| __ Ret(); |
| } |
| @@ -651,7 +653,8 @@ |
| Isolate* isolate = masm->isolate(); |
| // Enter a construct frame. |
| - __ EnterConstructFrame(); |
| +{ |
| + FrameScope scope(masm, StackFrame::CONSTRUCT); |
| // Preserve the two incoming parameters on the stack. |
| __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
| @@ -967,7 +970,10 @@ |
| // sp[1]: constructor function |
| // sp[2]: number of arguments (smi-tagged) |
| __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); |
| - __ LeaveConstructFrame(); |
| + |
| + // Leave construct frame. |
| +} |
| + |
| __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1)); |
| __ add(sp, sp, Operand(kPointerSize)); |
| __ IncrementCounter(isolate->counters()->constructed_objects(), 1, r1, r2); |
| @@ -1004,7 +1010,8 @@ |
| __ mov(cp, Operand(0, RelocInfo::NONE)); |
| // Enter an internal frame. |
| - __ EnterInternalFrame(); |
| +{ |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| // Set up the context from the function argument. |
| __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
| @@ -1055,9 +1062,10 @@ |
| NullCallWrapper(), CALL_AS_METHOD); |
| } |
| - // Exit the JS frame and remove the parameters (except function), and return. |
| + // Exit the JS frame and remove the parameters (except function), and |
|
Søren Thygesen Gjesse
2011/05/31 07:51:45
JS frame -> internal frame.
Erik Corry
2011/05/31 11:52:52
Done.
|
| + // return. |
| // Respect ABI stack constraint. |
| - __ LeaveInternalFrame(); |
| +} |
| __ Jump(lr); |
| // r0: result |
| @@ -1076,7 +1084,8 @@ |
| void Builtins::Generate_LazyCompile(MacroAssembler* masm) { |
| // Enter an internal frame. |
| - __ EnterInternalFrame(); |
| +{ |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| // Preserve the function. |
| __ push(r1); |
| @@ -1095,7 +1104,7 @@ |
| __ pop(r1); |
| // Tear down temporary frame. |
| - __ LeaveInternalFrame(); |
| +} |
| // Do a tail-call of the compiled function. |
| __ Jump(r2); |
| @@ -1104,7 +1113,8 @@ |
| void Builtins::Generate_LazyRecompile(MacroAssembler* masm) { |
| // Enter an internal frame. |
| - __ EnterInternalFrame(); |
| +{ |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| // Preserve the function. |
| __ push(r1); |
| @@ -1123,7 +1133,7 @@ |
| __ pop(r1); |
| // Tear down temporary frame. |
|
Søren Thygesen Gjesse
2011/05/31 07:51:45
temporary -> internal
Erik Corry
2011/05/31 11:52:52
Done.
|
| - __ LeaveInternalFrame(); |
| +} |
| // Do a tail-call of the compiled function. |
| __ Jump(r2); |
| @@ -1132,12 +1142,13 @@ |
| static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
| Deoptimizer::BailoutType type) { |
| - __ EnterInternalFrame(); |
| - // Pass the function and deoptimization type to the runtime system. |
| - __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); |
| - __ push(r0); |
| - __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
| - __ LeaveInternalFrame(); |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + // Pass the function and deoptimization type to the runtime system. |
| + __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); |
| + __ push(r0); |
| + __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
| + } |
| // Get the full codegen state from the stack and untag it -> r6. |
| __ ldr(r6, MemOperand(sp, 0 * kPointerSize)); |
| @@ -1177,9 +1188,10 @@ |
| // the registers without worrying about which of them contain |
| // pointers. This seems a bit fragile. |
| __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved | lr.bit() | fp.bit()); |
| - __ EnterInternalFrame(); |
| - __ CallRuntime(Runtime::kNotifyOSR, 0); |
| - __ LeaveInternalFrame(); |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + __ CallRuntime(Runtime::kNotifyOSR, 0); |
| + } |
| __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved | lr.bit() | fp.bit()); |
| __ Ret(); |
| } |
| @@ -1195,10 +1207,11 @@ |
| // Lookup the function in the JavaScript frame and push it as an |
| // argument to the on-stack replacement function. |
| __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| - __ EnterInternalFrame(); |
| - __ push(r0); |
| - __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
| - __ LeaveInternalFrame(); |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + __ push(r0); |
| + __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
| + } |
| // If the result was -1 it means that we couldn't optimize the |
| // function. Just return and continue in the unoptimized version. |
| @@ -1282,17 +1295,23 @@ |
| __ b(ge, &shift_arguments); |
| __ bind(&convert_to_object); |
| - __ EnterInternalFrame(); // In order to preserve argument count. |
| - __ mov(r0, Operand(r0, LSL, kSmiTagSize)); // Smi-tagged. |
| - __ push(r0); |
| - __ push(r2); |
| - __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| - __ mov(r2, r0); |
| + { |
| + // Enter an internal frame in order to preserve argument count. |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + __ mov(r0, Operand(r0, LSL, kSmiTagSize)); // Smi-tagged. |
| + __ push(r0); |
| - __ pop(r0); |
| - __ mov(r0, Operand(r0, ASR, kSmiTagSize)); |
| - __ LeaveInternalFrame(); |
| + __ push(r2); |
| + __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| + __ mov(r2, r0); |
| + |
| + __ pop(r0); |
| + __ mov(r0, Operand(r0, ASR, kSmiTagSize)); |
| + |
| + // Exit the internal frame. |
| + } |
| + |
| // Restore the function to r1. |
| __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); |
| __ jmp(&patch_receiver); |
| @@ -1392,7 +1411,8 @@ |
| const int kRecvOffset = 3 * kPointerSize; |
| const int kFunctionOffset = 4 * kPointerSize; |
| - __ EnterInternalFrame(); |
| +{ |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function |
| __ push(r0); |
| @@ -1520,7 +1540,8 @@ |
| NullCallWrapper(), CALL_AS_METHOD); |
| // Tear down the internal frame and remove function, receiver and args. |
| - __ LeaveInternalFrame(); |
| +} |
| + |
| __ add(sp, sp, Operand(3 * kPointerSize)); |
| __ Jump(lr); |
| } |