Chromium Code Reviews

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

Issue 2269403003: Use NeedsContext() instead of comparing num_heap_slots(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « src/crankshaft/x64/lithium-x64.cc ('k') | src/crankshaft/x87/lithium-x87.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 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/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 116 matching lines...)
127 __ fninit(); 127 __ fninit();
128 128
129 return !is_aborted(); 129 return !is_aborted();
130 } 130 }
131 131
132 132
133 void LCodeGen::DoPrologue(LPrologue* instr) { 133 void LCodeGen::DoPrologue(LPrologue* instr) {
134 Comment(";;; Prologue begin"); 134 Comment(";;; Prologue begin");
135 135
136 // Possibly allocate a local context. 136 // Possibly allocate a local context.
137 if (info_->scope()->num_heap_slots() > 0) { 137 if (info_->scope()->NeedsContext()) {
138 Comment(";;; Allocate local context"); 138 Comment(";;; Allocate local context");
139 bool need_write_barrier = true; 139 bool need_write_barrier = true;
140 // Argument to NewContext is the function, which is still in edi. 140 // Argument to NewContext is the function, which is still in edi.
141 int slots = info_->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 141 int slots = info_->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
142 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; 142 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt;
143 if (info()->scope()->is_script_scope()) { 143 if (info()->scope()->is_script_scope()) {
144 __ push(edi); 144 __ push(edi);
145 __ Push(info()->scope()->GetScopeInfo(info()->isolate())); 145 __ Push(info()->scope()->GetScopeInfo(info()->isolate()));
146 __ CallRuntime(Runtime::kNewScriptContext); 146 __ CallRuntime(Runtime::kNewScriptContext);
147 deopt_mode = Safepoint::kLazyDeopt; 147 deopt_mode = Safepoint::kLazyDeopt;
(...skipping 5620 matching lines...)
5768 __ bind(deferred->exit()); 5768 __ bind(deferred->exit());
5769 __ bind(&done); 5769 __ bind(&done);
5770 } 5770 }
5771 5771
5772 #undef __ 5772 #undef __
5773 5773
5774 } // namespace internal 5774 } // namespace internal
5775 } // namespace v8 5775 } // namespace v8
5776 5776
5777 #endif // V8_TARGET_ARCH_X87 5777 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/crankshaft/x64/lithium-x64.cc ('k') | src/crankshaft/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine