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

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.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, 4 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/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 int remaining = locals_count % kMaxPushes; 164 int remaining = locals_count % kMaxPushes;
165 // Emit the remaining pushes. 165 // Emit the remaining pushes.
166 __ PushMultipleTimes(x10 , remaining); 166 __ PushMultipleTimes(x10 , remaining);
167 } 167 }
168 } 168 }
169 } 169 }
170 170
171 bool function_in_register_x1 = true; 171 bool function_in_register_x1 = true;
172 172
173 if (info->scope()->num_heap_slots() > 0) { 173 if (info->scope()->NeedsContext()) {
174 // Argument to NewContext is the function, which is still in x1. 174 // Argument to NewContext is the function, which is still in x1.
175 Comment cmnt(masm_, "[ Allocate context"); 175 Comment cmnt(masm_, "[ Allocate context");
176 bool need_write_barrier = true; 176 bool need_write_barrier = true;
177 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 177 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
178 if (info->scope()->is_script_scope()) { 178 if (info->scope()->is_script_scope()) {
179 __ Mov(x10, Operand(info->scope()->GetScopeInfo(info->isolate()))); 179 __ Mov(x10, Operand(info->scope()->GetScopeInfo(info->isolate())));
180 __ Push(x1, x10); 180 __ Push(x1, x10);
181 __ CallRuntime(Runtime::kNewScriptContext); 181 __ CallRuntime(Runtime::kNewScriptContext);
182 PrepareForBailoutForId(BailoutId::ScriptContext(), 182 PrepareForBailoutForId(BailoutId::ScriptContext(),
183 BailoutState::TOS_REGISTER); 183 BailoutState::TOS_REGISTER);
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1193
1194 1194
1195 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1195 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1196 Label* slow) { 1196 Label* slow) {
1197 DCHECK(var->IsContextSlot()); 1197 DCHECK(var->IsContextSlot());
1198 Register context = cp; 1198 Register context = cp;
1199 Register next = x10; 1199 Register next = x10;
1200 Register temp = x11; 1200 Register temp = x11;
1201 1201
1202 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { 1202 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) {
1203 if (s->num_heap_slots() > 0) { 1203 if (s->NeedsContext()) {
1204 if (s->calls_sloppy_eval()) { 1204 if (s->calls_sloppy_eval()) {
1205 // Check that extension is "the hole". 1205 // Check that extension is "the hole".
1206 __ Ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX)); 1206 __ Ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
1207 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); 1207 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
1208 } 1208 }
1209 __ Ldr(next, ContextMemOperand(context, Context::PREVIOUS_INDEX)); 1209 __ Ldr(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
1210 // Walk the rest of the chain without clobbering cp. 1210 // Walk the rest of the chain without clobbering cp.
1211 context = next; 1211 context = next;
1212 } 1212 }
1213 } 1213 }
(...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after
3825 } 3825 }
3826 3826
3827 return INTERRUPT; 3827 return INTERRUPT;
3828 } 3828 }
3829 3829
3830 3830
3831 } // namespace internal 3831 } // namespace internal
3832 } // namespace v8 3832 } // namespace v8
3833 3833
3834 #endif // V8_TARGET_ARCH_ARM64 3834 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698