Chromium Code Reviews

Unified Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1484723003: [runtime] Use "the hole" instead of smi 0 as sentinel for context extension. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips64/full-codegen-mips64.cc
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc
index 9ee5e4073aa21723ccebf71def0bbb559cf8487f..6cd0a425452a6d197adc84ee6be82605b4408de3 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -1268,9 +1268,9 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
while (s != NULL) {
if (s->num_heap_slots() > 0) {
if (s->calls_sloppy_eval()) {
- // Check that extension is NULL.
+ // Check that extension is "the hole".
__ ld(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
- __ Branch(slow, ne, temp, Operand(zero_reg));
+ __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
}
// Load next context in chain.
__ ld(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
@@ -1293,9 +1293,9 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
__ ld(temp, FieldMemOperand(next, HeapObject::kMapOffset));
__ LoadRoot(a4, Heap::kNativeContextMapRootIndex);
__ Branch(&fast, eq, temp, Operand(a4));
- // Check that extension is NULL.
+ // Check that extension is "the hole".
__ ld(temp, ContextMemOperand(next, Context::EXTENSION_INDEX));
- __ Branch(slow, ne, temp, Operand(zero_reg));
+ __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
// Load next context in chain.
__ ld(next, ContextMemOperand(next, Context::PREVIOUS_INDEX));
__ Branch(&loop);
@@ -1318,18 +1318,18 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) {
if (s->num_heap_slots() > 0) {
if (s->calls_sloppy_eval()) {
- // Check that extension is NULL.
+ // Check that extension is "the hole".
__ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
- __ Branch(slow, ne, temp, Operand(zero_reg));
+ __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
}
__ ld(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
// Walk the rest of the chain without clobbering cp.
context = next;
}
}
- // Check that last extension is NULL.
+ // Check that last extension is "the hole".
__ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
- __ Branch(slow, ne, temp, Operand(zero_reg));
+ __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
// This function is used only for loads, not stores, so it's safe to
// return an cp-based operand (the write barrier cannot be allowed to
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine