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

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

Issue 1609233002: Do not eagerly instantiate accessors' JSFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. 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
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 5427 matching lines...) Expand 10 before | Expand all | Expand 10 after
5438 __ mov(s0, v0); 5438 __ mov(s0, v0);
5439 __ mov(a0, v0); 5439 __ mov(a0, v0);
5440 __ PrepareCallCFunction(1, s1); 5440 __ PrepareCallCFunction(1, s1);
5441 __ li(a0, Operand(ExternalReference::isolate_address(isolate))); 5441 __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
5442 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), 5442 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
5443 1); 5443 1);
5444 __ mov(v0, s0); 5444 __ mov(v0, s0);
5445 __ jmp(&leave_exit_frame); 5445 __ jmp(&leave_exit_frame);
5446 } 5446 }
5447 5447
5448
5449 static void CallApiFunctionStubHelper(MacroAssembler* masm, 5448 static void CallApiFunctionStubHelper(MacroAssembler* masm,
5450 const ParameterCount& argc, 5449 const ParameterCount& argc,
5451 bool return_first_arg, 5450 bool return_first_arg,
5452 bool call_data_undefined) { 5451 bool call_data_undefined, bool is_lazy) {
5453 // ----------- S t a t e ------------- 5452 // ----------- S t a t e -------------
5454 // -- a0 : callee 5453 // -- a0 : callee
5455 // -- t0 : call_data 5454 // -- t0 : call_data
5456 // -- a2 : holder 5455 // -- a2 : holder
5457 // -- a1 : api_function_address 5456 // -- a1 : api_function_address
5458 // -- a3 : number of arguments if argc is a register 5457 // -- a3 : number of arguments if argc is a register
5459 // -- cp : context 5458 // -- cp : context
5460 // -- 5459 // --
5461 // -- sp[0] : last argument 5460 // -- sp[0] : last argument
5462 // -- ... 5461 // -- ...
(...skipping 15 matching lines...) Expand all
5478 STATIC_ASSERT(FCA::kReturnValueOffset == 3); 5477 STATIC_ASSERT(FCA::kReturnValueOffset == 3);
5479 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); 5478 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
5480 STATIC_ASSERT(FCA::kIsolateIndex == 1); 5479 STATIC_ASSERT(FCA::kIsolateIndex == 1);
5481 STATIC_ASSERT(FCA::kHolderIndex == 0); 5480 STATIC_ASSERT(FCA::kHolderIndex == 0);
5482 STATIC_ASSERT(FCA::kArgsLength == 7); 5481 STATIC_ASSERT(FCA::kArgsLength == 7);
5483 5482
5484 DCHECK(argc.is_immediate() || a3.is(argc.reg())); 5483 DCHECK(argc.is_immediate() || a3.is(argc.reg()));
5485 5484
5486 // Save context, callee and call data. 5485 // Save context, callee and call data.
5487 __ Push(context, callee, call_data); 5486 __ Push(context, callee, call_data);
5488 // Load context from callee. 5487 if (!is_lazy) {
5489 __ lw(context, FieldMemOperand(callee, JSFunction::kContextOffset)); 5488 // Load context from callee.
5489 __ lw(context, FieldMemOperand(callee, JSFunction::kContextOffset));
5490 }
5490 5491
5491 Register scratch = call_data; 5492 Register scratch = call_data;
5492 if (!call_data_undefined) { 5493 if (!call_data_undefined) {
5493 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); 5494 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
5494 } 5495 }
5495 // Push return value and default return value. 5496 // Push return value and default return value.
5496 __ Push(scratch, scratch); 5497 __ Push(scratch, scratch);
5497 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); 5498 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
5498 // Push isolate and holder. 5499 // Push isolate and holder.
5499 __ Push(scratch, holder); 5500 __ Push(scratch, holder);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
5560 } 5561 }
5561 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, 5562 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
5562 stack_space_offset, return_value_operand, 5563 stack_space_offset, return_value_operand,
5563 &context_restore_operand); 5564 &context_restore_operand);
5564 } 5565 }
5565 5566
5566 5567
5567 void CallApiFunctionStub::Generate(MacroAssembler* masm) { 5568 void CallApiFunctionStub::Generate(MacroAssembler* masm) {
5568 bool call_data_undefined = this->call_data_undefined(); 5569 bool call_data_undefined = this->call_data_undefined();
5569 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, 5570 CallApiFunctionStubHelper(masm, ParameterCount(a3), false,
5570 call_data_undefined); 5571 call_data_undefined, false);
5571 } 5572 }
5572 5573
5573 5574
5574 void CallApiAccessorStub::Generate(MacroAssembler* masm) { 5575 void CallApiAccessorStub::Generate(MacroAssembler* masm) {
5575 bool is_store = this->is_store(); 5576 bool is_store = this->is_store();
5576 int argc = this->argc(); 5577 int argc = this->argc();
5577 bool call_data_undefined = this->call_data_undefined(); 5578 bool call_data_undefined = this->call_data_undefined();
5579 bool is_lazy = this->is_lazy();
5578 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, 5580 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store,
5579 call_data_undefined); 5581 call_data_undefined, is_lazy);
5580 } 5582 }
5581 5583
5582 5584
5583 void CallApiGetterStub::Generate(MacroAssembler* masm) { 5585 void CallApiGetterStub::Generate(MacroAssembler* masm) {
5584 // ----------- S t a t e ------------- 5586 // ----------- S t a t e -------------
5585 // -- sp[0] : name 5587 // -- sp[0] : name
5586 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ 5588 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_
5587 // -- ... 5589 // -- ...
5588 // -- a2 : api_function_address 5590 // -- a2 : api_function_address
5589 // ----------------------------------- 5591 // -----------------------------------
(...skipping 28 matching lines...) Expand all
5618 return_value_operand, NULL); 5620 return_value_operand, NULL);
5619 } 5621 }
5620 5622
5621 5623
5622 #undef __ 5624 #undef __
5623 5625
5624 } // namespace internal 5626 } // namespace internal
5625 } // namespace v8 5627 } // namespace v8
5626 5628
5627 #endif // V8_TARGET_ARCH_MIPS 5629 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698