| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 HeapObject* object = extension(); | 118 HeapObject* object = extension(); |
| 119 if (object->IsContextExtension()) { | 119 if (object->IsContextExtension()) { |
| 120 DCHECK(IsBlockContext() || IsCatchContext() || IsWithContext() || | 120 DCHECK(IsBlockContext() || IsCatchContext() || IsWithContext() || |
| 121 IsDebugEvaluateContext()); | 121 IsDebugEvaluateContext()); |
| 122 object = ContextExtension::cast(object)->scope_info(); | 122 object = ContextExtension::cast(object)->scope_info(); |
| 123 } | 123 } |
| 124 return ScopeInfo::cast(object); | 124 return ScopeInfo::cast(object); |
| 125 } | 125 } |
| 126 | 126 |
| 127 JSModule* Context::module() { | 127 Module* Context::module() { |
| 128 Context* current = this; | 128 Context* current = this; |
| 129 while (!current->IsModuleContext()) { | 129 while (!current->IsModuleContext()) { |
| 130 current = current->previous(); | 130 current = current->previous(); |
| 131 } | 131 } |
| 132 return JSModule::cast(current->extension()); | 132 return Module::cast(current->extension()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 String* Context::catch_name() { | 135 String* Context::catch_name() { |
| 136 DCHECK(IsCatchContext()); | 136 DCHECK(IsCatchContext()); |
| 137 return String::cast(ContextExtension::cast(extension())->extension()); | 137 return String::cast(ContextExtension::cast(extension())->extension()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 | 140 |
| 141 JSGlobalObject* Context::global_object() { | 141 JSGlobalObject* Context::global_object() { |
| 142 return JSGlobalObject::cast(native_context()->extension()); | 142 return JSGlobalObject::cast(native_context()->extension()); |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 582 |
| 583 int previous_value = errors_thrown()->value(); | 583 int previous_value = errors_thrown()->value(); |
| 584 set_errors_thrown(Smi::FromInt(previous_value + 1)); | 584 set_errors_thrown(Smi::FromInt(previous_value + 1)); |
| 585 } | 585 } |
| 586 | 586 |
| 587 | 587 |
| 588 int Context::GetErrorsThrown() { return errors_thrown()->value(); } | 588 int Context::GetErrorsThrown() { return errors_thrown()->value(); } |
| 589 | 589 |
| 590 } // namespace internal | 590 } // namespace internal |
| 591 } // namespace v8 | 591 } // namespace v8 |
| OLD | NEW |