| 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 5243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5254 __ str(r5, MemOperand(r9, kLimitOffset)); | 5254 __ str(r5, MemOperand(r9, kLimitOffset)); |
| 5255 __ mov(r4, r0); | 5255 __ mov(r4, r0); |
| 5256 __ PrepareCallCFunction(1, r5); | 5256 __ PrepareCallCFunction(1, r5); |
| 5257 __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); | 5257 __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); |
| 5258 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5258 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
| 5259 1); | 5259 1); |
| 5260 __ mov(r0, r4); | 5260 __ mov(r0, r4); |
| 5261 __ jmp(&leave_exit_frame); | 5261 __ jmp(&leave_exit_frame); |
| 5262 } | 5262 } |
| 5263 | 5263 |
| 5264 | |
| 5265 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5264 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
| 5266 const ParameterCount& argc, | 5265 const ParameterCount& argc, |
| 5267 bool return_first_arg, | 5266 bool return_first_arg, |
| 5268 bool call_data_undefined) { | 5267 bool call_data_undefined, bool is_lazy) { |
| 5269 // ----------- S t a t e ------------- | 5268 // ----------- S t a t e ------------- |
| 5270 // -- r0 : callee | 5269 // -- r0 : callee |
| 5271 // -- r4 : call_data | 5270 // -- r4 : call_data |
| 5272 // -- r2 : holder | 5271 // -- r2 : holder |
| 5273 // -- r1 : api_function_address | 5272 // -- r1 : api_function_address |
| 5274 // -- r3 : number of arguments if argc is a register | 5273 // -- r3 : number of arguments if argc is a register |
| 5275 // -- cp : context | 5274 // -- cp : context |
| 5276 // -- | 5275 // -- |
| 5277 // -- sp[0] : last argument | 5276 // -- sp[0] : last argument |
| 5278 // -- ... | 5277 // -- ... |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5294 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5293 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
| 5295 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5294 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
| 5296 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5295 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
| 5297 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5296 STATIC_ASSERT(FCA::kHolderIndex == 0); |
| 5298 STATIC_ASSERT(FCA::kArgsLength == 7); | 5297 STATIC_ASSERT(FCA::kArgsLength == 7); |
| 5299 | 5298 |
| 5300 DCHECK(argc.is_immediate() || r3.is(argc.reg())); | 5299 DCHECK(argc.is_immediate() || r3.is(argc.reg())); |
| 5301 | 5300 |
| 5302 // context save | 5301 // context save |
| 5303 __ push(context); | 5302 __ push(context); |
| 5304 // load context from callee | 5303 if (!is_lazy) { |
| 5305 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5304 // load context from callee |
| 5305 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5306 } |
| 5306 | 5307 |
| 5307 // callee | 5308 // callee |
| 5308 __ push(callee); | 5309 __ push(callee); |
| 5309 | 5310 |
| 5310 // call data | 5311 // call data |
| 5311 __ push(call_data); | 5312 __ push(call_data); |
| 5312 | 5313 |
| 5313 Register scratch = call_data; | 5314 Register scratch = call_data; |
| 5314 if (!call_data_undefined) { | 5315 if (!call_data_undefined) { |
| 5315 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5316 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5387 } | 5388 } |
| 5388 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5389 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
| 5389 stack_space_operand, return_value_operand, | 5390 stack_space_operand, return_value_operand, |
| 5390 &context_restore_operand); | 5391 &context_restore_operand); |
| 5391 } | 5392 } |
| 5392 | 5393 |
| 5393 | 5394 |
| 5394 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5395 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5395 bool call_data_undefined = this->call_data_undefined(); | 5396 bool call_data_undefined = this->call_data_undefined(); |
| 5396 CallApiFunctionStubHelper(masm, ParameterCount(r3), false, | 5397 CallApiFunctionStubHelper(masm, ParameterCount(r3), false, |
| 5397 call_data_undefined); | 5398 call_data_undefined, false); |
| 5398 } | 5399 } |
| 5399 | 5400 |
| 5400 | 5401 |
| 5401 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5402 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
| 5402 bool is_store = this->is_store(); | 5403 bool is_store = this->is_store(); |
| 5403 int argc = this->argc(); | 5404 int argc = this->argc(); |
| 5404 bool call_data_undefined = this->call_data_undefined(); | 5405 bool call_data_undefined = this->call_data_undefined(); |
| 5406 bool is_lazy = this->is_lazy(); |
| 5405 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5407 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5406 call_data_undefined); | 5408 call_data_undefined, is_lazy); |
| 5407 } | 5409 } |
| 5408 | 5410 |
| 5409 | 5411 |
| 5410 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5412 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5411 // ----------- S t a t e ------------- | 5413 // ----------- S t a t e ------------- |
| 5412 // -- sp[0] : name | 5414 // -- sp[0] : name |
| 5413 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5415 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
| 5414 // -- ... | 5416 // -- ... |
| 5415 // -- r2 : api_function_address | 5417 // -- r2 : api_function_address |
| 5416 // ----------------------------------- | 5418 // ----------------------------------- |
| (...skipping 27 matching lines...) Expand all Loading... |
| 5444 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5446 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5445 } | 5447 } |
| 5446 | 5448 |
| 5447 | 5449 |
| 5448 #undef __ | 5450 #undef __ |
| 5449 | 5451 |
| 5450 } // namespace internal | 5452 } // namespace internal |
| 5451 } // namespace v8 | 5453 } // namespace v8 |
| 5452 | 5454 |
| 5453 #endif // V8_TARGET_ARCH_ARM | 5455 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |