OLD | NEW |
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/contexts.h" | 5 #include "src/contexts.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 while (!current->is_declaration_context()) { | 75 while (!current->is_declaration_context()) { |
76 current = current->previous(); | 76 current = current->previous(); |
77 DCHECK(current->closure() == closure()); | 77 DCHECK(current->closure() == closure()); |
78 } | 78 } |
79 return current; | 79 return current; |
80 } | 80 } |
81 | 81 |
82 Context* Context::closure_context() { | 82 Context* Context::closure_context() { |
83 Context* current = this; | 83 Context* current = this; |
84 while (!current->IsFunctionContext() && !current->IsScriptContext() && | 84 while (!current->IsFunctionContext() && !current->IsScriptContext() && |
85 !current->IsModuleContext() && !current->IsNativeContext()) { | 85 !current->IsNativeContext()) { |
86 current = current->previous(); | 86 current = current->previous(); |
87 DCHECK(current->closure() == closure()); | 87 DCHECK(current->closure() == closure()); |
88 } | 88 } |
89 return current; | 89 return current; |
90 } | 90 } |
91 | 91 |
92 JSObject* Context::extension_object() { | 92 JSObject* Context::extension_object() { |
93 DCHECK(IsNativeContext() || IsFunctionContext() || IsBlockContext()); | 93 DCHECK(IsNativeContext() || IsFunctionContext() || IsBlockContext()); |
94 HeapObject* object = extension(); | 94 HeapObject* object = extension(); |
95 if (object->IsTheHole(GetIsolate())) return nullptr; | 95 if (object->IsTheHole(GetIsolate())) return nullptr; |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 int previous_value = errors_thrown()->value(); | 589 int previous_value = errors_thrown()->value(); |
590 set_errors_thrown(Smi::FromInt(previous_value + 1)); | 590 set_errors_thrown(Smi::FromInt(previous_value + 1)); |
591 } | 591 } |
592 | 592 |
593 | 593 |
594 int Context::GetErrorsThrown() { return errors_thrown()->value(); } | 594 int Context::GetErrorsThrown() { return errors_thrown()->value(); } |
595 | 595 |
596 } // namespace internal | 596 } // namespace internal |
597 } // namespace v8 | 597 } // namespace v8 |
OLD | NEW |