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

Side by Side Diff: src/contexts.cc

Issue 2108193003: [modules] AST and parser rework. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@anonymous-declarations
Patch Set: . Created 4 years, 5 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/ast/scopeinfo.h" 7 #include "src/ast/scopeinfo.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 DCHECK_EQ(kCreatedInitialized, init_flag); 196 DCHECK_EQ(kCreatedInitialized, init_flag);
197 *attributes = READ_ONLY; 197 *attributes = READ_ONLY;
198 *binding_flags = BINDING_IS_INITIALIZED; 198 *binding_flags = BINDING_IS_INITIALIZED;
199 break; 199 break;
200 case CONST: 200 case CONST:
201 *attributes = READ_ONLY; 201 *attributes = READ_ONLY;
202 *binding_flags = (init_flag == kNeedsInitialization) 202 *binding_flags = (init_flag == kNeedsInitialization)
203 ? BINDING_CHECK_INITIALIZED 203 ? BINDING_CHECK_INITIALIZED
204 : BINDING_IS_INITIALIZED; 204 : BINDING_IS_INITIALIZED;
205 break; 205 break;
206 case IMPORT:
207 *attributes = READ_ONLY;
208 *binding_flags = BINDING_IS_INITIALIZED;
adamk 2016/07/13 18:38:21 Shouldn't this be checking the init_flag? like the
neis 2016/07/14 10:28:23 Need to think about this.
neis 2016/07/15 08:46:32 For now, I'm adding IMPORT to the UNREACHABLE case
209 break;
206 case DYNAMIC: 210 case DYNAMIC:
207 case DYNAMIC_GLOBAL: 211 case DYNAMIC_GLOBAL:
208 case DYNAMIC_LOCAL: 212 case DYNAMIC_LOCAL:
209 case TEMPORARY: 213 case TEMPORARY:
210 // Note: Fixed context slots are statically allocated by the compiler. 214 // Note: Fixed context slots are statically allocated by the compiler.
211 // Statically allocated variables always have a statically known mode, 215 // Statically allocated variables always have a statically known mode,
212 // which is the mode with which they were declared when added to the 216 // which is the mode with which they were declared when added to the
213 // scope. Thus, the DYNAMIC mode (which corresponds to dynamically 217 // scope. Thus, the DYNAMIC mode (which corresponds to dynamically
214 // declared variables that were introduced through declaration nodes) 218 // declared variables that were introduced through declaration nodes)
215 // must not appear here. 219 // must not appear here.
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 613
610 int previous_value = errors_thrown()->value(); 614 int previous_value = errors_thrown()->value();
611 set_errors_thrown(Smi::FromInt(previous_value + 1)); 615 set_errors_thrown(Smi::FromInt(previous_value + 1));
612 } 616 }
613 617
614 618
615 int Context::GetErrorsThrown() { return errors_thrown()->value(); } 619 int Context::GetErrorsThrown() { return errors_thrown()->value(); }
616 620
617 } // namespace internal 621 } // namespace internal
618 } // namespace v8 622 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698