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

Unified Diff: src/contexts.h

Issue 11438042: Allow lazy compilation (and thus optimisation) of functions inside eval. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 592b548cb6d226ed02cba48d2b325e30ef249286..745ba65347e4303ce15e96eacf1feda004c2d169 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -351,9 +351,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