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

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

Issue 2445703002: Don't call FastNewFunctionContextStub if context is bigger than kMaxRegularHeapObjectSize. (Closed)
Patch Set: Created 4 years, 1 month 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/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 bool need_write_barrier = true; 588 bool need_write_barrier = true;
589 // Argument to NewContext is the function, which is in x1. 589 // Argument to NewContext is the function, which is in x1.
590 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 590 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
591 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; 591 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt;
592 if (info()->scope()->is_script_scope()) { 592 if (info()->scope()->is_script_scope()) {
593 __ Mov(x10, Operand(info()->scope()->scope_info())); 593 __ Mov(x10, Operand(info()->scope()->scope_info()));
594 __ Push(x1, x10); 594 __ Push(x1, x10);
595 __ CallRuntime(Runtime::kNewScriptContext); 595 __ CallRuntime(Runtime::kNewScriptContext);
596 deopt_mode = Safepoint::kLazyDeopt; 596 deopt_mode = Safepoint::kLazyDeopt;
597 } else { 597 } else {
598 FastNewFunctionContextStub stub(isolate()); 598 if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
599 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); 599 FastNewFunctionContextStub stub(isolate());
600 __ CallStub(&stub); 600 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
601 // Result of FastNewFunctionContextStub is always in new space. 601 __ CallStub(&stub);
602 need_write_barrier = false; 602 // Result of FastNewFunctionContextStub is always in new space.
603 need_write_barrier = false;
604 } else {
605 __ Push(x1);
606 __ CallRuntime(Runtime::kNewFunctionContext);
607 }
603 } 608 }
604 RecordSafepoint(deopt_mode); 609 RecordSafepoint(deopt_mode);
605 // Context is returned in x0. It replaces the context passed to us. It's 610 // Context is returned in x0. It replaces the context passed to us. It's
606 // saved in the stack and kept live in cp. 611 // saved in the stack and kept live in cp.
607 __ Mov(cp, x0); 612 __ Mov(cp, x0);
608 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 613 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset));
609 // Copy any necessary parameters into the context. 614 // Copy any necessary parameters into the context.
610 int num_parameters = info()->scope()->num_parameters(); 615 int num_parameters = info()->scope()->num_parameters();
611 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; 616 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0;
612 for (int i = first_parameter; i < num_parameters; i++) { 617 for (int i = first_parameter; i < num_parameters; i++) {
(...skipping 4961 matching lines...) Expand 10 before | Expand all | Expand 10 after
5574 // Index is equal to negated out of object property index plus 1. 5579 // Index is equal to negated out of object property index plus 1.
5575 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5580 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5576 __ Ldr(result, FieldMemOperand(result, 5581 __ Ldr(result, FieldMemOperand(result,
5577 FixedArray::kHeaderSize - kPointerSize)); 5582 FixedArray::kHeaderSize - kPointerSize));
5578 __ Bind(deferred->exit()); 5583 __ Bind(deferred->exit());
5579 __ Bind(&done); 5584 __ Bind(&done);
5580 } 5585 }
5581 5586
5582 } // namespace internal 5587 } // namespace internal
5583 } // namespace v8 5588 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698