| 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 5359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5370 bool is_store = this->is_store(); | 5370 bool is_store = this->is_store(); |
| 5371 int argc = this->argc(); | 5371 int argc = this->argc(); |
| 5372 bool call_data_undefined = this->call_data_undefined(); | 5372 bool call_data_undefined = this->call_data_undefined(); |
| 5373 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5373 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5374 call_data_undefined); | 5374 call_data_undefined); |
| 5375 } | 5375 } |
| 5376 | 5376 |
| 5377 | 5377 |
| 5378 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5378 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5379 // ----------- S t a t e ------------- | 5379 // ----------- S t a t e ------------- |
| 5380 // -- sp[0] : name | 5380 // -- sp[0] : name |
| 5381 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object | 5381 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
| 5382 // -- ... | 5382 // -- ... |
| 5383 // -- r2 : api_function_address | 5383 // -- r2 : api_function_address |
| 5384 // ----------------------------------- | 5384 // ----------------------------------- |
| 5385 | 5385 |
| 5386 Register api_function_address = ApiGetterDescriptor::function_address(); | 5386 Register api_function_address = ApiGetterDescriptor::function_address(); |
| 5387 DCHECK(api_function_address.is(r2)); | 5387 DCHECK(api_function_address.is(r2)); |
| 5388 | 5388 |
| 5389 __ mov(r0, sp); // r0 = Handle<Name> | 5389 // v8::PropertyCallbackInfo::args_ array and name handle. |
| 5390 __ add(r1, r0, Operand(1 * kPointerSize)); // r1 = PCA | 5390 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 5391 |
| 5392 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. |
| 5393 __ mov(r0, sp); // r0 = Handle<Name> |
| 5394 __ add(r1, r0, Operand(1 * kPointerSize)); // r1 = v8::PCI::args_ |
| 5391 | 5395 |
| 5392 const int kApiStackSpace = 1; | 5396 const int kApiStackSpace = 1; |
| 5393 FrameScope frame_scope(masm, StackFrame::MANUAL); | 5397 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 5394 __ EnterExitFrame(false, kApiStackSpace); | 5398 __ EnterExitFrame(false, kApiStackSpace); |
| 5395 | 5399 |
| 5396 // Create PropertyAccessorInfo instance on the stack above the exit frame with | 5400 // Create v8::PropertyCallbackInfo object on the stack and initialize |
| 5397 // r1 (internal::Object** args_) as the data. | 5401 // it's args_ field. |
| 5398 __ str(r1, MemOperand(sp, 1 * kPointerSize)); | 5402 __ str(r1, MemOperand(sp, 1 * kPointerSize)); |
| 5399 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& | 5403 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = v8::PropertyCallbackInfo& |
| 5400 | |
| 5401 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | |
| 5402 | 5404 |
| 5403 ExternalReference thunk_ref = | 5405 ExternalReference thunk_ref = |
| 5404 ExternalReference::invoke_accessor_getter_callback(isolate()); | 5406 ExternalReference::invoke_accessor_getter_callback(isolate()); |
| 5407 |
| 5408 // +3 is to skip prolog, return address and name handle. |
| 5409 MemOperand return_value_operand( |
| 5410 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
| 5405 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5411 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5406 kStackUnwindSpace, NULL, | 5412 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5407 MemOperand(fp, 6 * kPointerSize), NULL); | |
| 5408 } | 5413 } |
| 5409 | 5414 |
| 5410 | 5415 |
| 5411 #undef __ | 5416 #undef __ |
| 5412 | 5417 |
| 5413 } // namespace internal | 5418 } // namespace internal |
| 5414 } // namespace v8 | 5419 } // namespace v8 |
| 5415 | 5420 |
| 5416 #endif // V8_TARGET_ARCH_ARM | 5421 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |