OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 } | 617 } |
618 void Print(FILE* out); | 618 void Print(FILE* out); |
619 void PrintLn(FILE* out); | 619 void PrintLn(FILE* out); |
620 #endif | 620 #endif |
621 #ifdef DEBUG | 621 #ifdef DEBUG |
622 // Verifies the object. | 622 // Verifies the object. |
623 void Verify(); | 623 void Verify(); |
624 #endif | 624 #endif |
625 }; | 625 }; |
626 | 626 |
| 627 |
| 628 #define OBJECT_TYPE_LIST(V) \ |
| 629 V(Smi) \ |
| 630 V(HeapObject) \ |
| 631 V(Number) \ |
| 632 |
| 633 #define HEAP_OBJECT_TYPE_LIST(V) \ |
| 634 V(HeapNumber) \ |
| 635 V(String) \ |
| 636 V(Symbol) \ |
| 637 V(SeqString) \ |
| 638 V(ExternalString) \ |
| 639 V(ConsString) \ |
| 640 V(ExternalTwoByteString) \ |
| 641 V(ExternalAsciiString) \ |
| 642 V(SeqTwoByteString) \ |
| 643 V(SeqAsciiString) \ |
| 644 \ |
| 645 V(PixelArray) \ |
| 646 V(ExternalArray) \ |
| 647 V(ExternalByteArray) \ |
| 648 V(ExternalUnsignedByteArray) \ |
| 649 V(ExternalShortArray) \ |
| 650 V(ExternalUnsignedShortArray) \ |
| 651 V(ExternalIntArray) \ |
| 652 V(ExternalUnsignedIntArray) \ |
| 653 V(ExternalFloatArray) \ |
| 654 V(ByteArray) \ |
| 655 V(JSObject) \ |
| 656 V(JSContextExtensionObject) \ |
| 657 V(Map) \ |
| 658 V(DescriptorArray) \ |
| 659 V(DeoptimizationInputData) \ |
| 660 V(DeoptimizationOutputData) \ |
| 661 V(FixedArray) \ |
| 662 V(Context) \ |
| 663 V(CatchContext) \ |
| 664 V(GlobalContext) \ |
| 665 V(JSFunction) \ |
| 666 V(Code) \ |
| 667 V(Oddball) \ |
| 668 V(SharedFunctionInfo) \ |
| 669 V(JSValue) \ |
| 670 V(StringWrapper) \ |
| 671 V(Proxy) \ |
| 672 V(Boolean) \ |
| 673 V(JSArray) \ |
| 674 V(JSRegExp) \ |
| 675 V(HashTable) \ |
| 676 V(Dictionary) \ |
| 677 V(SymbolTable) \ |
| 678 V(JSFunctionResultCache) \ |
| 679 V(NormalizedMapCache) \ |
| 680 V(CompilationCacheTable) \ |
| 681 V(CodeCacheHashTable) \ |
| 682 V(MapCache) \ |
| 683 V(Primitive) \ |
| 684 V(GlobalObject) \ |
| 685 V(JSGlobalObject) \ |
| 686 V(JSBuiltinsObject) \ |
| 687 V(JSGlobalProxy) \ |
| 688 V(UndetectableObject) \ |
| 689 V(AccessCheckNeeded) \ |
| 690 V(JSGlobalPropertyCell) \ |
| 691 |
627 // Object is the abstract superclass for all classes in the | 692 // Object is the abstract superclass for all classes in the |
628 // object hierarchy. | 693 // object hierarchy. |
629 // Object does not use any virtual functions to avoid the | 694 // Object does not use any virtual functions to avoid the |
630 // allocation of the C++ vtable. | 695 // allocation of the C++ vtable. |
631 // Since Smi and Failure are subclasses of Object no | 696 // Since Smi and Failure are subclasses of Object no |
632 // data members can be present in Object. | 697 // data members can be present in Object. |
633 class Object : public MaybeObject { | 698 class Object : public MaybeObject { |
634 public: | 699 public: |
635 // Type testing. | 700 // Type testing. |
636 inline bool IsSmi(); | 701 #define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_(); |
637 inline bool IsHeapObject(); | 702 OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
638 inline bool IsHeapNumber(); | 703 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
639 inline bool IsString(); | 704 #undef IS_TYPE_FUNCTION_DECL |
640 inline bool IsSymbol(); | |
641 // See objects-inl.h for more details | |
642 inline bool IsSeqString(); | |
643 inline bool IsExternalString(); | |
644 inline bool IsExternalTwoByteString(); | |
645 inline bool IsExternalAsciiString(); | |
646 inline bool IsSeqTwoByteString(); | |
647 inline bool IsSeqAsciiString(); | |
648 inline bool IsConsString(); | |
649 | |
650 inline bool IsNumber(); | |
651 inline bool IsByteArray(); | |
652 inline bool IsPixelArray(); | |
653 inline bool IsExternalArray(); | |
654 inline bool IsExternalByteArray(); | |
655 inline bool IsExternalUnsignedByteArray(); | |
656 inline bool IsExternalShortArray(); | |
657 inline bool IsExternalUnsignedShortArray(); | |
658 inline bool IsExternalIntArray(); | |
659 inline bool IsExternalUnsignedIntArray(); | |
660 inline bool IsExternalFloatArray(); | |
661 inline bool IsJSObject(); | |
662 inline bool IsJSContextExtensionObject(); | |
663 inline bool IsMap(); | |
664 inline bool IsFixedArray(); | |
665 inline bool IsDescriptorArray(); | |
666 inline bool IsDeoptimizationInputData(); | |
667 inline bool IsDeoptimizationOutputData(); | |
668 inline bool IsContext(); | |
669 inline bool IsCatchContext(); | |
670 inline bool IsGlobalContext(); | |
671 inline bool IsJSFunction(); | |
672 inline bool IsCode(); | |
673 inline bool IsOddball(); | |
674 inline bool IsSharedFunctionInfo(); | |
675 inline bool IsJSValue(); | |
676 inline bool IsStringWrapper(); | |
677 inline bool IsProxy(); | |
678 inline bool IsBoolean(); | |
679 inline bool IsJSArray(); | |
680 inline bool IsJSRegExp(); | |
681 inline bool IsHashTable(); | |
682 inline bool IsDictionary(); | |
683 inline bool IsSymbolTable(); | |
684 inline bool IsJSFunctionResultCache(); | |
685 inline bool IsNormalizedMapCache(); | |
686 inline bool IsCompilationCacheTable(); | |
687 inline bool IsCodeCacheHashTable(); | |
688 inline bool IsMapCache(); | |
689 inline bool IsPrimitive(); | |
690 inline bool IsGlobalObject(); | |
691 inline bool IsJSGlobalObject(); | |
692 inline bool IsJSBuiltinsObject(); | |
693 inline bool IsJSGlobalProxy(); | |
694 inline bool IsUndetectableObject(); | |
695 inline bool IsAccessCheckNeeded(); | |
696 inline bool IsJSGlobalPropertyCell(); | |
697 | 705 |
698 // Returns true if this object is an instance of the specified | 706 // Returns true if this object is an instance of the specified |
699 // function template. | 707 // function template. |
700 inline bool IsInstanceOf(FunctionTemplateInfo* type); | 708 inline bool IsInstanceOf(FunctionTemplateInfo* type); |
701 | 709 |
702 inline bool IsStruct(); | 710 inline bool IsStruct(); |
703 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); | 711 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); |
704 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 712 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
705 #undef DECLARE_STRUCT_PREDICATE | 713 #undef DECLARE_STRUCT_PREDICATE |
706 | 714 |
(...skipping 5702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6409 } else { | 6417 } else { |
6410 value &= ~(1 << bit_position); | 6418 value &= ~(1 << bit_position); |
6411 } | 6419 } |
6412 return value; | 6420 return value; |
6413 } | 6421 } |
6414 }; | 6422 }; |
6415 | 6423 |
6416 } } // namespace v8::internal | 6424 } } // namespace v8::internal |
6417 | 6425 |
6418 #endif // V8_OBJECTS_H_ | 6426 #endif // V8_OBJECTS_H_ |
OLD | NEW |