| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 // Runtime::TraceExit returns the parameter as it is. | 270 // Runtime::TraceExit returns the parameter as it is. |
| 271 frame_->EmitPush(r0); | 271 frame_->EmitPush(r0); |
| 272 frame_->CallRuntime(Runtime::kTraceExit, 1); | 272 frame_->CallRuntime(Runtime::kTraceExit, 1); |
| 273 } | 273 } |
| 274 | 274 |
| 275 // Tear down the frame which will restore the caller's frame pointer and | 275 // Tear down the frame which will restore the caller's frame pointer and |
| 276 // the link register. | 276 // the link register. |
| 277 frame_->Exit(); | 277 frame_->Exit(); |
| 278 | 278 |
| 279 __ add(sp, sp, Operand((scope_->num_parameters() + 1) * kPointerSize)); | 279 __ add(sp, sp, Operand((scope_->num_parameters() + 1) * kPointerSize)); |
| 280 __ mov(pc, lr); | 280 __ Jump(lr); |
| 281 } | 281 } |
| 282 | 282 |
| 283 // Code generation state must be reset. | 283 // Code generation state must be reset. |
| 284 ASSERT(!has_cc()); | 284 ASSERT(!has_cc()); |
| 285 ASSERT(state_ == NULL); | 285 ASSERT(state_ == NULL); |
| 286 ASSERT(!function_return_is_shadowed_); | 286 ASSERT(!function_return_is_shadowed_); |
| 287 function_return_.Unuse(); | 287 function_return_.Unuse(); |
| 288 DeleteFrame(); | 288 DeleteFrame(); |
| 289 | 289 |
| 290 // Process any deferred code using the register allocator. | 290 // Process any deferred code using the register allocator. |
| (...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5027 void ArgumentsAccessStub::GenerateReadLength(MacroAssembler* masm) { | 5027 void ArgumentsAccessStub::GenerateReadLength(MacroAssembler* masm) { |
| 5028 // Check if the calling frame is an arguments adaptor frame. | 5028 // Check if the calling frame is an arguments adaptor frame. |
| 5029 Label adaptor; | 5029 Label adaptor; |
| 5030 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 5030 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 5031 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 5031 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
| 5032 __ cmp(r3, Operand(ArgumentsAdaptorFrame::SENTINEL)); | 5032 __ cmp(r3, Operand(ArgumentsAdaptorFrame::SENTINEL)); |
| 5033 __ b(eq, &adaptor); | 5033 __ b(eq, &adaptor); |
| 5034 | 5034 |
| 5035 // Nothing to do: The formal number of parameters has already been | 5035 // Nothing to do: The formal number of parameters has already been |
| 5036 // passed in register r0 by calling function. Just return it. | 5036 // passed in register r0 by calling function. Just return it. |
| 5037 __ mov(pc, lr); | 5037 __ Jump(lr); |
| 5038 | 5038 |
| 5039 // Arguments adaptor case: Read the arguments length from the | 5039 // Arguments adaptor case: Read the arguments length from the |
| 5040 // adaptor frame and return it. | 5040 // adaptor frame and return it. |
| 5041 __ bind(&adaptor); | 5041 __ bind(&adaptor); |
| 5042 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 5042 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 5043 __ mov(pc, lr); | 5043 __ Jump(lr); |
| 5044 } | 5044 } |
| 5045 | 5045 |
| 5046 | 5046 |
| 5047 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 5047 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
| 5048 // The displacement is the offset of the last parameter (if any) | 5048 // The displacement is the offset of the last parameter (if any) |
| 5049 // relative to the frame pointer. | 5049 // relative to the frame pointer. |
| 5050 static const int kDisplacement = | 5050 static const int kDisplacement = |
| 5051 StandardFrameConstants::kCallerSPOffset - kPointerSize; | 5051 StandardFrameConstants::kCallerSPOffset - kPointerSize; |
| 5052 | 5052 |
| 5053 // Check that the key is a smi. | 5053 // Check that the key is a smi. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 5065 // Check index against formal parameters count limit passed in | 5065 // Check index against formal parameters count limit passed in |
| 5066 // through register eax. Use unsigned comparison to get negative | 5066 // through register eax. Use unsigned comparison to get negative |
| 5067 // check for free. | 5067 // check for free. |
| 5068 __ cmp(r1, r0); | 5068 __ cmp(r1, r0); |
| 5069 __ b(cs, &slow); | 5069 __ b(cs, &slow); |
| 5070 | 5070 |
| 5071 // Read the argument from the stack and return it. | 5071 // Read the argument from the stack and return it. |
| 5072 __ sub(r3, r0, r1); | 5072 __ sub(r3, r0, r1); |
| 5073 __ add(r3, fp, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5073 __ add(r3, fp, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5074 __ ldr(r0, MemOperand(r3, kDisplacement)); | 5074 __ ldr(r0, MemOperand(r3, kDisplacement)); |
| 5075 __ mov(pc, lr); | 5075 __ Jump(lr); |
| 5076 | 5076 |
| 5077 // Arguments adaptor case: Check index against actual arguments | 5077 // Arguments adaptor case: Check index against actual arguments |
| 5078 // limit found in the arguments adaptor frame. Use unsigned | 5078 // limit found in the arguments adaptor frame. Use unsigned |
| 5079 // comparison to get negative check for free. | 5079 // comparison to get negative check for free. |
| 5080 __ bind(&adaptor); | 5080 __ bind(&adaptor); |
| 5081 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 5081 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 5082 __ cmp(r1, r0); | 5082 __ cmp(r1, r0); |
| 5083 __ b(cs, &slow); | 5083 __ b(cs, &slow); |
| 5084 | 5084 |
| 5085 // Read the argument from the adaptor frame and return it. | 5085 // Read the argument from the adaptor frame and return it. |
| 5086 __ sub(r3, r0, r1); | 5086 __ sub(r3, r0, r1); |
| 5087 __ add(r3, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5087 __ add(r3, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5088 __ ldr(r0, MemOperand(r3, kDisplacement)); | 5088 __ ldr(r0, MemOperand(r3, kDisplacement)); |
| 5089 __ mov(pc, lr); | 5089 __ Jump(lr); |
| 5090 | 5090 |
| 5091 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 5091 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
| 5092 // by calling the runtime system. | 5092 // by calling the runtime system. |
| 5093 __ bind(&slow); | 5093 __ bind(&slow); |
| 5094 __ push(r1); | 5094 __ push(r1); |
| 5095 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1); | 5095 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1); |
| 5096 } | 5096 } |
| 5097 | 5097 |
| 5098 | 5098 |
| 5099 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { | 5099 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5144 __ mov(r2, Operand(0)); | 5144 __ mov(r2, Operand(0)); |
| 5145 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 5145 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 5146 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 5146 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 5147 RelocInfo::CODE_TARGET); | 5147 RelocInfo::CODE_TARGET); |
| 5148 } | 5148 } |
| 5149 | 5149 |
| 5150 | 5150 |
| 5151 #undef __ | 5151 #undef __ |
| 5152 | 5152 |
| 5153 } } // namespace v8::internal | 5153 } } // namespace v8::internal |
| OLD | NEW |