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

Unified Diff: src/contexts.cc

Issue 7003058: A collection of context-related refactoring changes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 months 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
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index f6031f1d058cc5c135b6d077b45162d37bab3ef0..c9c944c925c2250fa45599b19813936955573320 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -96,7 +96,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
PrintF("\n");
}
- // check extension/with object
+ // Check extension/with/global object.
if (context->has_extension()) {
Handle<JSObject> extension = Handle<JSObject>(context->extension(),
isolate);
@@ -119,7 +119,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
}
}
- if (context->is_function_context()) {
Kevin Millikin (Chromium) 2011/06/08 16:35:52 Global contexts used to satisfy this predicate, bu
Mads Ager (chromium) 2011/06/09 07:31:00 Could you add a comment to that effect before the
+ if (context->IsFunctionContext()) {
// we have context-local slots
// check non-parameter locals in context
@@ -189,9 +189,8 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
// proceed with enclosing context
if (context->IsGlobalContext()) {
follow_context_chain = false;
- } else if (context->is_function_context()) {
Kevin Millikin (Chromium) 2011/06/08 16:35:52 Global contexts couldn't reach this site.
- context = Handle<Context>(Context::cast(context->closure()->context()),
- isolate);
+ } else if (context->IsFunctionContext()) {
+ context = Handle<Context>(context->closure()->context(), isolate);
} else {
context = Handle<Context>(context->previous(), isolate);
}
@@ -212,11 +211,12 @@ bool Context::GlobalIfNotShadowedByEval(Handle<String> name) {
// before the global context and check that there are no context
// extension objects (conservative check for with statements).
while (!context->IsGlobalContext()) {
- // Check if the context is a potentially a with context.
+ // Check if the context is a catch or with context, or has called
+ // non-strict eval.
if (context->has_extension()) return false;
// Not a with context so it must be a function context.
- ASSERT(context->is_function_context());
Kevin Millikin (Chromium) 2011/06/08 16:35:52 Global contexts couldn't reach this site.
+ ASSERT(context->IsFunctionContext());
// Check non-parameter locals.
Handle<SerializedScopeInfo> scope_info(

Powered by Google App Engine
This is Rietveld 408576698