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

Side by Side Diff: src/objects-inl.h

Issue 2277253003: [modules] Partial scope info support of modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@modules-refactor
Patch Set: This is so much fun. 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/objects.h ('k') | src/parsing/parser.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 } 785 }
786 786
787 bool HeapObject::IsScriptContextTable() const { 787 bool HeapObject::IsScriptContextTable() const {
788 return map() == GetHeap()->script_context_table_map(); 788 return map() == GetHeap()->script_context_table_map();
789 } 789 }
790 790
791 bool HeapObject::IsScopeInfo() const { 791 bool HeapObject::IsScopeInfo() const {
792 return map() == GetHeap()->scope_info_map(); 792 return map() == GetHeap()->scope_info_map();
793 } 793 }
794 794
795 bool HeapObject::IsModuleInfo() const {
796 return map() == GetHeap()->module_info_map();
797 }
795 798
796 TYPE_CHECKER(JSBoundFunction, JS_BOUND_FUNCTION_TYPE) 799 TYPE_CHECKER(JSBoundFunction, JS_BOUND_FUNCTION_TYPE)
797 TYPE_CHECKER(JSFunction, JS_FUNCTION_TYPE) 800 TYPE_CHECKER(JSFunction, JS_FUNCTION_TYPE)
798 801
799 802
800 template <> inline bool Is<JSFunction>(Object* obj) { 803 template <> inline bool Is<JSFunction>(Object* obj) {
801 return obj->IsJSFunction(); 804 return obj->IsJSFunction();
802 } 805 }
803 806
804 807
(...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after
3274 CAST_ACCESSOR(JSRegExp) 3277 CAST_ACCESSOR(JSRegExp)
3275 CAST_ACCESSOR(JSSet) 3278 CAST_ACCESSOR(JSSet)
3276 CAST_ACCESSOR(JSSetIterator) 3279 CAST_ACCESSOR(JSSetIterator)
3277 CAST_ACCESSOR(JSTypedArray) 3280 CAST_ACCESSOR(JSTypedArray)
3278 CAST_ACCESSOR(JSValue) 3281 CAST_ACCESSOR(JSValue)
3279 CAST_ACCESSOR(JSWeakCollection) 3282 CAST_ACCESSOR(JSWeakCollection)
3280 CAST_ACCESSOR(JSWeakMap) 3283 CAST_ACCESSOR(JSWeakMap)
3281 CAST_ACCESSOR(JSWeakSet) 3284 CAST_ACCESSOR(JSWeakSet)
3282 CAST_ACCESSOR(LayoutDescriptor) 3285 CAST_ACCESSOR(LayoutDescriptor)
3283 CAST_ACCESSOR(Map) 3286 CAST_ACCESSOR(Map)
3287 CAST_ACCESSOR(ModuleInfo)
3284 CAST_ACCESSOR(Name) 3288 CAST_ACCESSOR(Name)
3285 CAST_ACCESSOR(NameDictionary) 3289 CAST_ACCESSOR(NameDictionary)
3286 CAST_ACCESSOR(NormalizedMapCache) 3290 CAST_ACCESSOR(NormalizedMapCache)
3287 CAST_ACCESSOR(Object) 3291 CAST_ACCESSOR(Object)
3288 CAST_ACCESSOR(ObjectHashTable) 3292 CAST_ACCESSOR(ObjectHashTable)
3289 CAST_ACCESSOR(ObjectHashSet) 3293 CAST_ACCESSOR(ObjectHashSet)
3290 CAST_ACCESSOR(Oddball) 3294 CAST_ACCESSOR(Oddball)
3291 CAST_ACCESSOR(OrderedHashMap) 3295 CAST_ACCESSOR(OrderedHashMap)
3292 CAST_ACCESSOR(OrderedHashSet) 3296 CAST_ACCESSOR(OrderedHashSet)
3293 CAST_ACCESSOR(PropertyCell) 3297 CAST_ACCESSOR(PropertyCell)
(...skipping 4615 matching lines...) Expand 10 before | Expand all | Expand 10 after
7909 int ScopeInfo::name() { \ 7913 int ScopeInfo::name() { \
7910 if (length() > 0) { \ 7914 if (length() > 0) { \
7911 return Smi::cast(get(k##name))->value(); \ 7915 return Smi::cast(get(k##name))->value(); \
7912 } else { \ 7916 } else { \
7913 return 0; \ 7917 return 0; \
7914 } \ 7918 } \
7915 } 7919 }
7916 FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(SCOPE_INFO_FIELD_ACCESSORS) 7920 FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(SCOPE_INFO_FIELD_ACCESSORS)
7917 #undef SCOPE_INFO_FIELD_ACCESSORS 7921 #undef SCOPE_INFO_FIELD_ACCESSORS
7918 7922
7923 FixedArray* ModuleInfo::special_exports() const {
7924 return FixedArray::cast(get(kSpecialExportsIndex));
7925 }
7926
7927 FixedArray* ModuleInfo::regular_exports() const {
7928 return FixedArray::cast(get(kRegularExportsIndex));
7929 }
7919 7930
7920 void Map::ClearCodeCache(Heap* heap) { 7931 void Map::ClearCodeCache(Heap* heap) {
7921 // No write barrier is needed since empty_fixed_array is not in new space. 7932 // No write barrier is needed since empty_fixed_array is not in new space.
7922 // Please note this function is used during marking: 7933 // Please note this function is used during marking:
7923 // - MarkCompactCollector::MarkUnmarkedObject 7934 // - MarkCompactCollector::MarkUnmarkedObject
7924 // - IncrementalMarking::Step 7935 // - IncrementalMarking::Step
7925 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array()); 7936 WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array());
7926 } 7937 }
7927 7938
7928 7939
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
8245 #undef WRITE_INT64_FIELD 8256 #undef WRITE_INT64_FIELD
8246 #undef READ_BYTE_FIELD 8257 #undef READ_BYTE_FIELD
8247 #undef WRITE_BYTE_FIELD 8258 #undef WRITE_BYTE_FIELD
8248 #undef NOBARRIER_READ_BYTE_FIELD 8259 #undef NOBARRIER_READ_BYTE_FIELD
8249 #undef NOBARRIER_WRITE_BYTE_FIELD 8260 #undef NOBARRIER_WRITE_BYTE_FIELD
8250 8261
8251 } // namespace internal 8262 } // namespace internal
8252 } // namespace v8 8263 } // namespace v8
8253 8264
8254 #endif // V8_OBJECTS_INL_H_ 8265 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698