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

Side by Side Diff: src/contexts.cc

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: Created 4 years, 3 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
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/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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (object->IsContextExtension()) { 115 if (object->IsContextExtension()) {
116 DCHECK(IsBlockContext()); 116 DCHECK(IsBlockContext());
117 object = ContextExtension::cast(object)->scope_info(); 117 object = ContextExtension::cast(object)->scope_info();
118 } 118 }
119 return ScopeInfo::cast(object); 119 return ScopeInfo::cast(object);
120 } 120 }
121 121
122 122
123 String* Context::catch_name() { 123 String* Context::catch_name() {
124 DCHECK(IsCatchContext()); 124 DCHECK(IsCatchContext());
125 return String::cast(extension()); 125 return String::cast(ContextExtension::cast(extension())->extension());
126 } 126 }
127 127
128 128
129 JSGlobalObject* Context::global_object() { 129 JSGlobalObject* Context::global_object() {
130 return JSGlobalObject::cast(native_context()->extension()); 130 return JSGlobalObject::cast(native_context()->extension());
131 } 131 }
132 132
133 133
134 Context* Context::script_context() { 134 Context* Context::script_context() {
135 Context* current = this; 135 Context* current = this;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 int previous_value = errors_thrown()->value(); 556 int previous_value = errors_thrown()->value();
557 set_errors_thrown(Smi::FromInt(previous_value + 1)); 557 set_errors_thrown(Smi::FromInt(previous_value + 1));
558 } 558 }
559 559
560 560
561 int Context::GetErrorsThrown() { return errors_thrown()->value(); } 561 int Context::GetErrorsThrown() { return errors_thrown()->value(); }
562 562
563 } // namespace internal 563 } // namespace internal
564 } // namespace v8 564 } // namespace v8
OLDNEW
« src/compiler/js-operator.h ('K') | « src/compiler/js-operator.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698