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

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

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