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

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

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: Disable module tests for deopt fuzzer. 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-debug.cc ('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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 786 }
787 787
788 bool HeapObject::IsScriptContextTable() const { 788 bool HeapObject::IsScriptContextTable() const {
789 return map() == GetHeap()->script_context_table_map(); 789 return map() == GetHeap()->script_context_table_map();
790 } 790 }
791 791
792 bool HeapObject::IsScopeInfo() const { 792 bool HeapObject::IsScopeInfo() const {
793 return map() == GetHeap()->scope_info_map(); 793 return map() == GetHeap()->scope_info_map();
794 } 794 }
795 795
796 bool HeapObject::IsModuleInfoEntry() const {
797 return map() == GetHeap()->module_info_entry_map();
798 }
799
796 bool HeapObject::IsModuleInfo() const { 800 bool HeapObject::IsModuleInfo() const {
797 return map() == GetHeap()->module_info_map(); 801 return map() == GetHeap()->module_info_map();
798 } 802 }
799 803
800 TYPE_CHECKER(JSBoundFunction, JS_BOUND_FUNCTION_TYPE) 804 TYPE_CHECKER(JSBoundFunction, JS_BOUND_FUNCTION_TYPE)
801 TYPE_CHECKER(JSFunction, JS_FUNCTION_TYPE) 805 TYPE_CHECKER(JSFunction, JS_FUNCTION_TYPE)
802 806
803 807
804 template <> inline bool Is<JSFunction>(Object* obj) { 808 template <> inline bool Is<JSFunction>(Object* obj) {
805 return obj->IsJSFunction(); 809 return obj->IsJSFunction();
(...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after
3265 CAST_ACCESSOR(JSBoundFunction) 3269 CAST_ACCESSOR(JSBoundFunction)
3266 CAST_ACCESSOR(JSDataView) 3270 CAST_ACCESSOR(JSDataView)
3267 CAST_ACCESSOR(JSDate) 3271 CAST_ACCESSOR(JSDate)
3268 CAST_ACCESSOR(JSFunction) 3272 CAST_ACCESSOR(JSFunction)
3269 CAST_ACCESSOR(JSGeneratorObject) 3273 CAST_ACCESSOR(JSGeneratorObject)
3270 CAST_ACCESSOR(JSGlobalObject) 3274 CAST_ACCESSOR(JSGlobalObject)
3271 CAST_ACCESSOR(JSGlobalProxy) 3275 CAST_ACCESSOR(JSGlobalProxy)
3272 CAST_ACCESSOR(JSMap) 3276 CAST_ACCESSOR(JSMap)
3273 CAST_ACCESSOR(JSMapIterator) 3277 CAST_ACCESSOR(JSMapIterator)
3274 CAST_ACCESSOR(JSMessageObject) 3278 CAST_ACCESSOR(JSMessageObject)
3279 CAST_ACCESSOR(JSModule)
3275 CAST_ACCESSOR(JSObject) 3280 CAST_ACCESSOR(JSObject)
3276 CAST_ACCESSOR(JSProxy) 3281 CAST_ACCESSOR(JSProxy)
3277 CAST_ACCESSOR(JSReceiver) 3282 CAST_ACCESSOR(JSReceiver)
3278 CAST_ACCESSOR(JSRegExp) 3283 CAST_ACCESSOR(JSRegExp)
3279 CAST_ACCESSOR(JSSet) 3284 CAST_ACCESSOR(JSSet)
3280 CAST_ACCESSOR(JSSetIterator) 3285 CAST_ACCESSOR(JSSetIterator)
3281 CAST_ACCESSOR(JSTypedArray) 3286 CAST_ACCESSOR(JSTypedArray)
3282 CAST_ACCESSOR(JSValue) 3287 CAST_ACCESSOR(JSValue)
3283 CAST_ACCESSOR(JSWeakCollection) 3288 CAST_ACCESSOR(JSWeakCollection)
3284 CAST_ACCESSOR(JSWeakMap) 3289 CAST_ACCESSOR(JSWeakMap)
3285 CAST_ACCESSOR(JSWeakSet) 3290 CAST_ACCESSOR(JSWeakSet)
3286 CAST_ACCESSOR(LayoutDescriptor) 3291 CAST_ACCESSOR(LayoutDescriptor)
3287 CAST_ACCESSOR(Map) 3292 CAST_ACCESSOR(Map)
3293 CAST_ACCESSOR(ModuleInfoEntry)
3288 CAST_ACCESSOR(ModuleInfo) 3294 CAST_ACCESSOR(ModuleInfo)
3289 CAST_ACCESSOR(Name) 3295 CAST_ACCESSOR(Name)
3290 CAST_ACCESSOR(NameDictionary) 3296 CAST_ACCESSOR(NameDictionary)
3291 CAST_ACCESSOR(NormalizedMapCache) 3297 CAST_ACCESSOR(NormalizedMapCache)
3292 CAST_ACCESSOR(Object) 3298 CAST_ACCESSOR(Object)
3293 CAST_ACCESSOR(ObjectHashTable) 3299 CAST_ACCESSOR(ObjectHashTable)
3294 CAST_ACCESSOR(ObjectHashSet) 3300 CAST_ACCESSOR(ObjectHashSet)
3295 CAST_ACCESSOR(Oddball) 3301 CAST_ACCESSOR(Oddball)
3296 CAST_ACCESSOR(OrderedHashMap) 3302 CAST_ACCESSOR(OrderedHashMap)
3297 CAST_ACCESSOR(OrderedHashSet) 3303 CAST_ACCESSOR(OrderedHashSet)
(...skipping 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after
6642 } 6648 }
6643 6649
6644 bool JSGeneratorObject::is_closed() const { 6650 bool JSGeneratorObject::is_closed() const {
6645 return continuation() == kGeneratorClosed; 6651 return continuation() == kGeneratorClosed;
6646 } 6652 }
6647 6653
6648 bool JSGeneratorObject::is_executing() const { 6654 bool JSGeneratorObject::is_executing() const {
6649 return continuation() == kGeneratorExecuting; 6655 return continuation() == kGeneratorExecuting;
6650 } 6656 }
6651 6657
6658 TYPE_CHECKER(JSModule, JS_MODULE_TYPE)
6659
6652 ACCESSORS(JSValue, value, Object, kValueOffset) 6660 ACCESSORS(JSValue, value, Object, kValueOffset)
6653 6661
6654 6662
6655 HeapNumber* HeapNumber::cast(Object* object) { 6663 HeapNumber* HeapNumber::cast(Object* object) {
6656 SLOW_DCHECK(object->IsHeapNumber() || object->IsMutableHeapNumber()); 6664 SLOW_DCHECK(object->IsHeapNumber() || object->IsMutableHeapNumber());
6657 return reinterpret_cast<HeapNumber*>(object); 6665 return reinterpret_cast<HeapNumber*>(object);
6658 } 6666 }
6659 6667
6660 6668
6661 const HeapNumber* HeapNumber::cast(const Object* object) { 6669 const HeapNumber* HeapNumber::cast(const Object* object) {
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
7914 int ScopeInfo::name() { \ 7922 int ScopeInfo::name() { \
7915 if (length() > 0) { \ 7923 if (length() > 0) { \
7916 return Smi::cast(get(k##name))->value(); \ 7924 return Smi::cast(get(k##name))->value(); \
7917 } else { \ 7925 } else { \
7918 return 0; \ 7926 return 0; \
7919 } \ 7927 } \
7920 } 7928 }
7921 FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(SCOPE_INFO_FIELD_ACCESSORS) 7929 FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(SCOPE_INFO_FIELD_ACCESSORS)
7922 #undef SCOPE_INFO_FIELD_ACCESSORS 7930 #undef SCOPE_INFO_FIELD_ACCESSORS
7923 7931
7932 Object* ModuleInfoEntry::export_name() const { return get(kExportNameIndex); }
7933
7934 Object* ModuleInfoEntry::local_name() const { return get(kLocalNameIndex); }
7935
7936 Object* ModuleInfoEntry::import_name() const { return get(kImportNameIndex); }
7937
7938 Object* ModuleInfoEntry::module_request() const {
7939 return get(kModuleRequestIndex);
7940 }
7941
7924 FixedArray* ModuleInfo::special_exports() const { 7942 FixedArray* ModuleInfo::special_exports() const {
7925 return FixedArray::cast(get(kSpecialExportsIndex)); 7943 return FixedArray::cast(get(kSpecialExportsIndex));
7926 } 7944 }
7927 7945
7928 FixedArray* ModuleInfo::regular_exports() const { 7946 FixedArray* ModuleInfo::regular_exports() const {
7929 return FixedArray::cast(get(kRegularExportsIndex)); 7947 return FixedArray::cast(get(kRegularExportsIndex));
7930 } 7948 }
7931 7949
7932 #ifdef DEBUG 7950 #ifdef DEBUG
7933 bool ModuleInfo::Equals(ModuleInfo* other) const { 7951 bool ModuleInfo::Equals(ModuleInfo* other) const {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
8264 #undef WRITE_INT64_FIELD 8282 #undef WRITE_INT64_FIELD
8265 #undef READ_BYTE_FIELD 8283 #undef READ_BYTE_FIELD
8266 #undef WRITE_BYTE_FIELD 8284 #undef WRITE_BYTE_FIELD
8267 #undef NOBARRIER_READ_BYTE_FIELD 8285 #undef NOBARRIER_READ_BYTE_FIELD
8268 #undef NOBARRIER_WRITE_BYTE_FIELD 8286 #undef NOBARRIER_WRITE_BYTE_FIELD
8269 8287
8270 } // namespace internal 8288 } // namespace internal
8271 } // namespace v8 8289 } // namespace v8
8272 8290
8273 #endif // V8_OBJECTS_INL_H_ 8291 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698