OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 5357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5368 __ str(r5, MemOperand(r9, kLimitOffset)); | 5368 __ str(r5, MemOperand(r9, kLimitOffset)); |
5369 __ mov(r4, r0); | 5369 __ mov(r4, r0); |
5370 __ PrepareCallCFunction(1, r5); | 5370 __ PrepareCallCFunction(1, r5); |
5371 __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); | 5371 __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); |
5372 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5372 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
5373 1); | 5373 1); |
5374 __ mov(r0, r4); | 5374 __ mov(r0, r4); |
5375 __ jmp(&leave_exit_frame); | 5375 __ jmp(&leave_exit_frame); |
5376 } | 5376 } |
5377 | 5377 |
| 5378 |
5378 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5379 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5379 const ParameterCount& argc, | 5380 const ParameterCount& argc, |
5380 bool return_first_arg, | 5381 bool return_first_arg, |
5381 bool call_data_undefined, bool is_lazy) { | 5382 bool call_data_undefined) { |
5382 // ----------- S t a t e ------------- | 5383 // ----------- S t a t e ------------- |
5383 // -- r0 : callee | 5384 // -- r0 : callee |
5384 // -- r4 : call_data | 5385 // -- r4 : call_data |
5385 // -- r2 : holder | 5386 // -- r2 : holder |
5386 // -- r1 : api_function_address | 5387 // -- r1 : api_function_address |
5387 // -- r3 : number of arguments if argc is a register | 5388 // -- r3 : number of arguments if argc is a register |
5388 // -- cp : context | 5389 // -- cp : context |
5389 // -- | 5390 // -- |
5390 // -- sp[0] : last argument | 5391 // -- sp[0] : last argument |
5391 // -- ... | 5392 // -- ... |
(...skipping 15 matching lines...) Expand all Loading... |
5407 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5408 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
5408 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5409 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5409 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5410 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5410 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5411 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5411 STATIC_ASSERT(FCA::kArgsLength == 7); | 5412 STATIC_ASSERT(FCA::kArgsLength == 7); |
5412 | 5413 |
5413 DCHECK(argc.is_immediate() || r3.is(argc.reg())); | 5414 DCHECK(argc.is_immediate() || r3.is(argc.reg())); |
5414 | 5415 |
5415 // context save | 5416 // context save |
5416 __ push(context); | 5417 __ push(context); |
5417 if (!is_lazy) { | 5418 // load context from callee |
5418 // load context from callee | 5419 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
5419 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | |
5420 } | |
5421 | 5420 |
5422 // callee | 5421 // callee |
5423 __ push(callee); | 5422 __ push(callee); |
5424 | 5423 |
5425 // call data | 5424 // call data |
5426 __ push(call_data); | 5425 __ push(call_data); |
5427 | 5426 |
5428 Register scratch = call_data; | 5427 Register scratch = call_data; |
5429 if (!call_data_undefined) { | 5428 if (!call_data_undefined) { |
5430 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5429 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5502 } | 5501 } |
5503 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5502 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
5504 stack_space_operand, return_value_operand, | 5503 stack_space_operand, return_value_operand, |
5505 &context_restore_operand); | 5504 &context_restore_operand); |
5506 } | 5505 } |
5507 | 5506 |
5508 | 5507 |
5509 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5508 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5510 bool call_data_undefined = this->call_data_undefined(); | 5509 bool call_data_undefined = this->call_data_undefined(); |
5511 CallApiFunctionStubHelper(masm, ParameterCount(r3), false, | 5510 CallApiFunctionStubHelper(masm, ParameterCount(r3), false, |
5512 call_data_undefined, false); | 5511 call_data_undefined); |
5513 } | 5512 } |
5514 | 5513 |
5515 | 5514 |
5516 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5515 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5517 bool is_store = this->is_store(); | 5516 bool is_store = this->is_store(); |
5518 int argc = this->argc(); | 5517 int argc = this->argc(); |
5519 bool call_data_undefined = this->call_data_undefined(); | 5518 bool call_data_undefined = this->call_data_undefined(); |
5520 bool is_lazy = this->is_lazy(); | |
5521 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5519 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5522 call_data_undefined, is_lazy); | 5520 call_data_undefined); |
5523 } | 5521 } |
5524 | 5522 |
5525 | 5523 |
5526 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5524 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5527 // ----------- S t a t e ------------- | 5525 // ----------- S t a t e ------------- |
5528 // -- sp[0] : name | 5526 // -- sp[0] : name |
5529 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5527 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
5530 // -- ... | 5528 // -- ... |
5531 // -- r2 : api_function_address | 5529 // -- r2 : api_function_address |
5532 // ----------------------------------- | 5530 // ----------------------------------- |
(...skipping 27 matching lines...) Expand all Loading... |
5560 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5558 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5561 } | 5559 } |
5562 | 5560 |
5563 | 5561 |
5564 #undef __ | 5562 #undef __ |
5565 | 5563 |
5566 } // namespace internal | 5564 } // namespace internal |
5567 } // namespace v8 | 5565 } // namespace v8 |
5568 | 5566 |
5569 #endif // V8_TARGET_ARCH_ARM | 5567 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |