Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: src/x87/code-stubs-x87.cc

Issue 1609233002: Do not eagerly instantiate accessors' JSFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make GCMole happy again. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_X87 5 #if V8_TARGET_ARCH_X87
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 5192 matching lines...) Expand 10 before | Expand all | Expand 10 after
5203 __ mov(Operand::StaticVariable(limit_address), edi); 5203 __ mov(Operand::StaticVariable(limit_address), edi);
5204 __ mov(edi, eax); 5204 __ mov(edi, eax);
5205 __ mov(Operand(esp, 0), 5205 __ mov(Operand(esp, 0),
5206 Immediate(ExternalReference::isolate_address(isolate))); 5206 Immediate(ExternalReference::isolate_address(isolate)));
5207 __ mov(eax, Immediate(delete_extensions)); 5207 __ mov(eax, Immediate(delete_extensions));
5208 __ call(eax); 5208 __ call(eax);
5209 __ mov(eax, edi); 5209 __ mov(eax, edi);
5210 __ jmp(&leave_exit_frame); 5210 __ jmp(&leave_exit_frame);
5211 } 5211 }
5212 5212
5213
5214 static void CallApiFunctionStubHelper(MacroAssembler* masm, 5213 static void CallApiFunctionStubHelper(MacroAssembler* masm,
5215 const ParameterCount& argc, 5214 const ParameterCount& argc,
5216 bool return_first_arg, 5215 bool return_first_arg,
5217 bool call_data_undefined) { 5216 bool call_data_undefined, bool is_lazy) {
5218 // ----------- S t a t e ------------- 5217 // ----------- S t a t e -------------
5219 // -- edi : callee 5218 // -- edi : callee
5220 // -- ebx : call_data 5219 // -- ebx : call_data
5221 // -- ecx : holder 5220 // -- ecx : holder
5222 // -- edx : api_function_address 5221 // -- edx : api_function_address
5223 // -- esi : context 5222 // -- esi : context
5224 // -- eax : number of arguments if argc is a register 5223 // -- eax : number of arguments if argc is a register
5225 // -- 5224 // --
5226 // -- esp[0] : return address 5225 // -- esp[0] : return address
5227 // -- esp[4] : last argument 5226 // -- esp[4] : last argument
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
5281 // isolate 5280 // isolate
5282 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); 5281 __ push(Immediate(reinterpret_cast<int>(masm->isolate())));
5283 // holder 5282 // holder
5284 __ push(holder); 5283 __ push(holder);
5285 5284
5286 __ mov(scratch, esp); 5285 __ mov(scratch, esp);
5287 5286
5288 // push return address 5287 // push return address
5289 __ push(return_address); 5288 __ push(return_address);
5290 5289
5291 // load context from callee 5290 if (!is_lazy) {
5292 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); 5291 // load context from callee
5292 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset));
5293 }
5293 5294
5294 // API function gets reference to the v8::Arguments. If CPU profiler 5295 // API function gets reference to the v8::Arguments. If CPU profiler
5295 // is enabled wrapper function will be called and we need to pass 5296 // is enabled wrapper function will be called and we need to pass
5296 // address of the callback as additional parameter, always allocate 5297 // address of the callback as additional parameter, always allocate
5297 // space for it. 5298 // space for it.
5298 const int kApiArgc = 1 + 1; 5299 const int kApiArgc = 1 + 1;
5299 5300
5300 // Allocate the v8::Arguments structure in the arguments' space since 5301 // Allocate the v8::Arguments structure in the arguments' space since
5301 // it's not controlled by GC. 5302 // it's not controlled by GC.
5302 const int kApiStackSpace = 4; 5303 const int kApiStackSpace = 4;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
5354 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5355 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5355 ApiParameterOperand(1), stack_space, 5356 ApiParameterOperand(1), stack_space,
5356 stack_space_operand, return_value_operand, 5357 stack_space_operand, return_value_operand,
5357 &context_restore_operand); 5358 &context_restore_operand);
5358 } 5359 }
5359 5360
5360 5361
5361 void CallApiFunctionStub::Generate(MacroAssembler* masm) { 5362 void CallApiFunctionStub::Generate(MacroAssembler* masm) {
5362 bool call_data_undefined = this->call_data_undefined(); 5363 bool call_data_undefined = this->call_data_undefined();
5363 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, 5364 CallApiFunctionStubHelper(masm, ParameterCount(eax), false,
5364 call_data_undefined); 5365 call_data_undefined, false);
5365 } 5366 }
5366 5367
5367 5368
5368 void CallApiAccessorStub::Generate(MacroAssembler* masm) { 5369 void CallApiAccessorStub::Generate(MacroAssembler* masm) {
5369 bool is_store = this->is_store(); 5370 bool is_store = this->is_store();
5370 int argc = this->argc(); 5371 int argc = this->argc();
5371 bool call_data_undefined = this->call_data_undefined(); 5372 bool call_data_undefined = this->call_data_undefined();
5373 bool is_lazy = this->is_lazy();
5372 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, 5374 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store,
5373 call_data_undefined); 5375 call_data_undefined, is_lazy);
5374 } 5376 }
5375 5377
5376 5378
5377 void CallApiGetterStub::Generate(MacroAssembler* masm) { 5379 void CallApiGetterStub::Generate(MacroAssembler* masm) {
5378 // ----------- S t a t e ------------- 5380 // ----------- S t a t e -------------
5379 // -- esp[0] : return address 5381 // -- esp[0] : return address
5380 // -- esp[4] : name 5382 // -- esp[4] : name
5381 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ 5383 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_
5382 // -- ... 5384 // -- ...
5383 // -- edx : api_function_address 5385 // -- edx : api_function_address
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5422 return_value_operand, NULL); 5424 return_value_operand, NULL);
5423 } 5425 }
5424 5426
5425 5427
5426 #undef __ 5428 #undef __
5427 5429
5428 } // namespace internal 5430 } // namespace internal
5429 } // namespace v8 5431 } // namespace v8
5430 5432
5431 #endif // V8_TARGET_ARCH_X87 5433 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698