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

Unified Diff: src/full-codegen/x64/full-codegen-x64.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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/x64/full-codegen-x64.cc
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc
index 98fd6a699e66e53f211c2fee0f4b1121fc99ce12..5da01e689c9dab0298e9c1bf975d36d756bdaa18 100644
--- a/src/full-codegen/x64/full-codegen-x64.cc
+++ b/src/full-codegen/x64/full-codegen-x64.cc
@@ -1222,10 +1222,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.
- __ cmpp(ContextOperand(context, Context::EXTENSION_INDEX),
- Immediate(0));
- __ j(not_equal, slow);
+ // Check that extension is "the hole".
+ __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX),
+ Heap::kTheHoleValueRootIndex, slow);
}
// Load next context in chain.
__ movp(temp, ContextOperand(context, Context::PREVIOUS_INDEX));
@@ -1252,9 +1251,9 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
// Terminate at native context.
__ cmpp(kScratchRegister, FieldOperand(temp, HeapObject::kMapOffset));
__ j(equal, &fast, Label::kNear);
- // Check that extension is NULL.
- __ cmpp(ContextOperand(temp, Context::EXTENSION_INDEX), Immediate(0));
- __ j(not_equal, slow);
+ // Check that extension is "the hole".
+ __ JumpIfNotRoot(ContextOperand(temp, Context::EXTENSION_INDEX),
+ Heap::kTheHoleValueRootIndex, slow);
// Load next context in chain.
__ movp(temp, ContextOperand(temp, Context::PREVIOUS_INDEX));
__ jmp(&next);
@@ -1276,19 +1275,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.
- __ cmpp(ContextOperand(context, Context::EXTENSION_INDEX),
- Immediate(0));
- __ j(not_equal, slow);
+ // Check that extension is "the hole".
+ __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX),
+ Heap::kTheHoleValueRootIndex, slow);
}
__ movp(temp, ContextOperand(context, Context::PREVIOUS_INDEX));
// Walk the rest of the chain without clobbering rsi.
context = temp;
}
}
- // Check that last extension is NULL.
- __ cmpp(ContextOperand(context, Context::EXTENSION_INDEX), Immediate(0));
- __ j(not_equal, slow);
+ // Check that last extension is "the hole".
+ __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX),
+ Heap::kTheHoleValueRootIndex, slow);
// This function is used only for loads, not stores, so it's safe to
// return an rsi-based operand (the write barrier cannot be allowed to
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698