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

Side by Side Diff: src/contexts.cc

Issue 715263003: Fix Context::declaration_context to account for script contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | test/cctest/test-debug.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/debug.h" 8 #include "src/debug.h"
9 #include "src/scopeinfo.h" 9 #include "src/scopeinfo.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 result->slot_index = slot_index; 48 result->slot_index = slot_index;
49 return true; 49 return true;
50 } 50 }
51 } 51 }
52 return false; 52 return false;
53 } 53 }
54 54
55 55
56 Context* Context::declaration_context() { 56 Context* Context::declaration_context() {
57 Context* current = this; 57 Context* current = this;
58 while (!current->IsFunctionContext() && !current->IsNativeContext()) { 58 while (!current->IsFunctionContext() && !current->IsNativeContext() &&
59 !current->IsScriptContext()) {
59 current = current->previous(); 60 current = current->previous();
60 DCHECK(current->closure() == closure()); 61 DCHECK(current->closure() == closure());
61 } 62 }
62 return current; 63 return current;
63 } 64 }
64 65
65 66
66 JSBuiltinsObject* Context::builtins() { 67 JSBuiltinsObject* Context::builtins() {
67 GlobalObject* object = global_object(); 68 GlobalObject* object = global_object();
68 if (object->IsJSGlobalObject()) { 69 if (object->IsJSGlobalObject()) {
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { 489 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
489 // During bootstrapping we allow all objects to pass as global 490 // During bootstrapping we allow all objects to pass as global
490 // objects. This is necessary to fix circular dependencies. 491 // objects. This is necessary to fix circular dependencies.
491 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 492 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
492 isolate->bootstrapper()->IsActive() || 493 isolate->bootstrapper()->IsActive() ||
493 object->IsGlobalObject(); 494 object->IsGlobalObject();
494 } 495 }
495 #endif 496 #endif
496 497
497 } } // namespace v8::internal 498 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698