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

Unified Diff: src/contexts.h

Issue 11564012: Merged r13161 into 3.14 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.14
Patch Set: Created 8 years 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 | « no previous file | src/lithium.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index 28e4af53682b2fa6a55623914720d7939bbd0285..378185f947331b29dcd929746ca96dfed84381cf 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -344,9 +344,13 @@ class Context: public FixedArray {
// Compute the native context by traversing the context chain.
Context* native_context();
- // Predicates for context types. IsNativeContext is defined on Object
+ // Predicates for context types. IsNativeContext is also defined on Object
// because we frequently have to know if arbitrary objects are natives
// contexts.
+ bool IsNativeContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->native_context_map();
+ }
bool IsFunctionContext() {
Map* map = this->map();
return map == map->GetHeap()->function_context_map();
« no previous file with comments | « no previous file | src/lithium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698