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

Unified Diff: src/contexts.cc

Issue 2918001: Move serialized scope info from Code object to SharedFunctionInfo. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « src/compiler.cc ('k') | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
===================================================================
--- src/contexts.cc (revision 5039)
+++ src/contexts.cc (working copy)
@@ -120,9 +120,9 @@
// we have context-local slots
// check non-parameter locals in context
- Handle<Code> code(context->closure()->code());
+ Handle<Object> scope_info(context->closure()->shared()->scope_info());
Variable::Mode mode;
- int index = ScopeInfo<>::ContextSlotIndex(*code, *name, &mode);
+ int index = ScopeInfo<>::ContextSlotIndex(*scope_info, *name, &mode);
ASSERT(index < 0 || index >= MIN_CONTEXT_SLOTS);
if (index >= 0) {
// slot found
@@ -150,11 +150,11 @@
}
// check parameter locals in context
- int param_index = ScopeInfo<>::ParameterIndex(*code, *name);
+ int param_index = ScopeInfo<>::ParameterIndex(*scope_info, *name);
if (param_index >= 0) {
// slot found.
int index =
- ScopeInfo<>::ContextSlotIndex(*code,
+ ScopeInfo<>::ContextSlotIndex(*scope_info,
Heap::arguments_shadow_symbol(),
NULL);
ASSERT(index >= 0); // arguments must exist and be in the heap context
@@ -170,7 +170,7 @@
// check intermediate context (holding only the function name variable)
if (follow_context_chain) {
- int index = ScopeInfo<>::FunctionContextSlotIndex(*code, *name);
+ int index = ScopeInfo<>::FunctionContextSlotIndex(*scope_info, *name);
if (index >= 0) {
// slot found
if (FLAG_trace_contexts) {
@@ -216,18 +216,18 @@
ASSERT(context->is_function_context());
// Check non-parameter locals.
- Handle<Code> code(context->closure()->code());
+ Handle<Object> scope_info(context->closure()->shared()->scope_info());
Variable::Mode mode;
- int index = ScopeInfo<>::ContextSlotIndex(*code, *name, &mode);
+ int index = ScopeInfo<>::ContextSlotIndex(*scope_info, *name, &mode);
ASSERT(index < 0 || index >= MIN_CONTEXT_SLOTS);
if (index >= 0) return false;
// Check parameter locals.
- int param_index = ScopeInfo<>::ParameterIndex(*code, *name);
+ int param_index = ScopeInfo<>::ParameterIndex(*scope_info, *name);
if (param_index >= 0) return false;
// Check context only holding the function name variable.
- index = ScopeInfo<>::FunctionContextSlotIndex(*code, *name);
+ index = ScopeInfo<>::FunctionContextSlotIndex(*scope_info, *name);
if (index >= 0) return false;
context = Context::cast(context->closure()->context());
}
« no previous file with comments | « src/compiler.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698