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

Unified Diff: src/contexts.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/contexts.h ('k') | src/contexts-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index 50c4386a362f92dae9c36d99b75521aad25901f7..a1ad16a46f33a70512cee69f29403959ec4230f1 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -82,8 +82,8 @@ Context* Context::declaration_context() {
JSObject* Context::extension_object() {
DCHECK(IsNativeContext() || IsFunctionContext() || IsBlockContext());
- Object* object = extension();
- if (object == nullptr) return nullptr;
+ HeapObject* object = extension();
+ if (object->IsTheHole()) return nullptr;
if (IsBlockContext()) {
if (!object->IsSloppyBlockWithEvalContextExtension()) return nullptr;
object = SloppyBlockWithEvalContextExtension::cast(object)->extension();
@@ -103,7 +103,7 @@ JSReceiver* Context::extension_receiver() {
ScopeInfo* Context::scope_info() {
DCHECK(IsModuleContext() || IsScriptContext() || IsBlockContext());
- Object* object = extension();
+ HeapObject* object = extension();
if (object->IsSloppyBlockWithEvalContextExtension()) {
DCHECK(IsBlockContext());
object = SloppyBlockWithEvalContextExtension::cast(object)->scope_info();
« no previous file with comments | « src/contexts.h ('k') | src/contexts-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698