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

Side by Side Diff: src/contexts.cc

Issue 2861017: [Isolates] Make statics from BootstrapperActive to be instance members (Closed)
Patch Set: Created 10 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
« no previous file with comments | « src/compiler.cc ('k') | src/execution.cc » ('j') | no next file with comments »
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Context* Context::global_context() { 48 Context* Context::global_context() {
49 // Fast case: the global object for this context has been set. In 49 // Fast case: the global object for this context has been set. In
50 // that case, the global object has a direct pointer to the global 50 // that case, the global object has a direct pointer to the global
51 // context. 51 // context.
52 if (global()->IsGlobalObject()) { 52 if (global()->IsGlobalObject()) {
53 return global()->global_context(); 53 return global()->global_context();
54 } 54 }
55 55
56 // During bootstrapping, the global object might not be set and we 56 // During bootstrapping, the global object might not be set and we
57 // have to search the context chain to find the global context. 57 // have to search the context chain to find the global context.
58 ASSERT(Bootstrapper::IsActive()); 58 ASSERT(Isolate::Current()->bootstrapper()->IsActive());
59 Context* current = this; 59 Context* current = this;
60 while (!current->IsGlobalContext()) { 60 while (!current->IsGlobalContext()) {
61 JSFunction* closure = JSFunction::cast(current->closure()); 61 JSFunction* closure = JSFunction::cast(current->closure());
62 current = Context::cast(closure->context()); 62 current = Context::cast(closure->context());
63 } 63 }
64 return current; 64 return current;
65 } 65 }
66 66
67 67
68 JSObject* Context::global_proxy() { 68 JSObject* Context::global_proxy() {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // No local or potential with statement found so the variable is 235 // No local or potential with statement found so the variable is
236 // global unless it is shadowed by an eval-introduced variable. 236 // global unless it is shadowed by an eval-introduced variable.
237 return true; 237 return true;
238 } 238 }
239 239
240 240
241 #ifdef DEBUG 241 #ifdef DEBUG
242 bool Context::IsBootstrappingOrContext(Object* object) { 242 bool Context::IsBootstrappingOrContext(Object* object) {
243 // During bootstrapping we allow all objects to pass as 243 // During bootstrapping we allow all objects to pass as
244 // contexts. This is necessary to fix circular dependencies. 244 // contexts. This is necessary to fix circular dependencies.
245 return Bootstrapper::IsActive() || object->IsContext(); 245 return Isolate::Current()->bootstrapper()->IsActive() || object->IsContext();
246 } 246 }
247 247
248 248
249 bool Context::IsBootstrappingOrGlobalObject(Object* object) { 249 bool Context::IsBootstrappingOrGlobalObject(Object* object) {
250 // During bootstrapping we allow all objects to pass as global 250 // During bootstrapping we allow all objects to pass as global
251 // objects. This is necessary to fix circular dependencies. 251 // objects. This is necessary to fix circular dependencies.
252 return Bootstrapper::IsActive() || object->IsGlobalObject(); 252 return Isolate::Current()->bootstrapper()->IsActive() ||
253 object->IsGlobalObject();
253 } 254 }
254 #endif 255 #endif
255 256
256 } } // namespace v8::internal 257 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698