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

Side by Side Diff: src/contexts.cc

Issue 141038: Implemented a ContextSlotCache for compiled code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/heap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 case Variable::DYNAMIC_GLOBAL: UNREACHABLE(); break; 142 case Variable::DYNAMIC_GLOBAL: UNREACHABLE(); break;
143 case Variable::DYNAMIC_LOCAL: UNREACHABLE(); break; 143 case Variable::DYNAMIC_LOCAL: UNREACHABLE(); break;
144 case Variable::TEMPORARY: UNREACHABLE(); break; 144 case Variable::TEMPORARY: UNREACHABLE(); break;
145 } 145 }
146 return context; 146 return context;
147 } 147 }
148 148
149 // check parameter locals in context 149 // check parameter locals in context
150 int param_index = ScopeInfo<>::ParameterIndex(*code, *name); 150 int param_index = ScopeInfo<>::ParameterIndex(*code, *name);
151 if (param_index >= 0) { 151 if (param_index >= 0) {
152 // slot found 152 // slot found.
153 int index = 153 int index =
154 ScopeInfo<>::ContextSlotIndex(*code, 154 ScopeInfo<>::ContextSlotIndex(*code,
155 Heap::arguments_shadow_symbol(), 155 Heap::arguments_shadow_symbol(),
156 NULL); 156 NULL);
157 ASSERT(index >= 0); // arguments must exist and be in the heap context 157 ASSERT(index >= 0); // arguments must exist and be in the heap context
158 Handle<JSObject> arguments(JSObject::cast(context->get(index))); 158 Handle<JSObject> arguments(JSObject::cast(context->get(index)));
159 ASSERT(arguments->HasLocalProperty(Heap::length_symbol())); 159 ASSERT(arguments->HasLocalProperty(Heap::length_symbol()));
160 if (FLAG_trace_contexts) { 160 if (FLAG_trace_contexts) {
161 PrintF("=> found parameter %d in arguments object\n", param_index); 161 PrintF("=> found parameter %d in arguments object\n", param_index);
162 } 162 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 245
246 bool Context::IsBootstrappingOrGlobalObject(Object* object) { 246 bool Context::IsBootstrappingOrGlobalObject(Object* object) {
247 // During bootstrapping we allow all objects to pass as global 247 // During bootstrapping we allow all objects to pass as global
248 // objects. This is necessary to fix circular dependencies. 248 // objects. This is necessary to fix circular dependencies.
249 return Bootstrapper::IsActive() || object->IsGlobalObject(); 249 return Bootstrapper::IsActive() || object->IsGlobalObject();
250 } 250 }
251 #endif 251 #endif
252 252
253 } } // namespace v8::internal 253 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698