OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // - Smi (immediate small integer) | 52 // - Smi (immediate small integer) |
53 // - HeapObject (superclass for everything allocated in the heap) | 53 // - HeapObject (superclass for everything allocated in the heap) |
54 // - JSReceiver (suitable for property access) | 54 // - JSReceiver (suitable for property access) |
55 // - JSObject | 55 // - JSObject |
56 // - JSArray | 56 // - JSArray |
57 // - JSSet | 57 // - JSSet |
58 // - JSMap | 58 // - JSMap |
59 // - JSWeakMap | 59 // - JSWeakMap |
60 // - JSRegExp | 60 // - JSRegExp |
61 // - JSFunction | 61 // - JSFunction |
| 62 // - JSModule |
62 // - GlobalObject | 63 // - GlobalObject |
63 // - JSGlobalObject | 64 // - JSGlobalObject |
64 // - JSBuiltinsObject | 65 // - JSBuiltinsObject |
65 // - JSGlobalProxy | 66 // - JSGlobalProxy |
66 // - JSValue | 67 // - JSValue |
67 // - JSDate | 68 // - JSDate |
68 // - JSMessageObject | 69 // - JSMessageObject |
69 // - JSProxy | 70 // - JSProxy |
70 // - JSFunctionProxy | 71 // - JSFunctionProxy |
71 // - FixedArrayBase | 72 // - FixedArrayBase |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 V(FIXED_ARRAY_TYPE) \ | 300 V(FIXED_ARRAY_TYPE) \ |
300 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 301 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
301 V(SHARED_FUNCTION_INFO_TYPE) \ | 302 V(SHARED_FUNCTION_INFO_TYPE) \ |
302 \ | 303 \ |
303 V(JS_MESSAGE_OBJECT_TYPE) \ | 304 V(JS_MESSAGE_OBJECT_TYPE) \ |
304 \ | 305 \ |
305 V(JS_VALUE_TYPE) \ | 306 V(JS_VALUE_TYPE) \ |
306 V(JS_DATE_TYPE) \ | 307 V(JS_DATE_TYPE) \ |
307 V(JS_OBJECT_TYPE) \ | 308 V(JS_OBJECT_TYPE) \ |
308 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ | 309 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ |
| 310 V(JS_MODULE_TYPE) \ |
309 V(JS_GLOBAL_OBJECT_TYPE) \ | 311 V(JS_GLOBAL_OBJECT_TYPE) \ |
310 V(JS_BUILTINS_OBJECT_TYPE) \ | 312 V(JS_BUILTINS_OBJECT_TYPE) \ |
311 V(JS_GLOBAL_PROXY_TYPE) \ | 313 V(JS_GLOBAL_PROXY_TYPE) \ |
312 V(JS_ARRAY_TYPE) \ | 314 V(JS_ARRAY_TYPE) \ |
313 V(JS_PROXY_TYPE) \ | 315 V(JS_PROXY_TYPE) \ |
314 V(JS_WEAK_MAP_TYPE) \ | 316 V(JS_WEAK_MAP_TYPE) \ |
315 V(JS_REGEXP_TYPE) \ | 317 V(JS_REGEXP_TYPE) \ |
316 \ | 318 \ |
317 V(JS_FUNCTION_TYPE) \ | 319 V(JS_FUNCTION_TYPE) \ |
318 V(JS_FUNCTION_PROXY_TYPE) \ | 320 V(JS_FUNCTION_PROXY_TYPE) \ |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 // the two forms of function. This organization enables using the same | 621 // the two forms of function. This organization enables using the same |
620 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the | 622 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the |
621 // NONCALLABLE_JS_OBJECT range. | 623 // NONCALLABLE_JS_OBJECT range. |
622 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE | 624 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE |
623 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE | 625 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE |
624 | 626 |
625 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE | 627 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE |
626 JS_DATE_TYPE, | 628 JS_DATE_TYPE, |
627 JS_OBJECT_TYPE, | 629 JS_OBJECT_TYPE, |
628 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 630 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
| 631 JS_MODULE_TYPE, |
629 JS_GLOBAL_OBJECT_TYPE, | 632 JS_GLOBAL_OBJECT_TYPE, |
630 JS_BUILTINS_OBJECT_TYPE, | 633 JS_BUILTINS_OBJECT_TYPE, |
631 JS_GLOBAL_PROXY_TYPE, | 634 JS_GLOBAL_PROXY_TYPE, |
632 JS_ARRAY_TYPE, | 635 JS_ARRAY_TYPE, |
633 JS_SET_TYPE, | 636 JS_SET_TYPE, |
634 JS_MAP_TYPE, | 637 JS_MAP_TYPE, |
635 JS_WEAK_MAP_TYPE, | 638 JS_WEAK_MAP_TYPE, |
636 | 639 |
637 JS_REGEXP_TYPE, | 640 JS_REGEXP_TYPE, |
638 | 641 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 V(ExternalIntArray) \ | 799 V(ExternalIntArray) \ |
797 V(ExternalUnsignedIntArray) \ | 800 V(ExternalUnsignedIntArray) \ |
798 V(ExternalFloatArray) \ | 801 V(ExternalFloatArray) \ |
799 V(ExternalDoubleArray) \ | 802 V(ExternalDoubleArray) \ |
800 V(ExternalPixelArray) \ | 803 V(ExternalPixelArray) \ |
801 V(ByteArray) \ | 804 V(ByteArray) \ |
802 V(FreeSpace) \ | 805 V(FreeSpace) \ |
803 V(JSReceiver) \ | 806 V(JSReceiver) \ |
804 V(JSObject) \ | 807 V(JSObject) \ |
805 V(JSContextExtensionObject) \ | 808 V(JSContextExtensionObject) \ |
| 809 V(JSModule) \ |
806 V(Map) \ | 810 V(Map) \ |
807 V(DescriptorArray) \ | 811 V(DescriptorArray) \ |
808 V(DeoptimizationInputData) \ | 812 V(DeoptimizationInputData) \ |
809 V(DeoptimizationOutputData) \ | 813 V(DeoptimizationOutputData) \ |
810 V(TypeFeedbackCells) \ | 814 V(TypeFeedbackCells) \ |
811 V(FixedArray) \ | 815 V(FixedArray) \ |
812 V(FixedDoubleArray) \ | 816 V(FixedDoubleArray) \ |
813 V(Context) \ | 817 V(Context) \ |
814 V(GlobalContext) \ | 818 V(GlobalContext) \ |
| 819 V(ModuleContext) \ |
815 V(ScopeInfo) \ | 820 V(ScopeInfo) \ |
816 V(JSFunction) \ | 821 V(JSFunction) \ |
817 V(Code) \ | 822 V(Code) \ |
818 V(Oddball) \ | 823 V(Oddball) \ |
819 V(SharedFunctionInfo) \ | 824 V(SharedFunctionInfo) \ |
820 V(JSValue) \ | 825 V(JSValue) \ |
821 V(JSDate) \ | 826 V(JSDate) \ |
822 V(JSMessageObject) \ | 827 V(JSMessageObject) \ |
823 V(StringWrapper) \ | 828 V(StringWrapper) \ |
824 V(Foreign) \ | 829 V(Foreign) \ |
(...skipping 4830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5655 ((kNative + kCompilerHintsSmiTagSize) / kBitsPerByte); | 5660 ((kNative + kCompilerHintsSmiTagSize) / kBitsPerByte); |
5656 #else | 5661 #else |
5657 #error Unknown byte ordering | 5662 #error Unknown byte ordering |
5658 #endif | 5663 #endif |
5659 | 5664 |
5660 private: | 5665 private: |
5661 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 5666 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
5662 }; | 5667 }; |
5663 | 5668 |
5664 | 5669 |
| 5670 // Representation for module instance objects. |
| 5671 class JSModule: public JSObject { |
| 5672 public: |
| 5673 // [context]: the context holding the module's locals, or undefined if none. |
| 5674 DECL_ACCESSORS(context, Object) |
| 5675 |
| 5676 // Casting. |
| 5677 static inline JSModule* cast(Object* obj); |
| 5678 |
| 5679 // Dispatched behavior. |
| 5680 #ifdef OBJECT_PRINT |
| 5681 inline void JSModulePrint() { |
| 5682 JSModulePrint(stdout); |
| 5683 } |
| 5684 void JSModulePrint(FILE* out); |
| 5685 #endif |
| 5686 #ifdef DEBUG |
| 5687 void JSModuleVerify(); |
| 5688 #endif |
| 5689 |
| 5690 // Layout description. |
| 5691 static const int kContextOffset = JSObject::kHeaderSize; |
| 5692 static const int kSize = kContextOffset + kPointerSize; |
| 5693 |
| 5694 private: |
| 5695 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); |
| 5696 }; |
| 5697 |
| 5698 |
5665 // JSFunction describes JavaScript functions. | 5699 // JSFunction describes JavaScript functions. |
5666 class JSFunction: public JSObject { | 5700 class JSFunction: public JSObject { |
5667 public: | 5701 public: |
5668 // [prototype_or_initial_map]: | 5702 // [prototype_or_initial_map]: |
5669 DECL_ACCESSORS(prototype_or_initial_map, Object) | 5703 DECL_ACCESSORS(prototype_or_initial_map, Object) |
5670 | 5704 |
5671 // [shared]: The information about the function that | 5705 // [shared]: The information about the function that |
5672 // can be shared by instances. | 5706 // can be shared by instances. |
5673 DECL_ACCESSORS(shared, SharedFunctionInfo) | 5707 DECL_ACCESSORS(shared, SharedFunctionInfo) |
5674 | 5708 |
(...skipping 2900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8575 } else { | 8609 } else { |
8576 value &= ~(1 << bit_position); | 8610 value &= ~(1 << bit_position); |
8577 } | 8611 } |
8578 return value; | 8612 return value; |
8579 } | 8613 } |
8580 }; | 8614 }; |
8581 | 8615 |
8582 } } // namespace v8::internal | 8616 } } // namespace v8::internal |
8583 | 8617 |
8584 #endif // V8_OBJECTS_H_ | 8618 #endif // V8_OBJECTS_H_ |
OLD | NEW |