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

Side by Side Diff: src/contexts.cc

Issue 2271993002: Chain ScopeInfos together (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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
« no previous file with comments | « src/ast/scopes.cc ('k') | src/debug/debug-evaluate.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/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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 JSReceiver* Context::extension_receiver() { 104 JSReceiver* Context::extension_receiver() {
105 DCHECK(IsNativeContext() || IsWithContext() || 105 DCHECK(IsNativeContext() || IsWithContext() ||
106 IsFunctionContext() || IsBlockContext()); 106 IsFunctionContext() || IsBlockContext());
107 return IsWithContext() ? JSReceiver::cast( 107 return IsWithContext() ? JSReceiver::cast(
108 ContextExtension::cast(extension())->extension()) 108 ContextExtension::cast(extension())->extension())
109 : extension_object(); 109 : extension_object();
110 } 110 }
111 111
112 ScopeInfo* Context::scope_info() { 112 ScopeInfo* Context::scope_info() {
113 DCHECK(IsModuleContext() || IsScriptContext() || IsBlockContext() || 113 DCHECK(!IsNativeContext());
114 IsCatchContext() || IsWithContext() || IsDebugEvaluateContext()); 114 if (IsFunctionContext() || IsModuleContext()) {
115 return closure()->shared()->scope_info();
116 }
115 HeapObject* object = extension(); 117 HeapObject* object = extension();
116 if (object->IsContextExtension()) { 118 if (object->IsContextExtension()) {
117 DCHECK(IsBlockContext() || IsCatchContext() || IsWithContext() || 119 DCHECK(IsBlockContext() || IsCatchContext() || IsWithContext() ||
118 IsDebugEvaluateContext()); 120 IsDebugEvaluateContext());
119 object = ContextExtension::cast(object)->scope_info(); 121 object = ContextExtension::cast(object)->scope_info();
120 } 122 }
121 return ScopeInfo::cast(object); 123 return ScopeInfo::cast(object);
122 } 124 }
123 125
124 126
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 562
561 int previous_value = errors_thrown()->value(); 563 int previous_value = errors_thrown()->value();
562 set_errors_thrown(Smi::FromInt(previous_value + 1)); 564 set_errors_thrown(Smi::FromInt(previous_value + 1));
563 } 565 }
564 566
565 567
566 int Context::GetErrorsThrown() { return errors_thrown()->value(); } 568 int Context::GetErrorsThrown() { return errors_thrown()->value(); }
567 569
568 } // namespace internal 570 } // namespace internal
569 } // namespace v8 571 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/debug/debug-evaluate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698