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

Side by Side Diff: src/crankshaft/arm64/lithium-codegen-arm64.cc

Issue 2604833004: [builtins] FastNewFunctionContextStub becomes a builtin (Closed)
Patch Set: That was unnecessary, reverted :) Created 3 years, 11 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 10 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 11 #include "src/code-stubs.h"
11 #include "src/crankshaft/arm64/lithium-gap-resolver-arm64.h" 12 #include "src/crankshaft/arm64/lithium-gap-resolver-arm64.h"
12 #include "src/crankshaft/hydrogen-osr.h" 13 #include "src/crankshaft/hydrogen-osr.h"
13 #include "src/ic/ic.h" 14 #include "src/ic/ic.h"
14 #include "src/ic/stub-cache.h" 15 #include "src/ic/stub-cache.h"
15 16
16 namespace v8 { 17 namespace v8 {
17 namespace internal { 18 namespace internal {
18 19
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 bool need_write_barrier = true; 612 bool need_write_barrier = true;
612 // Argument to NewContext is the function, which is in x1. 613 // Argument to NewContext is the function, which is in x1.
613 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 614 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
614 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; 615 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt;
615 if (info()->scope()->is_script_scope()) { 616 if (info()->scope()->is_script_scope()) {
616 __ Mov(x10, Operand(info()->scope()->scope_info())); 617 __ Mov(x10, Operand(info()->scope()->scope_info()));
617 __ Push(x1, x10); 618 __ Push(x1, x10);
618 __ CallRuntime(Runtime::kNewScriptContext); 619 __ CallRuntime(Runtime::kNewScriptContext);
619 deopt_mode = Safepoint::kLazyDeopt; 620 deopt_mode = Safepoint::kLazyDeopt;
620 } else { 621 } else {
621 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { 622 if (slots <=
622 FastNewFunctionContextStub stub(isolate(), 623 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
623 info()->scope()->scope_type()); 624 Callable callable = CodeFactory::FastNewFunctionContext(
625 isolate(), info()->scope()->scope_type());
624 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); 626 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
625 __ CallStub(&stub); 627 __ Call(callable.code(), RelocInfo::CODE_TARGET);
626 // Result of FastNewFunctionContextStub is always in new space. 628 // Result of the FastNewFunctionContext builtin is always in new space.
627 need_write_barrier = false; 629 need_write_barrier = false;
628 } else { 630 } else {
629 __ Push(x1); 631 __ Push(x1);
630 __ Push(Smi::FromInt(info()->scope()->scope_type())); 632 __ Push(Smi::FromInt(info()->scope()->scope_type()));
631 __ CallRuntime(Runtime::kNewFunctionContext); 633 __ CallRuntime(Runtime::kNewFunctionContext);
632 } 634 }
633 } 635 }
634 RecordSafepoint(deopt_mode); 636 RecordSafepoint(deopt_mode);
635 // Context is returned in x0. It replaces the context passed to us. It's 637 // Context is returned in x0. It replaces the context passed to us. It's
636 // saved in the stack and kept live in cp. 638 // saved in the stack and kept live in cp.
(...skipping 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after
5589 // Index is equal to negated out of object property index plus 1. 5591 // Index is equal to negated out of object property index plus 1.
5590 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5592 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5591 __ Ldr(result, FieldMemOperand(result, 5593 __ Ldr(result, FieldMemOperand(result,
5592 FixedArray::kHeaderSize - kPointerSize)); 5594 FixedArray::kHeaderSize - kPointerSize));
5593 __ Bind(deferred->exit()); 5595 __ Bind(deferred->exit());
5594 __ Bind(&done); 5596 __ Bind(&done);
5595 } 5597 }
5596 5598
5597 } // namespace internal 5599 } // namespace internal
5598 } // namespace v8 5600 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698