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

Side by Side Diff: src/objects.h

Issue 1406113007: Merge GlobalObject with JSGlobalObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/mips64/macro-assembler-mips64.cc ('k') | src/objects.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 #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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // - JSMap 55 // - JSMap
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 // - JSGlobalObject
66 // - JSGlobalObject
67 // - JSGlobalProxy 66 // - JSGlobalProxy
68 // - JSValue 67 // - JSValue
69 // - JSDate 68 // - JSDate
70 // - JSMessageObject 69 // - JSMessageObject
71 // - JSProxy 70 // - JSProxy
72 // - JSFunctionProxy 71 // - JSFunctionProxy
73 // - FixedArrayBase 72 // - FixedArrayBase
74 // - ByteArray 73 // - ByteArray
75 // - BytecodeArray 74 // - BytecodeArray
76 // - FixedArray 75 // - FixedArray
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 841
843 class AccessorPair; 842 class AccessorPair;
844 class AllocationSite; 843 class AllocationSite;
845 class AllocationSiteCreationContext; 844 class AllocationSiteCreationContext;
846 class AllocationSiteUsageContext; 845 class AllocationSiteUsageContext;
847 class Cell; 846 class Cell;
848 class ConsString; 847 class ConsString;
849 class ElementsAccessor; 848 class ElementsAccessor;
850 class FixedArrayBase; 849 class FixedArrayBase;
851 class FunctionLiteral; 850 class FunctionLiteral;
852 class GlobalObject; 851 class JSGlobalObject;
853 class KeyAccumulator; 852 class KeyAccumulator;
854 class LayoutDescriptor; 853 class LayoutDescriptor;
855 class LiteralsArray; 854 class LiteralsArray;
856 class LookupIterator; 855 class LookupIterator;
857 class ObjectHashTable; 856 class ObjectHashTable;
858 class ObjectVisitor; 857 class ObjectVisitor;
859 class PropertyCell; 858 class PropertyCell;
860 class PropertyDescriptor; 859 class PropertyDescriptor;
861 class SafepointEntry; 860 class SafepointEntry;
862 class SharedFunctionInfo; 861 class SharedFunctionInfo;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 V(JSRegExp) \ 985 V(JSRegExp) \
987 V(HashTable) \ 986 V(HashTable) \
988 V(Dictionary) \ 987 V(Dictionary) \
989 V(StringTable) \ 988 V(StringTable) \
990 V(NormalizedMapCache) \ 989 V(NormalizedMapCache) \
991 V(CompilationCacheTable) \ 990 V(CompilationCacheTable) \
992 V(CodeCacheHashTable) \ 991 V(CodeCacheHashTable) \
993 V(PolymorphicCodeCacheHashTable) \ 992 V(PolymorphicCodeCacheHashTable) \
994 V(MapCache) \ 993 V(MapCache) \
995 V(Primitive) \ 994 V(Primitive) \
996 V(GlobalObject) \
997 V(JSGlobalObject) \ 995 V(JSGlobalObject) \
998 V(JSGlobalProxy) \ 996 V(JSGlobalProxy) \
999 V(UndetectableObject) \ 997 V(UndetectableObject) \
1000 V(AccessCheckNeeded) \ 998 V(AccessCheckNeeded) \
1001 V(Cell) \ 999 V(Cell) \
1002 V(PropertyCell) \ 1000 V(PropertyCell) \
1003 V(WeakCell) \ 1001 V(WeakCell) \
1004 V(ObjectHashTable) \ 1002 V(ObjectHashTable) \
1005 V(WeakHashTable) \ 1003 V(WeakHashTable) \
1006 V(OrderedHashTable) 1004 V(OrderedHashTable)
(...skipping 4921 matching lines...) Expand 10 before | Expand all | Expand 10 after
5928 5926
5929 inline bool IsPrimitiveMap(); 5927 inline bool IsPrimitiveMap();
5930 inline bool IsJSObjectMap(); 5928 inline bool IsJSObjectMap();
5931 inline bool IsJSArrayMap(); 5929 inline bool IsJSArrayMap();
5932 inline bool IsJSFunctionMap(); 5930 inline bool IsJSFunctionMap();
5933 inline bool IsStringMap(); 5931 inline bool IsStringMap();
5934 inline bool IsJSProxyMap(); 5932 inline bool IsJSProxyMap();
5935 inline bool IsJSGlobalProxyMap(); 5933 inline bool IsJSGlobalProxyMap();
5936 inline bool IsJSGlobalObjectMap(); 5934 inline bool IsJSGlobalObjectMap();
5937 inline bool IsJSTypedArrayMap(); 5935 inline bool IsJSTypedArrayMap();
5938 inline bool IsGlobalObjectMap();
5939 5936
5940 inline bool CanOmitMapChecks(); 5937 inline bool CanOmitMapChecks();
5941 5938
5942 static void AddDependentCode(Handle<Map> map, 5939 static void AddDependentCode(Handle<Map> map,
5943 DependentCode::DependencyGroup group, 5940 DependentCode::DependencyGroup group,
5944 Handle<Code> code); 5941 Handle<Code> code);
5945 5942
5946 bool IsMapInArrayPrototypeChain(); 5943 bool IsMapInArrayPrototypeChain();
5947 5944
5948 static Handle<WeakCell> WeakCellForMap(Handle<Map> map); 5945 static Handle<WeakCell> WeakCellForMap(Handle<Map> map);
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
7434 public: 7431 public:
7435 // [native_context]: the owner native context of this global proxy object. 7432 // [native_context]: the owner native context of this global proxy object.
7436 // It is null value if this object is not used by any context. 7433 // It is null value if this object is not used by any context.
7437 DECL_ACCESSORS(native_context, Object) 7434 DECL_ACCESSORS(native_context, Object)
7438 7435
7439 // [hash]: The hash code property (undefined if not initialized yet). 7436 // [hash]: The hash code property (undefined if not initialized yet).
7440 DECL_ACCESSORS(hash, Object) 7437 DECL_ACCESSORS(hash, Object)
7441 7438
7442 DECLARE_CAST(JSGlobalProxy) 7439 DECLARE_CAST(JSGlobalProxy)
7443 7440
7444 inline bool IsDetachedFrom(GlobalObject* global) const; 7441 inline bool IsDetachedFrom(JSGlobalObject* global) const;
7445 7442
7446 // Dispatched behavior. 7443 // Dispatched behavior.
7447 DECLARE_PRINTER(JSGlobalProxy) 7444 DECLARE_PRINTER(JSGlobalProxy)
7448 DECLARE_VERIFIER(JSGlobalProxy) 7445 DECLARE_VERIFIER(JSGlobalProxy)
7449 7446
7450 // Layout description. 7447 // Layout description.
7451 static const int kNativeContextOffset = JSObject::kHeaderSize; 7448 static const int kNativeContextOffset = JSObject::kHeaderSize;
7452 static const int kHashOffset = kNativeContextOffset + kPointerSize; 7449 static const int kHashOffset = kNativeContextOffset + kPointerSize;
7453 static const int kSize = kHashOffset + kPointerSize; 7450 static const int kSize = kHashOffset + kPointerSize;
7454 7451
7455 private: 7452 private:
7456 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); 7453 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy);
7457 }; 7454 };
7458 7455
7459 7456
7460 // Common super class for JavaScript global objects and the special 7457 // JavaScript global object.
7461 // builtins global objects. 7458 class JSGlobalObject : public JSObject {
7462 class GlobalObject: public JSObject {
7463 public: 7459 public:
7464 // [native context]: the natives corresponding to this global object. 7460 // [native context]: the natives corresponding to this global object.
7465 DECL_ACCESSORS(native_context, Context) 7461 DECL_ACCESSORS(native_context, Context)
7466 7462
7467 // [global proxy]: the global proxy object of the context 7463 // [global proxy]: the global proxy object of the context
7468 DECL_ACCESSORS(global_proxy, JSObject) 7464 DECL_ACCESSORS(global_proxy, JSObject)
7469 7465
7470 DECLARE_CAST(GlobalObject)
7471 7466
7472 static void InvalidatePropertyCell(Handle<GlobalObject> object, 7467 static void InvalidatePropertyCell(Handle<JSGlobalObject> object,
7473 Handle<Name> name); 7468 Handle<Name> name);
7474 // 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.
7475 static Handle<PropertyCell> EnsurePropertyCell(Handle<GlobalObject> global, 7470 static Handle<PropertyCell> EnsurePropertyCell(Handle<JSGlobalObject> global,
7476 Handle<Name> name); 7471 Handle<Name> name);
7477 7472
7478 // Layout description.
7479 static const int kNativeContextOffset = JSObject::kHeaderSize;
7480 static const int kGlobalProxyOffset = kNativeContextOffset + kPointerSize;
7481 static const int kHeaderSize = kGlobalProxyOffset + kPointerSize;
7482
7483 private:
7484 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject);
7485 };
7486
7487
7488 // JavaScript global object.
7489 class JSGlobalObject: public GlobalObject {
7490 public:
7491 DECLARE_CAST(JSGlobalObject) 7473 DECLARE_CAST(JSGlobalObject)
7492 7474
7493 inline bool IsDetached(); 7475 inline bool IsDetached();
7494 7476
7495 // Dispatched behavior. 7477 // Dispatched behavior.
7496 DECLARE_PRINTER(JSGlobalObject) 7478 DECLARE_PRINTER(JSGlobalObject)
7497 DECLARE_VERIFIER(JSGlobalObject) 7479 DECLARE_VERIFIER(JSGlobalObject)
7498 7480
7499 // Layout description. 7481 // Layout description.
7500 static const int kSize = GlobalObject::kHeaderSize; 7482 static const int kNativeContextOffset = JSObject::kHeaderSize;
7483 static const int kGlobalProxyOffset = kNativeContextOffset + kPointerSize;
7484 static const int kHeaderSize = kGlobalProxyOffset + kPointerSize;
7485 static const int kSize = kHeaderSize;
7501 7486
7502 private: 7487 private:
7503 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); 7488 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject);
7504 }; 7489 };
7505 7490
7506 7491
7507 // Representation for JS Wrapper objects, String, Number, Boolean, etc. 7492 // Representation for JS Wrapper objects, String, Number, Boolean, etc.
7508 class JSValue: public JSObject { 7493 class JSValue: public JSObject {
7509 public: 7494 public:
7510 // [value]: the object being wrapped. 7495 // [value]: the object being wrapped.
(...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after
10816 // (elements + properties) in the current level. 10801 // (elements + properties) in the current level.
10817 int levelLength_ = 0; 10802 int levelLength_ = 0;
10818 10803
10819 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); 10804 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
10820 }; 10805 };
10821 10806
10822 } // NOLINT, false-positive due to second-order macros. 10807 } // NOLINT, false-positive due to second-order macros.
10823 } // NOLINT, false-positive due to second-order macros. 10808 } // NOLINT, false-positive due to second-order macros.
10824 10809
10825 #endif // V8_OBJECTS_H_ 10810 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698