| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 158 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
| 159 Isolate* isolate, | 159 Isolate* isolate, |
| 160 CodeStubInterfaceDescriptor* descriptor) { | 160 CodeStubInterfaceDescriptor* descriptor) { |
| 161 static Register registers[] = { r1 }; | 161 static Register registers[] = { r1 }; |
| 162 descriptor->register_param_count_ = 1; | 162 descriptor->register_param_count_ = 1; |
| 163 descriptor->register_params_ = registers; | 163 descriptor->register_params_ = registers; |
| 164 descriptor->deoptimization_handler_ = NULL; | 164 descriptor->deoptimization_handler_ = NULL; |
| 165 } | 165 } |
| 166 | 166 |
| 167 | 167 |
| 168 void KeyedArrayCallStub::InitializeInterfaceDescriptor( | |
| 169 Isolate* isolate, | |
| 170 CodeStubInterfaceDescriptor* descriptor) { | |
| 171 static Register registers[] = { r2 }; | |
| 172 descriptor->register_param_count_ = 1; | |
| 173 descriptor->register_params_ = registers; | |
| 174 descriptor->continuation_type_ = TAIL_CALL_CONTINUATION; | |
| 175 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | |
| 176 descriptor->deoptimization_handler_ = | |
| 177 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure); | |
| 178 } | |
| 179 | |
| 180 | |
| 181 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 168 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
| 182 Isolate* isolate, | 169 Isolate* isolate, |
| 183 CodeStubInterfaceDescriptor* descriptor) { | 170 CodeStubInterfaceDescriptor* descriptor) { |
| 184 static Register registers[] = { r2, r1, r0 }; | 171 static Register registers[] = { r2, r1, r0 }; |
| 185 descriptor->register_param_count_ = 3; | 172 descriptor->register_param_count_ = 3; |
| 186 descriptor->register_params_ = registers; | 173 descriptor->register_params_ = registers; |
| 187 descriptor->deoptimization_handler_ = | 174 descriptor->deoptimization_handler_ = |
| 188 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | 175 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); |
| 189 } | 176 } |
| 190 | 177 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 }; | 433 }; |
| 447 static Representation representations[] = { | 434 static Representation representations[] = { |
| 448 Representation::Tagged(), // context | 435 Representation::Tagged(), // context |
| 449 Representation::Tagged(), // receiver | 436 Representation::Tagged(), // receiver |
| 450 }; | 437 }; |
| 451 descriptor->register_param_count_ = 2; | 438 descriptor->register_param_count_ = 2; |
| 452 descriptor->register_params_ = registers; | 439 descriptor->register_params_ = registers; |
| 453 descriptor->param_representations_ = representations; | 440 descriptor->param_representations_ = representations; |
| 454 descriptor->platform_specific_descriptor_ = &default_descriptor; | 441 descriptor->platform_specific_descriptor_ = &default_descriptor; |
| 455 } | 442 } |
| 443 { |
| 444 CallInterfaceDescriptor* descriptor = |
| 445 isolate->call_descriptor(Isolate::ApiFunctionCall); |
| 446 static Register registers[] = { r0, // callee |
| 447 r4, // call_data |
| 448 r2, // holder |
| 449 r1, // api_function_address |
| 450 cp, // context |
| 451 }; |
| 452 static Representation representations[] = { |
| 453 Representation::Tagged(), // callee |
| 454 Representation::Tagged(), // call_data |
| 455 Representation::Tagged(), // holder |
| 456 Representation::External(), // api_function_address |
| 457 Representation::Tagged(), // context |
| 458 }; |
| 459 descriptor->register_param_count_ = 5; |
| 460 descriptor->register_params_ = registers; |
| 461 descriptor->param_representations_ = representations; |
| 462 descriptor->platform_specific_descriptor_ = &default_descriptor; |
| 463 } |
| 456 } | 464 } |
| 457 | 465 |
| 458 | 466 |
| 459 #define __ ACCESS_MASM(masm) | 467 #define __ ACCESS_MASM(masm) |
| 460 | 468 |
| 461 | 469 |
| 462 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 470 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
| 463 Label* slow, | 471 Label* slow, |
| 464 Condition cond); | 472 Condition cond); |
| 465 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 473 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
| (...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3073 __ str(r1, FieldMemOperand(r2, Cell::kValueOffset)); | 3081 __ str(r1, FieldMemOperand(r2, Cell::kValueOffset)); |
| 3074 // No need for a write barrier here - cells are rescanned. | 3082 // No need for a write barrier here - cells are rescanned. |
| 3075 | 3083 |
| 3076 __ bind(&done); | 3084 __ bind(&done); |
| 3077 } | 3085 } |
| 3078 | 3086 |
| 3079 | 3087 |
| 3080 void CallFunctionStub::Generate(MacroAssembler* masm) { | 3088 void CallFunctionStub::Generate(MacroAssembler* masm) { |
| 3081 // r1 : the function to call | 3089 // r1 : the function to call |
| 3082 // r2 : cache cell for call target | 3090 // r2 : cache cell for call target |
| 3083 Label slow, non_function; | 3091 Label slow, non_function, wrap, cont; |
| 3084 | 3092 |
| 3085 // Check that the function is really a JavaScript function. | 3093 if (NeedsChecks()) { |
| 3086 // r1: pushed function (to be verified) | 3094 // Check that the function is really a JavaScript function. |
| 3087 __ JumpIfSmi(r1, &non_function); | 3095 // r1: pushed function (to be verified) |
| 3096 __ JumpIfSmi(r1, &non_function); |
| 3088 | 3097 |
| 3089 // Goto slow case if we do not have a function. | 3098 // Goto slow case if we do not have a function. |
| 3090 __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE); | 3099 __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE); |
| 3091 __ b(ne, &slow); | 3100 __ b(ne, &slow); |
| 3092 | 3101 |
| 3093 if (RecordCallTarget()) { | 3102 if (RecordCallTarget()) { |
| 3094 GenerateRecordCallTarget(masm); | 3103 GenerateRecordCallTarget(masm); |
| 3104 } |
| 3095 } | 3105 } |
| 3096 | 3106 |
| 3097 // Fast-case: Invoke the function now. | 3107 // Fast-case: Invoke the function now. |
| 3098 // r1: pushed function | 3108 // r1: pushed function |
| 3099 ParameterCount actual(argc_); | 3109 ParameterCount actual(argc_); |
| 3100 | 3110 |
| 3111 if (CallAsMethod()) { |
| 3112 if (NeedsChecks()) { |
| 3113 // Do not transform the receiver for strict mode functions. |
| 3114 __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 3115 __ ldr(r3, FieldMemOperand(r2, SharedFunctionInfo::kCompilerHintsOffset)); |
| 3116 __ tst(r3, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + |
| 3117 kSmiTagSize))); |
| 3118 __ b(ne, &cont); |
| 3119 |
| 3120 // Do not transform the receiver for native (Compilerhints already in r3). |
| 3121 __ tst(r3, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); |
| 3122 __ b(ne, &cont); |
| 3123 } |
| 3124 |
| 3125 // Compute the receiver in non-strict mode. |
| 3126 __ ldr(r2, MemOperand(sp, argc_ * kPointerSize)); |
| 3127 |
| 3128 if (NeedsChecks()) { |
| 3129 // r0: actual number of arguments |
| 3130 // r1: function |
| 3131 // r2: first argument |
| 3132 __ JumpIfSmi(r2, &wrap); |
| 3133 __ CompareObjectType(r2, r3, r3, FIRST_SPEC_OBJECT_TYPE); |
| 3134 __ b(lt, &wrap); |
| 3135 } else { |
| 3136 __ jmp(&wrap); |
| 3137 } |
| 3138 |
| 3139 __ bind(&cont); |
| 3140 } |
| 3101 __ InvokeFunction(r1, actual, JUMP_FUNCTION, NullCallWrapper()); | 3141 __ InvokeFunction(r1, actual, JUMP_FUNCTION, NullCallWrapper()); |
| 3102 | 3142 |
| 3103 // Slow-case: Non-function called. | 3143 if (NeedsChecks()) { |
| 3104 __ bind(&slow); | 3144 // Slow-case: Non-function called. |
| 3105 if (RecordCallTarget()) { | 3145 __ bind(&slow); |
| 3106 // If there is a call target cache, mark it megamorphic in the | 3146 if (RecordCallTarget()) { |
| 3107 // non-function case. MegamorphicSentinel is an immortal immovable | 3147 // If there is a call target cache, mark it megamorphic in the |
| 3108 // object (undefined) so no write barrier is needed. | 3148 // non-function case. MegamorphicSentinel is an immortal immovable |
| 3109 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), | 3149 // object (undefined) so no write barrier is needed. |
| 3110 masm->isolate()->heap()->undefined_value()); | 3150 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), |
| 3111 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 3151 masm->isolate()->heap()->undefined_value()); |
| 3112 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); | 3152 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 3113 } | 3153 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); |
| 3114 // Check for function proxy. | 3154 } |
| 3115 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3155 // Check for function proxy. |
| 3116 __ b(ne, &non_function); | 3156 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 3117 __ push(r1); // put proxy as additional argument | 3157 __ b(ne, &non_function); |
| 3118 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); | 3158 __ push(r1); // put proxy as additional argument |
| 3119 __ mov(r2, Operand::Zero()); | 3159 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); |
| 3120 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY); | 3160 __ mov(r2, Operand::Zero()); |
| 3121 { | 3161 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY); |
| 3122 Handle<Code> adaptor = | 3162 { |
| 3123 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); | 3163 Handle<Code> adaptor = |
| 3124 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 3164 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
| 3165 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
| 3166 } |
| 3167 |
| 3168 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
| 3169 // of the original receiver from the call site). |
| 3170 __ bind(&non_function); |
| 3171 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); |
| 3172 __ mov(r0, Operand(argc_)); // Set up the number of arguments. |
| 3173 __ mov(r2, Operand::Zero()); |
| 3174 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION); |
| 3175 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 3176 RelocInfo::CODE_TARGET); |
| 3125 } | 3177 } |
| 3126 | 3178 |
| 3127 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 3179 if (CallAsMethod()) { |
| 3128 // of the original receiver from the call site). | 3180 __ bind(&wrap); |
| 3129 __ bind(&non_function); | 3181 // Wrap the receiver and patch it back onto the stack. |
| 3130 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); | 3182 { FrameScope frame_scope(masm, StackFrame::INTERNAL); |
| 3131 __ mov(r0, Operand(argc_)); // Set up the number of arguments. | 3183 __ push(r1); |
| 3132 __ mov(r2, Operand::Zero()); | 3184 __ push(r2); |
| 3133 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION); | 3185 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| 3134 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3186 __ pop(r1); |
| 3135 RelocInfo::CODE_TARGET); | 3187 } |
| 3188 __ str(r0, MemOperand(sp, argc_ * kPointerSize)); |
| 3189 __ jmp(&cont); |
| 3190 } |
| 3136 } | 3191 } |
| 3137 | 3192 |
| 3138 | 3193 |
| 3139 void CallConstructStub::Generate(MacroAssembler* masm) { | 3194 void CallConstructStub::Generate(MacroAssembler* masm) { |
| 3140 // r0 : number of arguments | 3195 // r0 : number of arguments |
| 3141 // r1 : the function to call | 3196 // r1 : the function to call |
| 3142 // r2 : cache cell for call target | 3197 // r2 : cache cell for call target |
| 3143 Label slow, non_function_call; | 3198 Label slow, non_function_call; |
| 3144 | 3199 |
| 3145 // Check that the function is not a smi. | 3200 // Check that the function is not a smi. |
| (...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4979 if (function_mode_ == JS_FUNCTION_STUB_MODE) { | 5034 if (function_mode_ == JS_FUNCTION_STUB_MODE) { |
| 4980 __ add(r1, r1, Operand(1)); | 5035 __ add(r1, r1, Operand(1)); |
| 4981 } | 5036 } |
| 4982 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 5037 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
| 4983 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); | 5038 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); |
| 4984 __ add(sp, sp, r1); | 5039 __ add(sp, sp, r1); |
| 4985 __ Ret(); | 5040 __ Ret(); |
| 4986 } | 5041 } |
| 4987 | 5042 |
| 4988 | 5043 |
| 4989 void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) { | |
| 4990 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); | |
| 4991 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); | |
| 4992 __ mov(r1, r0); | |
| 4993 int parameter_count_offset = | |
| 4994 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | |
| 4995 __ ldr(r0, MemOperand(fp, parameter_count_offset)); | |
| 4996 // The parameter count above includes the receiver for the arguments passed to | |
| 4997 // the deoptimization handler. Subtract the receiver for the parameter count | |
| 4998 // for the call. | |
| 4999 __ sub(r0, r0, Operand(1)); | |
| 5000 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | |
| 5001 ParameterCount argument_count(r0); | |
| 5002 __ InvokeFunction(r1, argument_count, JUMP_FUNCTION, NullCallWrapper()); | |
| 5003 } | |
| 5004 | |
| 5005 | |
| 5006 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 5044 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
| 5007 if (masm->isolate()->function_entry_hook() != NULL) { | 5045 if (masm->isolate()->function_entry_hook() != NULL) { |
| 5008 PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize); | 5046 PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize); |
| 5009 ProfileEntryHookStub stub; | 5047 ProfileEntryHookStub stub; |
| 5010 __ push(lr); | 5048 __ push(lr); |
| 5011 __ CallStub(&stub); | 5049 __ CallStub(&stub); |
| 5012 __ pop(lr); | 5050 __ pop(lr); |
| 5013 } | 5051 } |
| 5014 } | 5052 } |
| 5015 | 5053 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5372 __ bind(&fast_elements_case); | 5410 __ bind(&fast_elements_case); |
| 5373 GenerateCase(masm, FAST_ELEMENTS); | 5411 GenerateCase(masm, FAST_ELEMENTS); |
| 5374 } | 5412 } |
| 5375 | 5413 |
| 5376 | 5414 |
| 5377 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5415 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5378 // ----------- S t a t e ------------- | 5416 // ----------- S t a t e ------------- |
| 5379 // -- r0 : callee | 5417 // -- r0 : callee |
| 5380 // -- r4 : call_data | 5418 // -- r4 : call_data |
| 5381 // -- r2 : holder | 5419 // -- r2 : holder |
| 5382 // -- r3 : api_function_address | 5420 // -- r1 : api_function_address |
| 5383 // -- r1 : thunk_arg | |
| 5384 // -- cp : context | 5421 // -- cp : context |
| 5385 // -- | 5422 // -- |
| 5386 // -- esp[0] : last argument | 5423 // -- sp[0] : last argument |
| 5387 // -- ... | 5424 // -- ... |
| 5388 // -- esp[(argc - 1)* 4] : first argument | 5425 // -- sp[(argc - 1)* 4] : first argument |
| 5389 // -- esp[argc * 4] : receiver | 5426 // -- sp[argc * 4] : receiver |
| 5390 // ----------------------------------- | 5427 // ----------------------------------- |
| 5391 | 5428 |
| 5392 Register callee = r0; | 5429 Register callee = r0; |
| 5393 Register call_data = r4; | 5430 Register call_data = r4; |
| 5394 Register holder = r2; | 5431 Register holder = r2; |
| 5395 Register api_function_address = r3; | 5432 Register api_function_address = r1; |
| 5396 Register thunk_arg = r1; | |
| 5397 Register context = cp; | 5433 Register context = cp; |
| 5398 | 5434 |
| 5399 int argc = ArgumentBits::decode(bit_field_); | 5435 int argc = ArgumentBits::decode(bit_field_); |
| 5400 bool restore_context = RestoreContextBits::decode(bit_field_); | 5436 bool restore_context = RestoreContextBits::decode(bit_field_); |
| 5401 bool call_data_undefined = CallDataUndefinedBits::decode(bit_field_); | 5437 bool call_data_undefined = CallDataUndefinedBits::decode(bit_field_); |
| 5402 | 5438 |
| 5403 typedef FunctionCallbackArguments FCA; | 5439 typedef FunctionCallbackArguments FCA; |
| 5404 | 5440 |
| 5405 STATIC_ASSERT(FCA::kContextSaveIndex == 6); | 5441 STATIC_ASSERT(FCA::kContextSaveIndex == 6); |
| 5406 STATIC_ASSERT(FCA::kCalleeIndex == 5); | 5442 STATIC_ASSERT(FCA::kCalleeIndex == 5); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5442 // Prepare arguments. | 5478 // Prepare arguments. |
| 5443 __ mov(scratch, sp); | 5479 __ mov(scratch, sp); |
| 5444 | 5480 |
| 5445 // Allocate the v8::Arguments structure in the arguments' space since | 5481 // Allocate the v8::Arguments structure in the arguments' space since |
| 5446 // it's not controlled by GC. | 5482 // it's not controlled by GC. |
| 5447 const int kApiStackSpace = 4; | 5483 const int kApiStackSpace = 4; |
| 5448 | 5484 |
| 5449 FrameScope frame_scope(masm, StackFrame::MANUAL); | 5485 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 5450 __ EnterExitFrame(false, kApiStackSpace); | 5486 __ EnterExitFrame(false, kApiStackSpace); |
| 5451 | 5487 |
| 5452 ASSERT(!thunk_arg.is(r0) && !api_function_address.is(r0) && !scratch.is(r0)); | 5488 ASSERT(!api_function_address.is(r0) && !scratch.is(r0)); |
| 5453 // r0 = FunctionCallbackInfo& | 5489 // r0 = FunctionCallbackInfo& |
| 5454 // Arguments is after the return address. | 5490 // Arguments is after the return address. |
| 5455 __ add(r0, sp, Operand(1 * kPointerSize)); | 5491 __ add(r0, sp, Operand(1 * kPointerSize)); |
| 5456 // FunctionCallbackInfo::implicit_args_ | 5492 // FunctionCallbackInfo::implicit_args_ |
| 5457 __ str(scratch, MemOperand(r0, 0 * kPointerSize)); | 5493 __ str(scratch, MemOperand(r0, 0 * kPointerSize)); |
| 5458 // FunctionCallbackInfo::values_ | 5494 // FunctionCallbackInfo::values_ |
| 5459 __ add(ip, scratch, Operand((FCA::kArgsLength - 1 + argc) * kPointerSize)); | 5495 __ add(ip, scratch, Operand((FCA::kArgsLength - 1 + argc) * kPointerSize)); |
| 5460 __ str(ip, MemOperand(r0, 1 * kPointerSize)); | 5496 __ str(ip, MemOperand(r0, 1 * kPointerSize)); |
| 5461 // FunctionCallbackInfo::length_ = argc | 5497 // FunctionCallbackInfo::length_ = argc |
| 5462 __ mov(ip, Operand(argc)); | 5498 __ mov(ip, Operand(argc)); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5473 masm->isolate()); | 5509 masm->isolate()); |
| 5474 | 5510 |
| 5475 AllowExternalCallThatCantCauseGC scope(masm); | 5511 AllowExternalCallThatCantCauseGC scope(masm); |
| 5476 MemOperand context_restore_operand( | 5512 MemOperand context_restore_operand( |
| 5477 fp, (2 + FCA::kContextSaveIndex) * kPointerSize); | 5513 fp, (2 + FCA::kContextSaveIndex) * kPointerSize); |
| 5478 MemOperand return_value_operand(fp, | 5514 MemOperand return_value_operand(fp, |
| 5479 (2 + FCA::kReturnValueOffset) * kPointerSize); | 5515 (2 + FCA::kReturnValueOffset) * kPointerSize); |
| 5480 | 5516 |
| 5481 __ CallApiFunctionAndReturn(api_function_address, | 5517 __ CallApiFunctionAndReturn(api_function_address, |
| 5482 thunk_ref, | 5518 thunk_ref, |
| 5483 thunk_arg, | |
| 5484 kStackUnwindSpace, | 5519 kStackUnwindSpace, |
| 5485 return_value_operand, | 5520 return_value_operand, |
| 5486 restore_context ? | 5521 restore_context ? |
| 5487 &context_restore_operand : NULL); | 5522 &context_restore_operand : NULL); |
| 5488 } | 5523 } |
| 5489 | 5524 |
| 5490 | 5525 |
| 5526 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5527 // ----------- S t a t e ------------- |
| 5528 // -- sp[0] : name |
| 5529 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
| 5530 // -- ... |
| 5531 // -- r2 : api_function_address |
| 5532 // ----------------------------------- |
| 5533 |
| 5534 Register api_function_address = r2; |
| 5535 |
| 5536 __ mov(r0, sp); // r0 = Handle<Name> |
| 5537 __ add(r1, r0, Operand(1 * kPointerSize)); // r1 = PCA |
| 5538 |
| 5539 const int kApiStackSpace = 1; |
| 5540 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 5541 __ EnterExitFrame(false, kApiStackSpace); |
| 5542 |
| 5543 // Create PropertyAccessorInfo instance on the stack above the exit frame with |
| 5544 // r1 (internal::Object** args_) as the data. |
| 5545 __ str(r1, MemOperand(sp, 1 * kPointerSize)); |
| 5546 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& |
| 5547 |
| 5548 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 5549 |
| 5550 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
| 5551 ExternalReference::Type thunk_type = |
| 5552 ExternalReference::PROFILING_GETTER_CALL; |
| 5553 ApiFunction thunk_fun(thunk_address); |
| 5554 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
| 5555 masm->isolate()); |
| 5556 __ CallApiFunctionAndReturn(api_function_address, |
| 5557 thunk_ref, |
| 5558 kStackUnwindSpace, |
| 5559 MemOperand(fp, 6 * kPointerSize), |
| 5560 NULL); |
| 5561 } |
| 5562 |
| 5563 |
| 5491 #undef __ | 5564 #undef __ |
| 5492 | 5565 |
| 5493 } } // namespace v8::internal | 5566 } } // namespace v8::internal |
| 5494 | 5567 |
| 5495 #endif // V8_TARGET_ARCH_ARM | 5568 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |