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

Side by Side Diff: src/objects.h

Issue 254433002: Store JSGlobalProxy's identity hash directly on the proxy itself (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged to trunk, removed Object.observe workaround Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/factory.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 "allocation.h" 8 #include "allocation.h"
9 #include "assert-scope.h" 9 #include "assert-scope.h"
10 #include "builtins.h" 10 #include "builtins.h"
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 1981
1982 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; 1982 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS };
1983 1983
1984 // Computes the enumerable keys for a JSObject. Used for implementing 1984 // Computes the enumerable keys for a JSObject. Used for implementing
1985 // "for (n in object) { }". 1985 // "for (n in object) { }".
1986 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( 1986 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys(
1987 Handle<JSReceiver> object, 1987 Handle<JSReceiver> object,
1988 KeyCollectionType type); 1988 KeyCollectionType type);
1989 1989
1990 protected: 1990 protected:
1991 Smi* GenerateIdentityHash();
1992
1993 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithDefinedSetter( 1991 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithDefinedSetter(
1994 Handle<JSReceiver> object, 1992 Handle<JSReceiver> object,
1995 Handle<JSReceiver> setter, 1993 Handle<JSReceiver> setter,
1996 Handle<Object> value); 1994 Handle<Object> value);
1997 1995
1998 private: 1996 private:
1999 static PropertyAttributes GetPropertyAttributeForResult( 1997 static PropertyAttributes GetPropertyAttributeForResult(
2000 Handle<JSReceiver> object, 1998 Handle<JSReceiver> object,
2001 Handle<JSReceiver> receiver, 1999 Handle<JSReceiver> receiver,
2002 LookupResult* result, 2000 LookupResult* result,
(...skipping 5699 matching lines...) Expand 10 before | Expand all | Expand 10 after
7702 // A JSGlobalProxy can be reinitialized which will preserve its identity. 7700 // A JSGlobalProxy can be reinitialized which will preserve its identity.
7703 // 7701 //
7704 // Accessing a JSGlobalProxy requires security check. 7702 // Accessing a JSGlobalProxy requires security check.
7705 7703
7706 class JSGlobalProxy : public JSObject { 7704 class JSGlobalProxy : public JSObject {
7707 public: 7705 public:
7708 // [native_context]: the owner native context of this global proxy object. 7706 // [native_context]: the owner native context of this global proxy object.
7709 // It is null value if this object is not used by any context. 7707 // It is null value if this object is not used by any context.
7710 DECL_ACCESSORS(native_context, Object) 7708 DECL_ACCESSORS(native_context, Object)
7711 7709
7710 // [hash]: The hash code property (undefined if not initialized yet).
7711 DECL_ACCESSORS(hash, Object)
7712
7712 // Casting. 7713 // Casting.
7713 static inline JSGlobalProxy* cast(Object* obj); 7714 static inline JSGlobalProxy* cast(Object* obj);
7714 7715
7715 inline bool IsDetachedFrom(GlobalObject* global); 7716 inline bool IsDetachedFrom(GlobalObject* global);
7716 7717
7717 // Dispatched behavior. 7718 // Dispatched behavior.
7718 DECLARE_PRINTER(JSGlobalProxy) 7719 DECLARE_PRINTER(JSGlobalProxy)
7719 DECLARE_VERIFIER(JSGlobalProxy) 7720 DECLARE_VERIFIER(JSGlobalProxy)
7720 7721
7721 // Layout description. 7722 // Layout description.
7722 static const int kNativeContextOffset = JSObject::kHeaderSize; 7723 static const int kNativeContextOffset = JSObject::kHeaderSize;
7723 static const int kSize = kNativeContextOffset + kPointerSize; 7724 static const int kHashOffset = kNativeContextOffset + kPointerSize;
7725 static const int kSize = kHashOffset + kPointerSize;
7724 7726
7725 private: 7727 private:
7726 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); 7728 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy);
7727 }; 7729 };
7728 7730
7729 7731
7730 // Forward declaration. 7732 // Forward declaration.
7731 class JSBuiltinsObject; 7733 class JSBuiltinsObject;
7732 7734
7733 // Common super class for JavaScript global objects and the special 7735 // Common super class for JavaScript global objects and the special
(...skipping 3375 matching lines...) Expand 10 before | Expand all | Expand 10 after
11109 } else { 11111 } else {
11110 value &= ~(1 << bit_position); 11112 value &= ~(1 << bit_position);
11111 } 11113 }
11112 return value; 11114 return value;
11113 } 11115 }
11114 }; 11116 };
11115 11117
11116 } } // namespace v8::internal 11118 } } // namespace v8::internal
11117 11119
11118 #endif // V8_OBJECTS_H_ 11120 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698