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 5215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5226 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5226 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
5227 1); | 5227 1); |
5228 __ mov(r0, r4); | 5228 __ mov(r0, r4); |
5229 __ jmp(&leave_exit_frame); | 5229 __ jmp(&leave_exit_frame); |
5230 } | 5230 } |
5231 | 5231 |
5232 | 5232 |
5233 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5233 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5234 const ParameterCount& argc, | 5234 const ParameterCount& argc, |
5235 bool return_first_arg, | 5235 bool return_first_arg, |
5236 bool call_data_undefined) { | 5236 bool call_data_undefined, bool is_lazy) { |
5237 // ----------- S t a t e ------------- | 5237 // ----------- S t a t e ------------- |
5238 // -- r0 : callee | 5238 // -- r0 : callee |
5239 // -- r4 : call_data | 5239 // -- r4 : call_data |
5240 // -- r2 : holder | 5240 // -- r2 : holder |
5241 // -- r1 : api_function_address | 5241 // -- r1 : api_function_address |
5242 // -- r3 : number of arguments if argc is a register | 5242 // -- r3 : number of arguments if argc is a register |
5243 // -- cp : context | 5243 // -- cp : context |
5244 // -- | 5244 // -- |
5245 // -- sp[0] : last argument | 5245 // -- sp[0] : last argument |
5246 // -- ... | 5246 // -- ... |
(...skipping 15 matching lines...) Expand all Loading... |
5262 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5262 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
5263 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5263 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5264 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5264 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5265 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5265 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5266 STATIC_ASSERT(FCA::kArgsLength == 7); | 5266 STATIC_ASSERT(FCA::kArgsLength == 7); |
5267 | 5267 |
5268 DCHECK(argc.is_immediate() || r3.is(argc.reg())); | 5268 DCHECK(argc.is_immediate() || r3.is(argc.reg())); |
5269 | 5269 |
5270 // context save | 5270 // context save |
5271 __ push(context); | 5271 __ push(context); |
5272 // load context from callee | 5272 if (!is_lazy) { |
5273 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5273 // load context from callee |
| 5274 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5275 } |
5274 | 5276 |
5275 // callee | 5277 // callee |
5276 __ push(callee); | 5278 __ push(callee); |
5277 | 5279 |
5278 // call data | 5280 // call data |
5279 __ push(call_data); | 5281 __ push(call_data); |
5280 | 5282 |
5281 Register scratch = call_data; | 5283 Register scratch = call_data; |
5282 if (!call_data_undefined) { | 5284 if (!call_data_undefined) { |
5283 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5285 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5355 } | 5357 } |
5356 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5358 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
5357 stack_space_operand, return_value_operand, | 5359 stack_space_operand, return_value_operand, |
5358 &context_restore_operand); | 5360 &context_restore_operand); |
5359 } | 5361 } |
5360 | 5362 |
5361 | 5363 |
5362 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5364 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5363 bool call_data_undefined = this->call_data_undefined(); | 5365 bool call_data_undefined = this->call_data_undefined(); |
5364 CallApiFunctionStubHelper(masm, ParameterCount(r3), false, | 5366 CallApiFunctionStubHelper(masm, ParameterCount(r3), false, |
5365 call_data_undefined); | 5367 call_data_undefined, false); |
5366 } | 5368 } |
5367 | 5369 |
5368 | 5370 |
5369 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5371 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5370 bool is_store = this->is_store(); | 5372 bool is_store = this->is_store(); |
5371 int argc = this->argc(); | 5373 int argc = this->argc(); |
5372 bool call_data_undefined = this->call_data_undefined(); | 5374 bool call_data_undefined = this->call_data_undefined(); |
| 5375 bool is_lazy = this->is_lazy(); |
5373 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5376 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5374 call_data_undefined); | 5377 call_data_undefined, is_lazy); |
5375 } | 5378 } |
5376 | 5379 |
5377 | 5380 |
5378 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5381 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5379 // ----------- S t a t e ------------- | 5382 // ----------- S t a t e ------------- |
5380 // -- sp[0] : name | 5383 // -- sp[0] : name |
5381 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object | 5384 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
5382 // -- ... | 5385 // -- ... |
5383 // -- r2 : api_function_address | 5386 // -- r2 : api_function_address |
5384 // ----------------------------------- | 5387 // ----------------------------------- |
(...skipping 22 matching lines...) Expand all Loading... |
5407 MemOperand(fp, 6 * kPointerSize), NULL); | 5410 MemOperand(fp, 6 * kPointerSize), NULL); |
5408 } | 5411 } |
5409 | 5412 |
5410 | 5413 |
5411 #undef __ | 5414 #undef __ |
5412 | 5415 |
5413 } // namespace internal | 5416 } // namespace internal |
5414 } // namespace v8 | 5417 } // namespace v8 |
5415 | 5418 |
5416 #endif // V8_TARGET_ARCH_ARM | 5419 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |