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

Unified Diff: src/contexts-inl.h

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.cc ('k') | src/debug/debug-evaluate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts-inl.h
diff --git a/src/contexts-inl.h b/src/contexts-inl.h
index 67358a7a1dd3e2029fb6d9ccadaa7e437c4ebe47..67257ae0d71d794a9c75e92728223a498042069d 100644
--- a/src/contexts-inl.h
+++ b/src/contexts-inl.h
@@ -56,9 +56,13 @@ Context* Context::previous() {
void Context::set_previous(Context* context) { set(PREVIOUS_INDEX, context); }
-bool Context::has_extension() { return extension() != nullptr; }
-Object* Context::extension() { return get(EXTENSION_INDEX); }
-void Context::set_extension(Object* object) { set(EXTENSION_INDEX, object); }
+bool Context::has_extension() { return !extension()->IsTheHole(); }
+HeapObject* Context::extension() {
+ return HeapObject::cast(get(EXTENSION_INDEX));
+}
+void Context::set_extension(HeapObject* object) {
+ set(EXTENSION_INDEX, object);
+}
JSModule* Context::module() { return JSModule::cast(get(EXTENSION_INDEX)); }
« no previous file with comments | « src/contexts.cc ('k') | src/debug/debug-evaluate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698