Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 // - JSSetIterator | 56 // - JSSetIterator |
| 57 // - JSMapIterator | 57 // - JSMapIterator |
| 58 // - JSWeakCollection | 58 // - JSWeakCollection |
| 59 // - JSWeakMap | 59 // - JSWeakMap |
| 60 // - JSWeakSet | 60 // - JSWeakSet |
| 61 // - JSRegExp | 61 // - JSRegExp |
| 62 // - JSFunction | 62 // - JSFunction |
| 63 // - JSGeneratorObject | 63 // - JSGeneratorObject |
| 64 // - JSModule | 64 // - JSModule |
| 65 // - GlobalObject | 65 // - GlobalObject |
| 66 // - JSGlobalObject | 66 // - JSGlobalObject |
|
Toon Verwaest
2015/11/02 10:08:48
I guess we don't need the distinction between Glob
Yang
2015/11/02 10:47:38
Yup. I'd like to remove the distinction in a separ
| |
| 67 // - JSBuiltinsObject | |
| 68 // - JSGlobalProxy | 67 // - JSGlobalProxy |
| 69 // - JSValue | 68 // - JSValue |
| 70 // - JSDate | 69 // - JSDate |
| 71 // - JSMessageObject | 70 // - JSMessageObject |
| 72 // - JSProxy | 71 // - JSProxy |
| 73 // - JSFunctionProxy | 72 // - JSFunctionProxy |
| 74 // - FixedArrayBase | 73 // - FixedArrayBase |
| 75 // - ByteArray | 74 // - ByteArray |
| 76 // - BytecodeArray | 75 // - BytecodeArray |
| 77 // - FixedArray | 76 // - FixedArray |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 416 \ | 415 \ |
| 417 V(JS_MESSAGE_OBJECT_TYPE) \ | 416 V(JS_MESSAGE_OBJECT_TYPE) \ |
| 418 \ | 417 \ |
| 419 V(JS_VALUE_TYPE) \ | 418 V(JS_VALUE_TYPE) \ |
| 420 V(JS_DATE_TYPE) \ | 419 V(JS_DATE_TYPE) \ |
| 421 V(JS_OBJECT_TYPE) \ | 420 V(JS_OBJECT_TYPE) \ |
| 422 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ | 421 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ |
| 423 V(JS_GENERATOR_OBJECT_TYPE) \ | 422 V(JS_GENERATOR_OBJECT_TYPE) \ |
| 424 V(JS_MODULE_TYPE) \ | 423 V(JS_MODULE_TYPE) \ |
| 425 V(JS_GLOBAL_OBJECT_TYPE) \ | 424 V(JS_GLOBAL_OBJECT_TYPE) \ |
| 426 V(JS_BUILTINS_OBJECT_TYPE) \ | |
| 427 V(JS_GLOBAL_PROXY_TYPE) \ | 425 V(JS_GLOBAL_PROXY_TYPE) \ |
| 428 V(JS_ARRAY_TYPE) \ | 426 V(JS_ARRAY_TYPE) \ |
| 429 V(JS_ARRAY_BUFFER_TYPE) \ | 427 V(JS_ARRAY_BUFFER_TYPE) \ |
| 430 V(JS_TYPED_ARRAY_TYPE) \ | 428 V(JS_TYPED_ARRAY_TYPE) \ |
| 431 V(JS_DATA_VIEW_TYPE) \ | 429 V(JS_DATA_VIEW_TYPE) \ |
| 432 V(JS_PROXY_TYPE) \ | 430 V(JS_PROXY_TYPE) \ |
| 433 V(JS_SET_TYPE) \ | 431 V(JS_SET_TYPE) \ |
| 434 V(JS_MAP_TYPE) \ | 432 V(JS_MAP_TYPE) \ |
| 435 V(JS_SET_ITERATOR_TYPE) \ | 433 V(JS_SET_ITERATOR_TYPE) \ |
| 436 V(JS_MAP_ITERATOR_TYPE) \ | 434 V(JS_MAP_ITERATOR_TYPE) \ |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 716 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE | 714 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE |
| 717 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE | 715 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE |
| 718 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE | 716 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE |
| 719 JS_MESSAGE_OBJECT_TYPE, | 717 JS_MESSAGE_OBJECT_TYPE, |
| 720 JS_DATE_TYPE, | 718 JS_DATE_TYPE, |
| 721 JS_OBJECT_TYPE, | 719 JS_OBJECT_TYPE, |
| 722 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 720 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
| 723 JS_GENERATOR_OBJECT_TYPE, | 721 JS_GENERATOR_OBJECT_TYPE, |
| 724 JS_MODULE_TYPE, | 722 JS_MODULE_TYPE, |
| 725 JS_GLOBAL_OBJECT_TYPE, | 723 JS_GLOBAL_OBJECT_TYPE, |
| 726 JS_BUILTINS_OBJECT_TYPE, | |
| 727 JS_GLOBAL_PROXY_TYPE, | 724 JS_GLOBAL_PROXY_TYPE, |
| 728 JS_ARRAY_TYPE, | 725 JS_ARRAY_TYPE, |
| 729 JS_ARRAY_BUFFER_TYPE, | 726 JS_ARRAY_BUFFER_TYPE, |
| 730 JS_TYPED_ARRAY_TYPE, | 727 JS_TYPED_ARRAY_TYPE, |
| 731 JS_DATA_VIEW_TYPE, | 728 JS_DATA_VIEW_TYPE, |
| 732 JS_SET_TYPE, | 729 JS_SET_TYPE, |
| 733 JS_MAP_TYPE, | 730 JS_MAP_TYPE, |
| 734 JS_SET_ITERATOR_TYPE, | 731 JS_SET_ITERATOR_TYPE, |
| 735 JS_MAP_ITERATOR_TYPE, | 732 JS_MAP_ITERATOR_TYPE, |
| 736 JS_ITERATOR_RESULT_TYPE, | 733 JS_ITERATOR_RESULT_TYPE, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 class AccessorPair; | 843 class AccessorPair; |
| 847 class AllocationSite; | 844 class AllocationSite; |
| 848 class AllocationSiteCreationContext; | 845 class AllocationSiteCreationContext; |
| 849 class AllocationSiteUsageContext; | 846 class AllocationSiteUsageContext; |
| 850 class Cell; | 847 class Cell; |
| 851 class ConsString; | 848 class ConsString; |
| 852 class ElementsAccessor; | 849 class ElementsAccessor; |
| 853 class FixedArrayBase; | 850 class FixedArrayBase; |
| 854 class FunctionLiteral; | 851 class FunctionLiteral; |
| 855 class GlobalObject; | 852 class GlobalObject; |
| 856 class JSBuiltinsObject; | |
| 857 class KeyAccumulator; | 853 class KeyAccumulator; |
| 858 class LayoutDescriptor; | 854 class LayoutDescriptor; |
| 859 class LiteralsArray; | 855 class LiteralsArray; |
| 860 class LookupIterator; | 856 class LookupIterator; |
| 861 class ObjectHashTable; | 857 class ObjectHashTable; |
| 862 class ObjectVisitor; | 858 class ObjectVisitor; |
| 863 class PropertyCell; | 859 class PropertyCell; |
| 864 class PropertyDescriptor; | 860 class PropertyDescriptor; |
| 865 class SafepointEntry; | 861 class SafepointEntry; |
| 866 class SharedFunctionInfo; | 862 class SharedFunctionInfo; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 992 V(Dictionary) \ | 988 V(Dictionary) \ |
| 993 V(StringTable) \ | 989 V(StringTable) \ |
| 994 V(NormalizedMapCache) \ | 990 V(NormalizedMapCache) \ |
| 995 V(CompilationCacheTable) \ | 991 V(CompilationCacheTable) \ |
| 996 V(CodeCacheHashTable) \ | 992 V(CodeCacheHashTable) \ |
| 997 V(PolymorphicCodeCacheHashTable) \ | 993 V(PolymorphicCodeCacheHashTable) \ |
| 998 V(MapCache) \ | 994 V(MapCache) \ |
| 999 V(Primitive) \ | 995 V(Primitive) \ |
| 1000 V(GlobalObject) \ | 996 V(GlobalObject) \ |
| 1001 V(JSGlobalObject) \ | 997 V(JSGlobalObject) \ |
| 1002 V(JSBuiltinsObject) \ | |
| 1003 V(JSGlobalProxy) \ | 998 V(JSGlobalProxy) \ |
| 1004 V(UndetectableObject) \ | 999 V(UndetectableObject) \ |
| 1005 V(AccessCheckNeeded) \ | 1000 V(AccessCheckNeeded) \ |
| 1006 V(Cell) \ | 1001 V(Cell) \ |
| 1007 V(PropertyCell) \ | 1002 V(PropertyCell) \ |
| 1008 V(WeakCell) \ | 1003 V(WeakCell) \ |
| 1009 V(ObjectHashTable) \ | 1004 V(ObjectHashTable) \ |
| 1010 V(WeakHashTable) \ | 1005 V(WeakHashTable) \ |
| 1011 V(OrderedHashTable) | 1006 V(OrderedHashTable) |
| 1012 | 1007 |
| (...skipping 6441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7454 | 7449 |
| 7455 private: | 7450 private: |
| 7456 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); | 7451 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); |
| 7457 }; | 7452 }; |
| 7458 | 7453 |
| 7459 | 7454 |
| 7460 // Common super class for JavaScript global objects and the special | 7455 // Common super class for JavaScript global objects and the special |
| 7461 // builtins global objects. | 7456 // builtins global objects. |
| 7462 class GlobalObject: public JSObject { | 7457 class GlobalObject: public JSObject { |
| 7463 public: | 7458 public: |
| 7464 // [builtins]: the object holding the runtime routines written in JS. | |
| 7465 DECL_ACCESSORS(builtins, JSBuiltinsObject) | |
| 7466 | |
| 7467 // [native context]: the natives corresponding to this global object. | 7459 // [native context]: the natives corresponding to this global object. |
| 7468 DECL_ACCESSORS(native_context, Context) | 7460 DECL_ACCESSORS(native_context, Context) |
| 7469 | 7461 |
| 7470 // [global proxy]: the global proxy object of the context | 7462 // [global proxy]: the global proxy object of the context |
| 7471 DECL_ACCESSORS(global_proxy, JSObject) | 7463 DECL_ACCESSORS(global_proxy, JSObject) |
| 7472 | 7464 |
| 7473 DECLARE_CAST(GlobalObject) | 7465 DECLARE_CAST(GlobalObject) |
| 7474 | 7466 |
| 7475 static void InvalidatePropertyCell(Handle<GlobalObject> object, | 7467 static void InvalidatePropertyCell(Handle<GlobalObject> object, |
| 7476 Handle<Name> name); | 7468 Handle<Name> name); |
| 7477 // Ensure that the global object has a cell for the given property name. | 7469 // Ensure that the global object has a cell for the given property name. |
| 7478 static Handle<PropertyCell> EnsurePropertyCell(Handle<GlobalObject> global, | 7470 static Handle<PropertyCell> EnsurePropertyCell(Handle<GlobalObject> global, |
| 7479 Handle<Name> name); | 7471 Handle<Name> name); |
| 7480 | 7472 |
| 7481 // Layout description. | 7473 // Layout description. |
| 7482 static const int kBuiltinsOffset = JSObject::kHeaderSize; | 7474 static const int kNativeContextOffset = JSObject::kHeaderSize; |
| 7483 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; | |
| 7484 static const int kGlobalProxyOffset = kNativeContextOffset + kPointerSize; | 7475 static const int kGlobalProxyOffset = kNativeContextOffset + kPointerSize; |
| 7485 static const int kHeaderSize = kGlobalProxyOffset + kPointerSize; | 7476 static const int kHeaderSize = kGlobalProxyOffset + kPointerSize; |
| 7486 | 7477 |
| 7487 private: | 7478 private: |
| 7488 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); | 7479 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); |
| 7489 }; | 7480 }; |
| 7490 | 7481 |
| 7491 | 7482 |
| 7492 // JavaScript global object. | 7483 // JavaScript global object. |
| 7493 class JSGlobalObject: public GlobalObject { | 7484 class JSGlobalObject: public GlobalObject { |
| 7494 public: | 7485 public: |
| 7495 DECLARE_CAST(JSGlobalObject) | 7486 DECLARE_CAST(JSGlobalObject) |
| 7496 | 7487 |
| 7497 inline bool IsDetached(); | 7488 inline bool IsDetached(); |
| 7498 | 7489 |
| 7499 // Dispatched behavior. | 7490 // Dispatched behavior. |
| 7500 DECLARE_PRINTER(JSGlobalObject) | 7491 DECLARE_PRINTER(JSGlobalObject) |
| 7501 DECLARE_VERIFIER(JSGlobalObject) | 7492 DECLARE_VERIFIER(JSGlobalObject) |
| 7502 | 7493 |
| 7503 // Layout description. | 7494 // Layout description. |
| 7504 static const int kSize = GlobalObject::kHeaderSize; | 7495 static const int kSize = GlobalObject::kHeaderSize; |
| 7505 | 7496 |
| 7506 private: | 7497 private: |
| 7507 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); | 7498 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); |
| 7508 }; | 7499 }; |
| 7509 | 7500 |
| 7510 | 7501 |
| 7511 // Builtins global object which holds the runtime routines written in | |
| 7512 // JavaScript. | |
| 7513 class JSBuiltinsObject: public GlobalObject { | |
| 7514 public: | |
| 7515 DECLARE_CAST(JSBuiltinsObject) | |
| 7516 | |
| 7517 // Dispatched behavior. | |
| 7518 DECLARE_PRINTER(JSBuiltinsObject) | |
| 7519 DECLARE_VERIFIER(JSBuiltinsObject) | |
| 7520 | |
| 7521 // Layout description. | |
| 7522 static const int kSize = GlobalObject::kHeaderSize; | |
| 7523 | |
| 7524 private: | |
| 7525 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject); | |
| 7526 }; | |
| 7527 | |
| 7528 | |
| 7529 // Representation for JS Wrapper objects, String, Number, Boolean, etc. | 7502 // Representation for JS Wrapper objects, String, Number, Boolean, etc. |
| 7530 class JSValue: public JSObject { | 7503 class JSValue: public JSObject { |
| 7531 public: | 7504 public: |
| 7532 // [value]: the object being wrapped. | 7505 // [value]: the object being wrapped. |
| 7533 DECL_ACCESSORS(value, Object) | 7506 DECL_ACCESSORS(value, Object) |
| 7534 | 7507 |
| 7535 DECLARE_CAST(JSValue) | 7508 DECLARE_CAST(JSValue) |
| 7536 | 7509 |
| 7537 // Dispatched behavior. | 7510 // Dispatched behavior. |
| 7538 DECLARE_PRINTER(JSValue) | 7511 DECLARE_PRINTER(JSValue) |
| (...skipping 3301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10840 // (elements + properties) in the current level. | 10813 // (elements + properties) in the current level. |
| 10841 int levelLength_ = 0; | 10814 int levelLength_ = 0; |
| 10842 | 10815 |
| 10843 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10816 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
| 10844 }; | 10817 }; |
| 10845 | 10818 |
| 10846 } // NOLINT, false-positive due to second-order macros. | 10819 } // NOLINT, false-positive due to second-order macros. |
| 10847 } // NOLINT, false-positive due to second-order macros. | 10820 } // NOLINT, false-positive due to second-order macros. |
| 10848 | 10821 |
| 10849 #endif // V8_OBJECTS_H_ | 10822 #endif // V8_OBJECTS_H_ |
| OLD | NEW |