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 7625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7636 // [native context]: the natives corresponding to this global object. | 7636 // [native context]: the natives corresponding to this global object. |
7637 DECL_ACCESSORS(native_context, Context) | 7637 DECL_ACCESSORS(native_context, Context) |
7638 | 7638 |
7639 // [global proxy]: the global proxy object of the context | 7639 // [global proxy]: the global proxy object of the context |
7640 DECL_ACCESSORS(global_proxy, JSObject) | 7640 DECL_ACCESSORS(global_proxy, JSObject) |
7641 | 7641 |
7642 DECLARE_CAST(GlobalObject) | 7642 DECLARE_CAST(GlobalObject) |
7643 | 7643 |
7644 static void InvalidatePropertyCell(Handle<GlobalObject> object, | 7644 static void InvalidatePropertyCell(Handle<GlobalObject> object, |
7645 Handle<Name> name); | 7645 Handle<Name> name); |
| 7646 // Ensure that the global object has a cell for the given property name. |
| 7647 static Handle<PropertyCell> EnsurePropertyCell(Handle<GlobalObject> global, |
| 7648 Handle<Name> name); |
7646 | 7649 |
7647 // Layout description. | 7650 // Layout description. |
7648 static const int kBuiltinsOffset = JSObject::kHeaderSize; | 7651 static const int kBuiltinsOffset = JSObject::kHeaderSize; |
7649 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; | 7652 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; |
7650 static const int kGlobalProxyOffset = kNativeContextOffset + kPointerSize; | 7653 static const int kGlobalProxyOffset = kNativeContextOffset + kPointerSize; |
7651 static const int kHeaderSize = kGlobalProxyOffset + kPointerSize; | 7654 static const int kHeaderSize = kGlobalProxyOffset + kPointerSize; |
7652 | 7655 |
7653 private: | 7656 private: |
7654 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); | 7657 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); |
7655 }; | 7658 }; |
7656 | 7659 |
7657 | 7660 |
7658 // JavaScript global object. | 7661 // JavaScript global object. |
7659 class JSGlobalObject: public GlobalObject { | 7662 class JSGlobalObject: public GlobalObject { |
7660 public: | 7663 public: |
7661 DECLARE_CAST(JSGlobalObject) | 7664 DECLARE_CAST(JSGlobalObject) |
7662 | 7665 |
7663 // Ensure that the global object has a cell for the given property name. | |
7664 static Handle<PropertyCell> EnsurePropertyCell(Handle<JSGlobalObject> global, | |
7665 Handle<Name> name); | |
7666 | |
7667 inline bool IsDetached(); | 7666 inline bool IsDetached(); |
7668 | 7667 |
7669 // Dispatched behavior. | 7668 // Dispatched behavior. |
7670 DECLARE_PRINTER(JSGlobalObject) | 7669 DECLARE_PRINTER(JSGlobalObject) |
7671 DECLARE_VERIFIER(JSGlobalObject) | 7670 DECLARE_VERIFIER(JSGlobalObject) |
7672 | 7671 |
7673 // Layout description. | 7672 // Layout description. |
7674 static const int kSize = GlobalObject::kHeaderSize; | 7673 static const int kSize = GlobalObject::kHeaderSize; |
7675 | 7674 |
7676 private: | 7675 private: |
(...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10965 } else { | 10964 } else { |
10966 value &= ~(1 << bit_position); | 10965 value &= ~(1 << bit_position); |
10967 } | 10966 } |
10968 return value; | 10967 return value; |
10969 } | 10968 } |
10970 }; | 10969 }; |
10971 | 10970 |
10972 } } // namespace v8::internal | 10971 } } // namespace v8::internal |
10973 | 10972 |
10974 #endif // V8_OBJECTS_H_ | 10973 #endif // V8_OBJECTS_H_ |
OLD | NEW |