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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/debug.h" | 8 #include "src/debug.h" |
9 #include "src/scopeinfo.h" | 9 #include "src/scopeinfo.h" |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 *binding_flags = (init_flag == kNeedsInitialization) | 166 *binding_flags = (init_flag == kNeedsInitialization) |
167 ? IMMUTABLE_CHECK_INITIALIZED | 167 ? IMMUTABLE_CHECK_INITIALIZED |
168 : IMMUTABLE_IS_INITIALIZED; | 168 : IMMUTABLE_IS_INITIALIZED; |
169 break; | 169 break; |
170 case CONST: | 170 case CONST: |
171 *attributes = READ_ONLY; | 171 *attributes = READ_ONLY; |
172 *binding_flags = (init_flag == kNeedsInitialization) | 172 *binding_flags = (init_flag == kNeedsInitialization) |
173 ? IMMUTABLE_CHECK_INITIALIZED_HARMONY | 173 ? IMMUTABLE_CHECK_INITIALIZED_HARMONY |
174 : IMMUTABLE_IS_INITIALIZED_HARMONY; | 174 : IMMUTABLE_IS_INITIALIZED_HARMONY; |
175 break; | 175 break; |
176 case MODULE: | |
177 *attributes = READ_ONLY; | |
178 *binding_flags = IMMUTABLE_IS_INITIALIZED_HARMONY; | |
179 break; | |
180 case DYNAMIC: | 176 case DYNAMIC: |
181 case DYNAMIC_GLOBAL: | 177 case DYNAMIC_GLOBAL: |
182 case DYNAMIC_LOCAL: | 178 case DYNAMIC_LOCAL: |
183 case TEMPORARY: | 179 case TEMPORARY: |
184 // Note: Fixed context slots are statically allocated by the compiler. | 180 // Note: Fixed context slots are statically allocated by the compiler. |
185 // Statically allocated variables always have a statically known mode, | 181 // Statically allocated variables always have a statically known mode, |
186 // which is the mode with which they were declared when added to the | 182 // which is the mode with which they were declared when added to the |
187 // scope. Thus, the DYNAMIC mode (which corresponds to dynamically | 183 // scope. Thus, the DYNAMIC mode (which corresponds to dynamically |
188 // declared variables that were introduced through declaration nodes) | 184 // declared variables that were introduced through declaration nodes) |
189 // must not appear here. | 185 // must not appear here. |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { | 485 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { |
490 // During bootstrapping we allow all objects to pass as global | 486 // During bootstrapping we allow all objects to pass as global |
491 // objects. This is necessary to fix circular dependencies. | 487 // objects. This is necessary to fix circular dependencies. |
492 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 488 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
493 isolate->bootstrapper()->IsActive() || | 489 isolate->bootstrapper()->IsActive() || |
494 object->IsGlobalObject(); | 490 object->IsGlobalObject(); |
495 } | 491 } |
496 #endif | 492 #endif |
497 | 493 |
498 } } // namespace v8::internal | 494 } } // namespace v8::internal |
OLD | NEW |