| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 void Context::set_global_proxy(JSObject* object) { | 68 void Context::set_global_proxy(JSObject* object) { |
| 69 global_context()->set_global_proxy_object(object); | 69 global_context()->set_global_proxy_object(object); |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, | 73 Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, |
| 74 int* index_, PropertyAttributes* attributes) { | 74 int* index_, PropertyAttributes* attributes) { |
| 75 Handle<Context> context(this); | 75 Handle<Context> context(this); |
| 76 | 76 |
| 77 // The context must be in frame slot 0 (if not debugging). | |
| 78 if (kDebug && !Debug::InDebugger()) { | |
| 79 StackFrameLocator locator; | |
| 80 ASSERT(context->fcontext() == | |
| 81 Context::cast( | |
| 82 locator.FindJavaScriptFrame(0)->context())->fcontext()); | |
| 83 } | |
| 84 | |
| 85 bool follow_context_chain = (flags & FOLLOW_CONTEXT_CHAIN) != 0; | 77 bool follow_context_chain = (flags & FOLLOW_CONTEXT_CHAIN) != 0; |
| 86 *index_ = -1; | 78 *index_ = -1; |
| 87 *attributes = ABSENT; | 79 *attributes = ABSENT; |
| 88 | 80 |
| 89 if (FLAG_trace_contexts) { | 81 if (FLAG_trace_contexts) { |
| 90 PrintF("Context::Lookup("); | 82 PrintF("Context::Lookup("); |
| 91 name->ShortPrint(); | 83 name->ShortPrint(); |
| 92 PrintF(")\n"); | 84 PrintF(")\n"); |
| 93 } | 85 } |
| 94 | 86 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 201 |
| 210 | 202 |
| 211 bool Context::IsBootstrappingOrGlobalObject(Object* object) { | 203 bool Context::IsBootstrappingOrGlobalObject(Object* object) { |
| 212 // During bootstrapping we allow all objects to pass as global | 204 // During bootstrapping we allow all objects to pass as global |
| 213 // objects. This is necessary to fix circular dependencies. | 205 // objects. This is necessary to fix circular dependencies. |
| 214 return Bootstrapper::IsActive() || object->IsGlobalObject(); | 206 return Bootstrapper::IsActive() || object->IsGlobalObject(); |
| 215 } | 207 } |
| 216 #endif | 208 #endif |
| 217 | 209 |
| 218 } } // namespace v8::internal | 210 } } // namespace v8::internal |
| OLD | NEW |