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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 __ Dsubu(sp, sp, Operand(remaining * kPointerSize)); 169 __ Dsubu(sp, sp, Operand(remaining * kPointerSize));
170 for (int i = 0; i < remaining; i++) { 170 for (int i = 0; i < remaining; i++) {
171 __ sd(t1, MemOperand(sp, i * kPointerSize)); 171 __ sd(t1, MemOperand(sp, i * kPointerSize));
172 } 172 }
173 } 173 }
174 } 174 }
175 175
176 bool function_in_register_a1 = true; 176 bool function_in_register_a1 = true;
177 177
178 // Possibly allocate a local context. 178 // Possibly allocate a local context.
179 if (info->scope()->num_heap_slots() > 0) { 179 if (info->scope()->NeedsContext()) {
180 Comment cmnt(masm_, "[ Allocate context"); 180 Comment cmnt(masm_, "[ Allocate context");
181 // Argument to NewContext is the function, which is still in a1. 181 // Argument to NewContext is the function, which is still in a1.
182 bool need_write_barrier = true; 182 bool need_write_barrier = true;
183 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 183 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
184 if (info->scope()->is_script_scope()) { 184 if (info->scope()->is_script_scope()) {
185 __ push(a1); 185 __ push(a1);
186 __ Push(info->scope()->GetScopeInfo(info->isolate())); 186 __ Push(info->scope()->GetScopeInfo(info->isolate()));
187 __ CallRuntime(Runtime::kNewScriptContext); 187 __ CallRuntime(Runtime::kNewScriptContext);
188 PrepareForBailoutForId(BailoutId::ScriptContext(), 188 PrepareForBailoutForId(BailoutId::ScriptContext(),
189 BailoutState::TOS_REGISTER); 189 BailoutState::TOS_REGISTER);
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 1201
1202 1202
1203 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1203 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1204 Label* slow) { 1204 Label* slow) {
1205 DCHECK(var->IsContextSlot()); 1205 DCHECK(var->IsContextSlot());
1206 Register context = cp; 1206 Register context = cp;
1207 Register next = a3; 1207 Register next = a3;
1208 Register temp = a4; 1208 Register temp = a4;
1209 1209
1210 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { 1210 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) {
1211 if (s->num_heap_slots() > 0) { 1211 if (s->NeedsContext()) {
1212 if (s->calls_sloppy_eval()) { 1212 if (s->calls_sloppy_eval()) {
1213 // Check that extension is "the hole". 1213 // Check that extension is "the hole".
1214 __ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX)); 1214 __ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
1215 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); 1215 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
1216 } 1216 }
1217 __ ld(next, ContextMemOperand(context, Context::PREVIOUS_INDEX)); 1217 __ ld(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
1218 // Walk the rest of the chain without clobbering cp. 1218 // Walk the rest of the chain without clobbering cp.
1219 context = next; 1219 context = next;
1220 } 1220 }
1221 } 1221 }
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after
3763 reinterpret_cast<uint64_t>( 3763 reinterpret_cast<uint64_t>(
3764 isolate->builtins()->OnStackReplacement()->entry())); 3764 isolate->builtins()->OnStackReplacement()->entry()));
3765 return ON_STACK_REPLACEMENT; 3765 return ON_STACK_REPLACEMENT;
3766 } 3766 }
3767 3767
3768 3768
3769 } // namespace internal 3769 } // namespace internal
3770 } // namespace v8 3770 } // namespace v8
3771 3771
3772 #endif // V8_TARGET_ARCH_MIPS64 3772 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698