| 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 InstanceType type; | 724 InstanceType type; |
| 725 Object* ptr; | 725 Object* ptr; |
| 726 const char* str; | 726 const char* str; |
| 727 double number; | 727 double number; |
| 728 }; | 728 }; |
| 729 | 729 |
| 730 | 730 |
| 731 // A template-ized version of the IsXXX functions. | 731 // A template-ized version of the IsXXX functions. |
| 732 template <class C> static inline bool Is(Object* obj); | 732 template <class C> static inline bool Is(Object* obj); |
| 733 | 733 |
| 734 #ifdef VERIFY_HEAP |
| 735 #define DECLARE_VERIFIER(Name) void Name##Verify(); |
| 736 #else |
| 737 #define DECLARE_VERIFIER(Name) |
| 738 #endif |
| 734 | 739 |
| 735 class MaybeObject BASE_EMBEDDED { | 740 class MaybeObject BASE_EMBEDDED { |
| 736 public: | 741 public: |
| 737 inline bool IsFailure(); | 742 inline bool IsFailure(); |
| 738 inline bool IsRetryAfterGC(); | 743 inline bool IsRetryAfterGC(); |
| 739 inline bool IsOutOfMemory(); | 744 inline bool IsOutOfMemory(); |
| 740 inline bool IsException(); | 745 inline bool IsException(); |
| 741 INLINE(bool IsTheHole()); | 746 INLINE(bool IsTheHole()); |
| 742 inline bool ToObject(Object** obj) { | 747 inline bool ToObject(Object** obj) { |
| 743 if (IsFailure()) return false; | 748 if (IsFailure()) return false; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 768 // Prints this object with details. | 773 // Prints this object with details. |
| 769 inline void Print() { | 774 inline void Print() { |
| 770 Print(stdout); | 775 Print(stdout); |
| 771 } | 776 } |
| 772 inline void PrintLn() { | 777 inline void PrintLn() { |
| 773 PrintLn(stdout); | 778 PrintLn(stdout); |
| 774 } | 779 } |
| 775 void Print(FILE* out); | 780 void Print(FILE* out); |
| 776 void PrintLn(FILE* out); | 781 void PrintLn(FILE* out); |
| 777 #endif | 782 #endif |
| 778 #ifdef DEBUG | 783 #ifdef VERIFY_HEAP |
| 779 // Verifies the object. | 784 // Verifies the object. |
| 780 void Verify(); | 785 void Verify(); |
| 781 #endif | 786 #endif |
| 782 }; | 787 }; |
| 783 | 788 |
| 784 | 789 |
| 785 #define OBJECT_TYPE_LIST(V) \ | 790 #define OBJECT_TYPE_LIST(V) \ |
| 786 V(Smi) \ | 791 V(Smi) \ |
| 787 V(HeapObject) \ | 792 V(HeapObject) \ |
| 788 V(Number) \ | 793 V(Number) \ |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 bool SameValue(Object* other); | 980 bool SameValue(Object* other); |
| 976 | 981 |
| 977 // Tries to convert an object to an array index. Returns true and sets | 982 // Tries to convert an object to an array index. Returns true and sets |
| 978 // the output parameter if it succeeds. | 983 // the output parameter if it succeeds. |
| 979 inline bool ToArrayIndex(uint32_t* index); | 984 inline bool ToArrayIndex(uint32_t* index); |
| 980 | 985 |
| 981 // Returns true if this is a JSValue containing a string and the index is | 986 // Returns true if this is a JSValue containing a string and the index is |
| 982 // < the length of the string. Used to implement [] on strings. | 987 // < the length of the string. Used to implement [] on strings. |
| 983 inline bool IsStringObjectWithCharacterAt(uint32_t index); | 988 inline bool IsStringObjectWithCharacterAt(uint32_t index); |
| 984 | 989 |
| 985 #ifdef DEBUG | 990 #ifdef VERIFY_HEAP |
| 986 // Verify a pointer is a valid object pointer. | 991 // Verify a pointer is a valid object pointer. |
| 987 static void VerifyPointer(Object* p); | 992 static void VerifyPointer(Object* p); |
| 988 #endif | 993 #endif |
| 989 | 994 |
| 990 inline void VerifyApiCallResultType(); | 995 inline void VerifyApiCallResultType(); |
| 991 | 996 |
| 992 // Prints this object without details. | 997 // Prints this object without details. |
| 993 inline void ShortPrint() { | 998 inline void ShortPrint() { |
| 994 ShortPrint(stdout); | 999 ShortPrint(stdout); |
| 995 } | 1000 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 | 1035 |
| 1031 // Casting. | 1036 // Casting. |
| 1032 static inline Smi* cast(Object* object); | 1037 static inline Smi* cast(Object* object); |
| 1033 | 1038 |
| 1034 // Dispatched behavior. | 1039 // Dispatched behavior. |
| 1035 inline void SmiPrint() { | 1040 inline void SmiPrint() { |
| 1036 SmiPrint(stdout); | 1041 SmiPrint(stdout); |
| 1037 } | 1042 } |
| 1038 void SmiPrint(FILE* out); | 1043 void SmiPrint(FILE* out); |
| 1039 void SmiPrint(StringStream* accumulator); | 1044 void SmiPrint(StringStream* accumulator); |
| 1040 #ifdef DEBUG | 1045 |
| 1041 void SmiVerify(); | 1046 DECLARE_VERIFIER(Smi) |
| 1042 #endif | |
| 1043 | 1047 |
| 1044 static const int kMinValue = | 1048 static const int kMinValue = |
| 1045 (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1); | 1049 (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1); |
| 1046 static const int kMaxValue = -(kMinValue + 1); | 1050 static const int kMaxValue = -(kMinValue + 1); |
| 1047 | 1051 |
| 1048 private: | 1052 private: |
| 1049 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); | 1053 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); |
| 1050 }; | 1054 }; |
| 1051 | 1055 |
| 1052 | 1056 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 static inline Failure* OutOfMemoryException(); | 1107 static inline Failure* OutOfMemoryException(); |
| 1104 // Casting. | 1108 // Casting. |
| 1105 static inline Failure* cast(MaybeObject* object); | 1109 static inline Failure* cast(MaybeObject* object); |
| 1106 | 1110 |
| 1107 // Dispatched behavior. | 1111 // Dispatched behavior. |
| 1108 inline void FailurePrint() { | 1112 inline void FailurePrint() { |
| 1109 FailurePrint(stdout); | 1113 FailurePrint(stdout); |
| 1110 } | 1114 } |
| 1111 void FailurePrint(FILE* out); | 1115 void FailurePrint(FILE* out); |
| 1112 void FailurePrint(StringStream* accumulator); | 1116 void FailurePrint(StringStream* accumulator); |
| 1113 #ifdef DEBUG | 1117 |
| 1114 void FailureVerify(); | 1118 DECLARE_VERIFIER(Failure) |
| 1115 #endif | |
| 1116 | 1119 |
| 1117 private: | 1120 private: |
| 1118 inline intptr_t value() const; | 1121 inline intptr_t value() const; |
| 1119 static inline Failure* Construct(Type type, intptr_t value = 0); | 1122 static inline Failure* Construct(Type type, intptr_t value = 0); |
| 1120 | 1123 |
| 1121 DISALLOW_IMPLICIT_CONSTRUCTORS(Failure); | 1124 DISALLOW_IMPLICIT_CONSTRUCTORS(Failure); |
| 1122 }; | 1125 }; |
| 1123 | 1126 |
| 1124 | 1127 |
| 1125 // Heap objects typically have a map pointer in their first word. However, | 1128 // Heap objects typically have a map pointer in their first word. However, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 | 1239 |
| 1237 // Dispatched behavior. | 1240 // Dispatched behavior. |
| 1238 void HeapObjectShortPrint(StringStream* accumulator); | 1241 void HeapObjectShortPrint(StringStream* accumulator); |
| 1239 #ifdef OBJECT_PRINT | 1242 #ifdef OBJECT_PRINT |
| 1240 inline void HeapObjectPrint() { | 1243 inline void HeapObjectPrint() { |
| 1241 HeapObjectPrint(stdout); | 1244 HeapObjectPrint(stdout); |
| 1242 } | 1245 } |
| 1243 void HeapObjectPrint(FILE* out); | 1246 void HeapObjectPrint(FILE* out); |
| 1244 void PrintHeader(FILE* out, const char* id); | 1247 void PrintHeader(FILE* out, const char* id); |
| 1245 #endif | 1248 #endif |
| 1246 | 1249 DECLARE_VERIFIER(HeapObject) |
| 1247 #ifdef DEBUG | 1250 #ifdef VERIFY_HEAP |
| 1248 void HeapObjectVerify(); | |
| 1249 inline void VerifyObjectField(int offset); | 1251 inline void VerifyObjectField(int offset); |
| 1250 inline void VerifySmiField(int offset); | 1252 inline void VerifySmiField(int offset); |
| 1251 | 1253 |
| 1252 // Verify a pointer is a valid HeapObject pointer that points to object | 1254 // Verify a pointer is a valid HeapObject pointer that points to object |
| 1253 // areas in the heap. | 1255 // areas in the heap. |
| 1254 static void VerifyHeapPointer(Object* p); | 1256 static void VerifyHeapPointer(Object* p); |
| 1255 #endif | 1257 #endif |
| 1256 | 1258 |
| 1257 // Layout description. | 1259 // Layout description. |
| 1258 // First field in a heap object is map. | 1260 // First field in a heap object is map. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 // Casting. | 1326 // Casting. |
| 1325 static inline HeapNumber* cast(Object* obj); | 1327 static inline HeapNumber* cast(Object* obj); |
| 1326 | 1328 |
| 1327 // Dispatched behavior. | 1329 // Dispatched behavior. |
| 1328 Object* HeapNumberToBoolean(); | 1330 Object* HeapNumberToBoolean(); |
| 1329 inline void HeapNumberPrint() { | 1331 inline void HeapNumberPrint() { |
| 1330 HeapNumberPrint(stdout); | 1332 HeapNumberPrint(stdout); |
| 1331 } | 1333 } |
| 1332 void HeapNumberPrint(FILE* out); | 1334 void HeapNumberPrint(FILE* out); |
| 1333 void HeapNumberPrint(StringStream* accumulator); | 1335 void HeapNumberPrint(StringStream* accumulator); |
| 1334 #ifdef DEBUG | 1336 DECLARE_VERIFIER(HeapNumber) |
| 1335 void HeapNumberVerify(); | |
| 1336 #endif | |
| 1337 | 1337 |
| 1338 inline int get_exponent(); | 1338 inline int get_exponent(); |
| 1339 inline int get_sign(); | 1339 inline int get_sign(); |
| 1340 | 1340 |
| 1341 // Layout description. | 1341 // Layout description. |
| 1342 static const int kValueOffset = HeapObject::kHeaderSize; | 1342 static const int kValueOffset = HeapObject::kHeaderSize; |
| 1343 // IEEE doubles are two 32 bit words. The first is just mantissa, the second | 1343 // IEEE doubles are two 32 bit words. The first is just mantissa, the second |
| 1344 // is a mixture of sign, exponent and mantissa. Our current platforms are all | 1344 // is a mixture of sign, exponent and mantissa. Our current platforms are all |
| 1345 // little endian apart from non-EABI arm which is little endian with big | 1345 // little endian apart from non-EABI arm which is little endian with big |
| 1346 // endian floating point word ordering! | 1346 // endian floating point word ordering! |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2071 | 2071 |
| 2072 | 2072 |
| 2073 // Dispatched behavior. | 2073 // Dispatched behavior. |
| 2074 void JSObjectShortPrint(StringStream* accumulator); | 2074 void JSObjectShortPrint(StringStream* accumulator); |
| 2075 #ifdef OBJECT_PRINT | 2075 #ifdef OBJECT_PRINT |
| 2076 inline void JSObjectPrint() { | 2076 inline void JSObjectPrint() { |
| 2077 JSObjectPrint(stdout); | 2077 JSObjectPrint(stdout); |
| 2078 } | 2078 } |
| 2079 void JSObjectPrint(FILE* out); | 2079 void JSObjectPrint(FILE* out); |
| 2080 #endif | 2080 #endif |
| 2081 #ifdef DEBUG | 2081 DECLARE_VERIFIER(JSObject) |
| 2082 void JSObjectVerify(); | |
| 2083 #endif | |
| 2084 #ifdef OBJECT_PRINT | 2082 #ifdef OBJECT_PRINT |
| 2085 inline void PrintProperties() { | 2083 inline void PrintProperties() { |
| 2086 PrintProperties(stdout); | 2084 PrintProperties(stdout); |
| 2087 } | 2085 } |
| 2088 void PrintProperties(FILE* out); | 2086 void PrintProperties(FILE* out); |
| 2089 | 2087 |
| 2090 inline void PrintElements() { | 2088 inline void PrintElements() { |
| 2091 PrintElements(stdout); | 2089 PrintElements(stdout); |
| 2092 } | 2090 } |
| 2093 void PrintElements(FILE* out); | 2091 void PrintElements(FILE* out); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2355 // Maximally allowed length of a FixedArray. | 2353 // Maximally allowed length of a FixedArray. |
| 2356 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; | 2354 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; |
| 2357 | 2355 |
| 2358 // Dispatched behavior. | 2356 // Dispatched behavior. |
| 2359 #ifdef OBJECT_PRINT | 2357 #ifdef OBJECT_PRINT |
| 2360 inline void FixedArrayPrint() { | 2358 inline void FixedArrayPrint() { |
| 2361 FixedArrayPrint(stdout); | 2359 FixedArrayPrint(stdout); |
| 2362 } | 2360 } |
| 2363 void FixedArrayPrint(FILE* out); | 2361 void FixedArrayPrint(FILE* out); |
| 2364 #endif | 2362 #endif |
| 2363 DECLARE_VERIFIER(FixedArray) |
| 2365 #ifdef DEBUG | 2364 #ifdef DEBUG |
| 2366 void FixedArrayVerify(); | |
| 2367 // Checks if two FixedArrays have identical contents. | 2365 // Checks if two FixedArrays have identical contents. |
| 2368 bool IsEqualTo(FixedArray* other); | 2366 bool IsEqualTo(FixedArray* other); |
| 2369 #endif | 2367 #endif |
| 2370 | 2368 |
| 2371 // Swap two elements in a pair of arrays. If this array and the | 2369 // Swap two elements in a pair of arrays. If this array and the |
| 2372 // numbers array are the same object, the elements are only swapped | 2370 // numbers array are the same object, the elements are only swapped |
| 2373 // once. | 2371 // once. |
| 2374 void SwapPairs(FixedArray* numbers, int i, int j); | 2372 void SwapPairs(FixedArray* numbers, int i, int j); |
| 2375 | 2373 |
| 2376 // Sort prefix of this array and the numbers array as pairs wrt. the | 2374 // Sort prefix of this array and the numbers array as pairs wrt. the |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2442 // Maximally allowed length of a FixedArray. | 2440 // Maximally allowed length of a FixedArray. |
| 2443 static const int kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize; | 2441 static const int kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize; |
| 2444 | 2442 |
| 2445 // Dispatched behavior. | 2443 // Dispatched behavior. |
| 2446 #ifdef OBJECT_PRINT | 2444 #ifdef OBJECT_PRINT |
| 2447 inline void FixedDoubleArrayPrint() { | 2445 inline void FixedDoubleArrayPrint() { |
| 2448 FixedDoubleArrayPrint(stdout); | 2446 FixedDoubleArrayPrint(stdout); |
| 2449 } | 2447 } |
| 2450 void FixedDoubleArrayPrint(FILE* out); | 2448 void FixedDoubleArrayPrint(FILE* out); |
| 2451 #endif | 2449 #endif |
| 2452 | 2450 DECLARE_VERIFIER(FixedDoubleArray) |
| 2453 #ifdef DEBUG | |
| 2454 void FixedDoubleArrayVerify(); | |
| 2455 #endif | |
| 2456 | 2451 |
| 2457 private: | 2452 private: |
| 2458 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedDoubleArray); | 2453 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedDoubleArray); |
| 2459 }; | 2454 }; |
| 2460 | 2455 |
| 2461 | 2456 |
| 2462 // DescriptorArrays are fixed arrays used to hold instance descriptors. | 2457 // DescriptorArrays are fixed arrays used to hold instance descriptors. |
| 2463 // The format of the these objects is: | 2458 // The format of the these objects is: |
| 2464 // [0]: Either Smi(0) if uninitialized, or a pointer to small fixed array: | 2459 // [0]: Either Smi(0) if uninitialized, or a pointer to small fixed array: |
| 2465 // [0]: pointer to fixed array with enum cache | 2460 // [0]: pointer to fixed array with enum cache |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3380 inline void Clear(); | 3375 inline void Clear(); |
| 3381 | 3376 |
| 3382 inline int size(); | 3377 inline int size(); |
| 3383 inline void set_size(int size); | 3378 inline void set_size(int size); |
| 3384 inline int finger_index(); | 3379 inline int finger_index(); |
| 3385 inline void set_finger_index(int finger_index); | 3380 inline void set_finger_index(int finger_index); |
| 3386 | 3381 |
| 3387 // Casting | 3382 // Casting |
| 3388 static inline JSFunctionResultCache* cast(Object* obj); | 3383 static inline JSFunctionResultCache* cast(Object* obj); |
| 3389 | 3384 |
| 3390 #ifdef DEBUG | 3385 DECLARE_VERIFIER(JSFunctionResultCache) |
| 3391 void JSFunctionResultCacheVerify(); | |
| 3392 #endif | |
| 3393 }; | 3386 }; |
| 3394 | 3387 |
| 3395 | 3388 |
| 3396 // ScopeInfo represents information about different scopes of a source | 3389 // ScopeInfo represents information about different scopes of a source |
| 3397 // program and the allocation of the scope's variables. Scope information | 3390 // program and the allocation of the scope's variables. Scope information |
| 3398 // is stored in a compressed form in ScopeInfo objects and is used | 3391 // is stored in a compressed form in ScopeInfo objects and is used |
| 3399 // at runtime (stack dumps, deoptimization, etc.). | 3392 // at runtime (stack dumps, deoptimization, etc.). |
| 3400 | 3393 |
| 3401 // This object provides quick access to scope info details for runtime | 3394 // This object provides quick access to scope info details for runtime |
| 3402 // routines. | 3395 // routines. |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3602 static const int kEntries = 64; | 3595 static const int kEntries = 64; |
| 3603 | 3596 |
| 3604 MUST_USE_RESULT MaybeObject* Get(JSObject* object, | 3597 MUST_USE_RESULT MaybeObject* Get(JSObject* object, |
| 3605 PropertyNormalizationMode mode); | 3598 PropertyNormalizationMode mode); |
| 3606 | 3599 |
| 3607 void Clear(); | 3600 void Clear(); |
| 3608 | 3601 |
| 3609 // Casting | 3602 // Casting |
| 3610 static inline NormalizedMapCache* cast(Object* obj); | 3603 static inline NormalizedMapCache* cast(Object* obj); |
| 3611 | 3604 |
| 3612 #ifdef DEBUG | 3605 DECLARE_VERIFIER(NormalizedMapCache) |
| 3613 void NormalizedMapCacheVerify(); | |
| 3614 #endif | |
| 3615 }; | 3606 }; |
| 3616 | 3607 |
| 3617 | 3608 |
| 3618 // ByteArray represents fixed sized byte arrays. Used for the relocation info | 3609 // ByteArray represents fixed sized byte arrays. Used for the relocation info |
| 3619 // that is attached to code objects. | 3610 // that is attached to code objects. |
| 3620 class ByteArray: public FixedArrayBase { | 3611 class ByteArray: public FixedArrayBase { |
| 3621 public: | 3612 public: |
| 3622 inline int Size() { return RoundUp(length() + kHeaderSize, kPointerSize); } | 3613 inline int Size() { return RoundUp(length() + kHeaderSize, kPointerSize); } |
| 3623 | 3614 |
| 3624 // Setter and getter. | 3615 // Setter and getter. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 3653 // Dispatched behavior. | 3644 // Dispatched behavior. |
| 3654 inline int ByteArraySize() { | 3645 inline int ByteArraySize() { |
| 3655 return SizeFor(this->length()); | 3646 return SizeFor(this->length()); |
| 3656 } | 3647 } |
| 3657 #ifdef OBJECT_PRINT | 3648 #ifdef OBJECT_PRINT |
| 3658 inline void ByteArrayPrint() { | 3649 inline void ByteArrayPrint() { |
| 3659 ByteArrayPrint(stdout); | 3650 ByteArrayPrint(stdout); |
| 3660 } | 3651 } |
| 3661 void ByteArrayPrint(FILE* out); | 3652 void ByteArrayPrint(FILE* out); |
| 3662 #endif | 3653 #endif |
| 3663 #ifdef DEBUG | 3654 DECLARE_VERIFIER(ByteArray) |
| 3664 void ByteArrayVerify(); | |
| 3665 #endif | |
| 3666 | 3655 |
| 3667 // Layout description. | 3656 // Layout description. |
| 3668 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); | 3657 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); |
| 3669 | 3658 |
| 3670 // Maximal memory consumption for a single ByteArray. | 3659 // Maximal memory consumption for a single ByteArray. |
| 3671 static const int kMaxSize = 512 * MB; | 3660 static const int kMaxSize = 512 * MB; |
| 3672 // Maximal length of a single ByteArray. | 3661 // Maximal length of a single ByteArray. |
| 3673 static const int kMaxLength = kMaxSize - kHeaderSize; | 3662 static const int kMaxLength = kMaxSize - kHeaderSize; |
| 3674 | 3663 |
| 3675 private: | 3664 private: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3689 | 3678 |
| 3690 // Casting. | 3679 // Casting. |
| 3691 static inline FreeSpace* cast(Object* obj); | 3680 static inline FreeSpace* cast(Object* obj); |
| 3692 | 3681 |
| 3693 #ifdef OBJECT_PRINT | 3682 #ifdef OBJECT_PRINT |
| 3694 inline void FreeSpacePrint() { | 3683 inline void FreeSpacePrint() { |
| 3695 FreeSpacePrint(stdout); | 3684 FreeSpacePrint(stdout); |
| 3696 } | 3685 } |
| 3697 void FreeSpacePrint(FILE* out); | 3686 void FreeSpacePrint(FILE* out); |
| 3698 #endif | 3687 #endif |
| 3699 #ifdef DEBUG | 3688 DECLARE_VERIFIER(FreeSpace) |
| 3700 void FreeSpaceVerify(); | |
| 3701 #endif | |
| 3702 | 3689 |
| 3703 // Layout description. | 3690 // Layout description. |
| 3704 // Size is smi tagged when it is stored. | 3691 // Size is smi tagged when it is stored. |
| 3705 static const int kSizeOffset = HeapObject::kHeaderSize; | 3692 static const int kSizeOffset = HeapObject::kHeaderSize; |
| 3706 static const int kHeaderSize = kSizeOffset + kPointerSize; | 3693 static const int kHeaderSize = kSizeOffset + kPointerSize; |
| 3707 | 3694 |
| 3708 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); | 3695 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); |
| 3709 | 3696 |
| 3710 private: | 3697 private: |
| 3711 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); | 3698 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3771 | 3758 |
| 3772 // Casting. | 3759 // Casting. |
| 3773 static inline ExternalPixelArray* cast(Object* obj); | 3760 static inline ExternalPixelArray* cast(Object* obj); |
| 3774 | 3761 |
| 3775 #ifdef OBJECT_PRINT | 3762 #ifdef OBJECT_PRINT |
| 3776 inline void ExternalPixelArrayPrint() { | 3763 inline void ExternalPixelArrayPrint() { |
| 3777 ExternalPixelArrayPrint(stdout); | 3764 ExternalPixelArrayPrint(stdout); |
| 3778 } | 3765 } |
| 3779 void ExternalPixelArrayPrint(FILE* out); | 3766 void ExternalPixelArrayPrint(FILE* out); |
| 3780 #endif | 3767 #endif |
| 3781 #ifdef DEBUG | 3768 DECLARE_VERIFIER(ExternalPixelArray) |
| 3782 void ExternalPixelArrayVerify(); | |
| 3783 #endif // DEBUG | |
| 3784 | 3769 |
| 3785 private: | 3770 private: |
| 3786 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalPixelArray); | 3771 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalPixelArray); |
| 3787 }; | 3772 }; |
| 3788 | 3773 |
| 3789 | 3774 |
| 3790 class ExternalByteArray: public ExternalArray { | 3775 class ExternalByteArray: public ExternalArray { |
| 3791 public: | 3776 public: |
| 3792 // Setter and getter. | 3777 // Setter and getter. |
| 3793 inline int8_t get_scalar(int index); | 3778 inline int8_t get_scalar(int index); |
| 3794 MUST_USE_RESULT inline MaybeObject* get(int index); | 3779 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3795 inline void set(int index, int8_t value); | 3780 inline void set(int index, int8_t value); |
| 3796 | 3781 |
| 3797 // This accessor applies the correct conversion from Smi, HeapNumber | 3782 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3798 // and undefined. | 3783 // and undefined. |
| 3799 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3784 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3800 | 3785 |
| 3801 // Casting. | 3786 // Casting. |
| 3802 static inline ExternalByteArray* cast(Object* obj); | 3787 static inline ExternalByteArray* cast(Object* obj); |
| 3803 | 3788 |
| 3804 #ifdef OBJECT_PRINT | 3789 #ifdef OBJECT_PRINT |
| 3805 inline void ExternalByteArrayPrint() { | 3790 inline void ExternalByteArrayPrint() { |
| 3806 ExternalByteArrayPrint(stdout); | 3791 ExternalByteArrayPrint(stdout); |
| 3807 } | 3792 } |
| 3808 void ExternalByteArrayPrint(FILE* out); | 3793 void ExternalByteArrayPrint(FILE* out); |
| 3809 #endif | 3794 #endif |
| 3810 #ifdef DEBUG | 3795 DECLARE_VERIFIER(ExternalByteArray) |
| 3811 void ExternalByteArrayVerify(); | |
| 3812 #endif // DEBUG | |
| 3813 | 3796 |
| 3814 private: | 3797 private: |
| 3815 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); | 3798 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); |
| 3816 }; | 3799 }; |
| 3817 | 3800 |
| 3818 | 3801 |
| 3819 class ExternalUnsignedByteArray: public ExternalArray { | 3802 class ExternalUnsignedByteArray: public ExternalArray { |
| 3820 public: | 3803 public: |
| 3821 // Setter and getter. | 3804 // Setter and getter. |
| 3822 inline uint8_t get_scalar(int index); | 3805 inline uint8_t get_scalar(int index); |
| 3823 MUST_USE_RESULT inline MaybeObject* get(int index); | 3806 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3824 inline void set(int index, uint8_t value); | 3807 inline void set(int index, uint8_t value); |
| 3825 | 3808 |
| 3826 // This accessor applies the correct conversion from Smi, HeapNumber | 3809 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3827 // and undefined. | 3810 // and undefined. |
| 3828 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3811 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3829 | 3812 |
| 3830 // Casting. | 3813 // Casting. |
| 3831 static inline ExternalUnsignedByteArray* cast(Object* obj); | 3814 static inline ExternalUnsignedByteArray* cast(Object* obj); |
| 3832 | 3815 |
| 3833 #ifdef OBJECT_PRINT | 3816 #ifdef OBJECT_PRINT |
| 3834 inline void ExternalUnsignedByteArrayPrint() { | 3817 inline void ExternalUnsignedByteArrayPrint() { |
| 3835 ExternalUnsignedByteArrayPrint(stdout); | 3818 ExternalUnsignedByteArrayPrint(stdout); |
| 3836 } | 3819 } |
| 3837 void ExternalUnsignedByteArrayPrint(FILE* out); | 3820 void ExternalUnsignedByteArrayPrint(FILE* out); |
| 3838 #endif | 3821 #endif |
| 3839 #ifdef DEBUG | 3822 DECLARE_VERIFIER(ExternalUnsignedByteArray) |
| 3840 void ExternalUnsignedByteArrayVerify(); | |
| 3841 #endif // DEBUG | |
| 3842 | 3823 |
| 3843 private: | 3824 private: |
| 3844 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); | 3825 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); |
| 3845 }; | 3826 }; |
| 3846 | 3827 |
| 3847 | 3828 |
| 3848 class ExternalShortArray: public ExternalArray { | 3829 class ExternalShortArray: public ExternalArray { |
| 3849 public: | 3830 public: |
| 3850 // Setter and getter. | 3831 // Setter and getter. |
| 3851 inline int16_t get_scalar(int index); | 3832 inline int16_t get_scalar(int index); |
| 3852 MUST_USE_RESULT inline MaybeObject* get(int index); | 3833 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3853 inline void set(int index, int16_t value); | 3834 inline void set(int index, int16_t value); |
| 3854 | 3835 |
| 3855 // This accessor applies the correct conversion from Smi, HeapNumber | 3836 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3856 // and undefined. | 3837 // and undefined. |
| 3857 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3838 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3858 | 3839 |
| 3859 // Casting. | 3840 // Casting. |
| 3860 static inline ExternalShortArray* cast(Object* obj); | 3841 static inline ExternalShortArray* cast(Object* obj); |
| 3861 | 3842 |
| 3862 #ifdef OBJECT_PRINT | 3843 #ifdef OBJECT_PRINT |
| 3863 inline void ExternalShortArrayPrint() { | 3844 inline void ExternalShortArrayPrint() { |
| 3864 ExternalShortArrayPrint(stdout); | 3845 ExternalShortArrayPrint(stdout); |
| 3865 } | 3846 } |
| 3866 void ExternalShortArrayPrint(FILE* out); | 3847 void ExternalShortArrayPrint(FILE* out); |
| 3867 #endif | 3848 #endif |
| 3868 #ifdef DEBUG | 3849 DECLARE_VERIFIER(ExternalShortArray) |
| 3869 void ExternalShortArrayVerify(); | |
| 3870 #endif // DEBUG | |
| 3871 | 3850 |
| 3872 private: | 3851 private: |
| 3873 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); | 3852 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); |
| 3874 }; | 3853 }; |
| 3875 | 3854 |
| 3876 | 3855 |
| 3877 class ExternalUnsignedShortArray: public ExternalArray { | 3856 class ExternalUnsignedShortArray: public ExternalArray { |
| 3878 public: | 3857 public: |
| 3879 // Setter and getter. | 3858 // Setter and getter. |
| 3880 inline uint16_t get_scalar(int index); | 3859 inline uint16_t get_scalar(int index); |
| 3881 MUST_USE_RESULT inline MaybeObject* get(int index); | 3860 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3882 inline void set(int index, uint16_t value); | 3861 inline void set(int index, uint16_t value); |
| 3883 | 3862 |
| 3884 // This accessor applies the correct conversion from Smi, HeapNumber | 3863 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3885 // and undefined. | 3864 // and undefined. |
| 3886 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3865 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3887 | 3866 |
| 3888 // Casting. | 3867 // Casting. |
| 3889 static inline ExternalUnsignedShortArray* cast(Object* obj); | 3868 static inline ExternalUnsignedShortArray* cast(Object* obj); |
| 3890 | 3869 |
| 3891 #ifdef OBJECT_PRINT | 3870 #ifdef OBJECT_PRINT |
| 3892 inline void ExternalUnsignedShortArrayPrint() { | 3871 inline void ExternalUnsignedShortArrayPrint() { |
| 3893 ExternalUnsignedShortArrayPrint(stdout); | 3872 ExternalUnsignedShortArrayPrint(stdout); |
| 3894 } | 3873 } |
| 3895 void ExternalUnsignedShortArrayPrint(FILE* out); | 3874 void ExternalUnsignedShortArrayPrint(FILE* out); |
| 3896 #endif | 3875 #endif |
| 3897 #ifdef DEBUG | 3876 DECLARE_VERIFIER(ExternalUnsignedShortArray) |
| 3898 void ExternalUnsignedShortArrayVerify(); | |
| 3899 #endif // DEBUG | |
| 3900 | 3877 |
| 3901 private: | 3878 private: |
| 3902 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); | 3879 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); |
| 3903 }; | 3880 }; |
| 3904 | 3881 |
| 3905 | 3882 |
| 3906 class ExternalIntArray: public ExternalArray { | 3883 class ExternalIntArray: public ExternalArray { |
| 3907 public: | 3884 public: |
| 3908 // Setter and getter. | 3885 // Setter and getter. |
| 3909 inline int32_t get_scalar(int index); | 3886 inline int32_t get_scalar(int index); |
| 3910 MUST_USE_RESULT inline MaybeObject* get(int index); | 3887 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3911 inline void set(int index, int32_t value); | 3888 inline void set(int index, int32_t value); |
| 3912 | 3889 |
| 3913 // This accessor applies the correct conversion from Smi, HeapNumber | 3890 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3914 // and undefined. | 3891 // and undefined. |
| 3915 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3892 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3916 | 3893 |
| 3917 // Casting. | 3894 // Casting. |
| 3918 static inline ExternalIntArray* cast(Object* obj); | 3895 static inline ExternalIntArray* cast(Object* obj); |
| 3919 | 3896 |
| 3920 #ifdef OBJECT_PRINT | 3897 #ifdef OBJECT_PRINT |
| 3921 inline void ExternalIntArrayPrint() { | 3898 inline void ExternalIntArrayPrint() { |
| 3922 ExternalIntArrayPrint(stdout); | 3899 ExternalIntArrayPrint(stdout); |
| 3923 } | 3900 } |
| 3924 void ExternalIntArrayPrint(FILE* out); | 3901 void ExternalIntArrayPrint(FILE* out); |
| 3925 #endif | 3902 #endif |
| 3926 #ifdef DEBUG | 3903 DECLARE_VERIFIER(ExternalIntArray) |
| 3927 void ExternalIntArrayVerify(); | |
| 3928 #endif // DEBUG | |
| 3929 | 3904 |
| 3930 private: | 3905 private: |
| 3931 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); | 3906 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); |
| 3932 }; | 3907 }; |
| 3933 | 3908 |
| 3934 | 3909 |
| 3935 class ExternalUnsignedIntArray: public ExternalArray { | 3910 class ExternalUnsignedIntArray: public ExternalArray { |
| 3936 public: | 3911 public: |
| 3937 // Setter and getter. | 3912 // Setter and getter. |
| 3938 inline uint32_t get_scalar(int index); | 3913 inline uint32_t get_scalar(int index); |
| 3939 MUST_USE_RESULT inline MaybeObject* get(int index); | 3914 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3940 inline void set(int index, uint32_t value); | 3915 inline void set(int index, uint32_t value); |
| 3941 | 3916 |
| 3942 // This accessor applies the correct conversion from Smi, HeapNumber | 3917 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3943 // and undefined. | 3918 // and undefined. |
| 3944 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3919 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3945 | 3920 |
| 3946 // Casting. | 3921 // Casting. |
| 3947 static inline ExternalUnsignedIntArray* cast(Object* obj); | 3922 static inline ExternalUnsignedIntArray* cast(Object* obj); |
| 3948 | 3923 |
| 3949 #ifdef OBJECT_PRINT | 3924 #ifdef OBJECT_PRINT |
| 3950 inline void ExternalUnsignedIntArrayPrint() { | 3925 inline void ExternalUnsignedIntArrayPrint() { |
| 3951 ExternalUnsignedIntArrayPrint(stdout); | 3926 ExternalUnsignedIntArrayPrint(stdout); |
| 3952 } | 3927 } |
| 3953 void ExternalUnsignedIntArrayPrint(FILE* out); | 3928 void ExternalUnsignedIntArrayPrint(FILE* out); |
| 3954 #endif | 3929 #endif |
| 3955 #ifdef DEBUG | 3930 DECLARE_VERIFIER(ExternalUnsignedIntArray) |
| 3956 void ExternalUnsignedIntArrayVerify(); | |
| 3957 #endif // DEBUG | |
| 3958 | 3931 |
| 3959 private: | 3932 private: |
| 3960 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); | 3933 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); |
| 3961 }; | 3934 }; |
| 3962 | 3935 |
| 3963 | 3936 |
| 3964 class ExternalFloatArray: public ExternalArray { | 3937 class ExternalFloatArray: public ExternalArray { |
| 3965 public: | 3938 public: |
| 3966 // Setter and getter. | 3939 // Setter and getter. |
| 3967 inline float get_scalar(int index); | 3940 inline float get_scalar(int index); |
| 3968 MUST_USE_RESULT inline MaybeObject* get(int index); | 3941 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3969 inline void set(int index, float value); | 3942 inline void set(int index, float value); |
| 3970 | 3943 |
| 3971 // This accessor applies the correct conversion from Smi, HeapNumber | 3944 // This accessor applies the correct conversion from Smi, HeapNumber |
| 3972 // and undefined. | 3945 // and undefined. |
| 3973 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3946 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 3974 | 3947 |
| 3975 // Casting. | 3948 // Casting. |
| 3976 static inline ExternalFloatArray* cast(Object* obj); | 3949 static inline ExternalFloatArray* cast(Object* obj); |
| 3977 | 3950 |
| 3978 #ifdef OBJECT_PRINT | 3951 #ifdef OBJECT_PRINT |
| 3979 inline void ExternalFloatArrayPrint() { | 3952 inline void ExternalFloatArrayPrint() { |
| 3980 ExternalFloatArrayPrint(stdout); | 3953 ExternalFloatArrayPrint(stdout); |
| 3981 } | 3954 } |
| 3982 void ExternalFloatArrayPrint(FILE* out); | 3955 void ExternalFloatArrayPrint(FILE* out); |
| 3983 #endif | 3956 #endif |
| 3984 #ifdef DEBUG | 3957 DECLARE_VERIFIER(ExternalFloatArray) |
| 3985 void ExternalFloatArrayVerify(); | |
| 3986 #endif // DEBUG | |
| 3987 | 3958 |
| 3988 private: | 3959 private: |
| 3989 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); | 3960 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); |
| 3990 }; | 3961 }; |
| 3991 | 3962 |
| 3992 | 3963 |
| 3993 class ExternalDoubleArray: public ExternalArray { | 3964 class ExternalDoubleArray: public ExternalArray { |
| 3994 public: | 3965 public: |
| 3995 // Setter and getter. | 3966 // Setter and getter. |
| 3996 inline double get_scalar(int index); | 3967 inline double get_scalar(int index); |
| 3997 MUST_USE_RESULT inline MaybeObject* get(int index); | 3968 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 3998 inline void set(int index, double value); | 3969 inline void set(int index, double value); |
| 3999 | 3970 |
| 4000 // This accessor applies the correct conversion from Smi, HeapNumber | 3971 // This accessor applies the correct conversion from Smi, HeapNumber |
| 4001 // and undefined. | 3972 // and undefined. |
| 4002 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3973 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 4003 | 3974 |
| 4004 // Casting. | 3975 // Casting. |
| 4005 static inline ExternalDoubleArray* cast(Object* obj); | 3976 static inline ExternalDoubleArray* cast(Object* obj); |
| 4006 | 3977 |
| 4007 #ifdef OBJECT_PRINT | 3978 #ifdef OBJECT_PRINT |
| 4008 inline void ExternalDoubleArrayPrint() { | 3979 inline void ExternalDoubleArrayPrint() { |
| 4009 ExternalDoubleArrayPrint(stdout); | 3980 ExternalDoubleArrayPrint(stdout); |
| 4010 } | 3981 } |
| 4011 void ExternalDoubleArrayPrint(FILE* out); | 3982 void ExternalDoubleArrayPrint(FILE* out); |
| 4012 #endif // OBJECT_PRINT | 3983 #endif // OBJECT_PRINT |
| 4013 #ifdef DEBUG | 3984 DECLARE_VERIFIER(ExternalDoubleArray) |
| 4014 void ExternalDoubleArrayVerify(); | |
| 4015 #endif // DEBUG | |
| 4016 | 3985 |
| 4017 private: | 3986 private: |
| 4018 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalDoubleArray); | 3987 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalDoubleArray); |
| 4019 }; | 3988 }; |
| 4020 | 3989 |
| 4021 | 3990 |
| 4022 // DeoptimizationInputData is a fixed array used to hold the deoptimization | 3991 // DeoptimizationInputData is a fixed array used to hold the deoptimization |
| 4023 // data for code generated by the Hydrogen/Lithium compiler. It also | 3992 // data for code generated by the Hydrogen/Lithium compiler. It also |
| 4024 // contains information about functions that were inlined. If N different | 3993 // contains information about functions that were inlined. If N different |
| 4025 // functions were inlined then first N elements of the literal array will | 3994 // functions were inlined then first N elements of the literal array will |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4528 inline void CodeIterateBody(ObjectVisitor* v); | 4497 inline void CodeIterateBody(ObjectVisitor* v); |
| 4529 | 4498 |
| 4530 template<typename StaticVisitor> | 4499 template<typename StaticVisitor> |
| 4531 inline void CodeIterateBody(Heap* heap); | 4500 inline void CodeIterateBody(Heap* heap); |
| 4532 #ifdef OBJECT_PRINT | 4501 #ifdef OBJECT_PRINT |
| 4533 inline void CodePrint() { | 4502 inline void CodePrint() { |
| 4534 CodePrint(stdout); | 4503 CodePrint(stdout); |
| 4535 } | 4504 } |
| 4536 void CodePrint(FILE* out); | 4505 void CodePrint(FILE* out); |
| 4537 #endif | 4506 #endif |
| 4538 #ifdef DEBUG | 4507 DECLARE_VERIFIER(Code) |
| 4539 void CodeVerify(); | 4508 |
| 4540 #endif | |
| 4541 void ClearInlineCaches(); | 4509 void ClearInlineCaches(); |
| 4542 void ClearTypeFeedbackCells(Heap* heap); | 4510 void ClearTypeFeedbackCells(Heap* heap); |
| 4543 | 4511 |
| 4544 // Max loop nesting marker used to postpose OSR. We don't take loop | 4512 // Max loop nesting marker used to postpose OSR. We don't take loop |
| 4545 // nesting that is deeper than 5 levels into account. | 4513 // nesting that is deeper than 5 levels into account. |
| 4546 static const int kMaxLoopNestingMarker = 6; | 4514 static const int kMaxLoopNestingMarker = 6; |
| 4547 | 4515 |
| 4548 // Layout description. | 4516 // Layout description. |
| 4549 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 4517 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
| 4550 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 4518 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5090 // |safe_to_add_transitions| is set to false if adding transitions is not | 5058 // |safe_to_add_transitions| is set to false if adding transitions is not |
| 5091 // allowed. | 5059 // allowed. |
| 5092 Map* LookupElementsTransitionMap(ElementsKind elements_kind); | 5060 Map* LookupElementsTransitionMap(ElementsKind elements_kind); |
| 5093 | 5061 |
| 5094 // Returns the transitioned map for this map with the most generic | 5062 // Returns the transitioned map for this map with the most generic |
| 5095 // elements_kind that's found in |candidates|, or null handle if no match is | 5063 // elements_kind that's found in |candidates|, or null handle if no match is |
| 5096 // found at all. | 5064 // found at all. |
| 5097 Handle<Map> FindTransitionedMap(MapHandleList* candidates); | 5065 Handle<Map> FindTransitionedMap(MapHandleList* candidates); |
| 5098 Map* FindTransitionedMap(MapList* candidates); | 5066 Map* FindTransitionedMap(MapList* candidates); |
| 5099 | 5067 |
| 5100 // Zaps the contents of backing data structures in debug mode. Note that the | 5068 // Zaps the contents of backing data structures. Note that the |
| 5101 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects | 5069 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects |
| 5102 // holding weak references when incremental marking is used, because it also | 5070 // holding weak references when incremental marking is used, because it also |
| 5103 // iterates over objects that are otherwise unreachable. | 5071 // iterates over objects that are otherwise unreachable. |
| 5104 #ifdef DEBUG | 5072 // In general we only want to call these functions in release mode when |
| 5073 // heap verification is turned on. |
| 5105 void ZapPrototypeTransitions(); | 5074 void ZapPrototypeTransitions(); |
| 5106 void ZapTransitions(); | 5075 void ZapTransitions(); |
| 5107 #endif | |
| 5108 | 5076 |
| 5109 // Dispatched behavior. | 5077 // Dispatched behavior. |
| 5110 #ifdef OBJECT_PRINT | 5078 #ifdef OBJECT_PRINT |
| 5111 inline void MapPrint() { | 5079 inline void MapPrint() { |
| 5112 MapPrint(stdout); | 5080 MapPrint(stdout); |
| 5113 } | 5081 } |
| 5114 void MapPrint(FILE* out); | 5082 void MapPrint(FILE* out); |
| 5115 #endif | 5083 #endif |
| 5116 #ifdef DEBUG | 5084 DECLARE_VERIFIER(Map) |
| 5117 void MapVerify(); | 5085 |
| 5086 #ifdef VERIFY_HEAP |
| 5118 void SharedMapVerify(); | 5087 void SharedMapVerify(); |
| 5119 #endif | 5088 #endif |
| 5120 | 5089 |
| 5121 inline int visitor_id(); | 5090 inline int visitor_id(); |
| 5122 inline void set_visitor_id(int visitor_id); | 5091 inline void set_visitor_id(int visitor_id); |
| 5123 | 5092 |
| 5124 typedef void (*TraverseCallback)(Map* map, void* data); | 5093 typedef void (*TraverseCallback)(Map* map, void* data); |
| 5125 | 5094 |
| 5126 void TraverseTransitionTree(TraverseCallback callback, void* data); | 5095 void TraverseTransitionTree(TraverseCallback callback, void* data); |
| 5127 | 5096 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5310 // If script source is an external string, check that the underlying | 5279 // If script source is an external string, check that the underlying |
| 5311 // resource is accessible. Otherwise, always return true. | 5280 // resource is accessible. Otherwise, always return true. |
| 5312 inline bool HasValidSource(); | 5281 inline bool HasValidSource(); |
| 5313 | 5282 |
| 5314 #ifdef OBJECT_PRINT | 5283 #ifdef OBJECT_PRINT |
| 5315 inline void ScriptPrint() { | 5284 inline void ScriptPrint() { |
| 5316 ScriptPrint(stdout); | 5285 ScriptPrint(stdout); |
| 5317 } | 5286 } |
| 5318 void ScriptPrint(FILE* out); | 5287 void ScriptPrint(FILE* out); |
| 5319 #endif | 5288 #endif |
| 5320 #ifdef DEBUG | 5289 DECLARE_VERIFIER(Script) |
| 5321 void ScriptVerify(); | |
| 5322 #endif | |
| 5323 | 5290 |
| 5324 static const int kSourceOffset = HeapObject::kHeaderSize; | 5291 static const int kSourceOffset = HeapObject::kHeaderSize; |
| 5325 static const int kNameOffset = kSourceOffset + kPointerSize; | 5292 static const int kNameOffset = kSourceOffset + kPointerSize; |
| 5326 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 5293 static const int kLineOffsetOffset = kNameOffset + kPointerSize; |
| 5327 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 5294 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; |
| 5328 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; | 5295 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; |
| 5329 static const int kContextOffset = kDataOffset + kPointerSize; | 5296 static const int kContextOffset = kDataOffset + kPointerSize; |
| 5330 static const int kWrapperOffset = kContextOffset + kPointerSize; | 5297 static const int kWrapperOffset = kContextOffset + kPointerSize; |
| 5331 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 5298 static const int kTypeOffset = kWrapperOffset + kPointerSize; |
| 5332 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; | 5299 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5792 | 5759 |
| 5793 // Dispatched behavior. | 5760 // Dispatched behavior. |
| 5794 // Set max_length to -1 for unlimited length. | 5761 // Set max_length to -1 for unlimited length. |
| 5795 void SourceCodePrint(StringStream* accumulator, int max_length); | 5762 void SourceCodePrint(StringStream* accumulator, int max_length); |
| 5796 #ifdef OBJECT_PRINT | 5763 #ifdef OBJECT_PRINT |
| 5797 inline void SharedFunctionInfoPrint() { | 5764 inline void SharedFunctionInfoPrint() { |
| 5798 SharedFunctionInfoPrint(stdout); | 5765 SharedFunctionInfoPrint(stdout); |
| 5799 } | 5766 } |
| 5800 void SharedFunctionInfoPrint(FILE* out); | 5767 void SharedFunctionInfoPrint(FILE* out); |
| 5801 #endif | 5768 #endif |
| 5802 #ifdef DEBUG | 5769 DECLARE_VERIFIER(SharedFunctionInfo) |
| 5803 void SharedFunctionInfoVerify(); | |
| 5804 #endif | |
| 5805 | 5770 |
| 5806 void ResetForNewContext(int new_ic_age); | 5771 void ResetForNewContext(int new_ic_age); |
| 5807 | 5772 |
| 5808 // Helper to compile the shared code. Returns true on success, false on | 5773 // Helper to compile the shared code. Returns true on success, false on |
| 5809 // failure (e.g., stack overflow during compilation). This is only used by | 5774 // failure (e.g., stack overflow during compilation). This is only used by |
| 5810 // the debugger, it is not possible to compile without a context otherwise. | 5775 // the debugger, it is not possible to compile without a context otherwise. |
| 5811 static bool CompileLazy(Handle<SharedFunctionInfo> shared, | 5776 static bool CompileLazy(Handle<SharedFunctionInfo> shared, |
| 5812 ClearExceptionFlag flag); | 5777 ClearExceptionFlag flag); |
| 5813 | 5778 |
| 5814 // Casting. | 5779 // Casting. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6028 // Casting. | 5993 // Casting. |
| 6029 static inline JSModule* cast(Object* obj); | 5994 static inline JSModule* cast(Object* obj); |
| 6030 | 5995 |
| 6031 // Dispatched behavior. | 5996 // Dispatched behavior. |
| 6032 #ifdef OBJECT_PRINT | 5997 #ifdef OBJECT_PRINT |
| 6033 inline void JSModulePrint() { | 5998 inline void JSModulePrint() { |
| 6034 JSModulePrint(stdout); | 5999 JSModulePrint(stdout); |
| 6035 } | 6000 } |
| 6036 void JSModulePrint(FILE* out); | 6001 void JSModulePrint(FILE* out); |
| 6037 #endif | 6002 #endif |
| 6038 #ifdef DEBUG | 6003 DECLARE_VERIFIER(JSModule) |
| 6039 void JSModuleVerify(); | |
| 6040 #endif | |
| 6041 | 6004 |
| 6042 // Layout description. | 6005 // Layout description. |
| 6043 static const int kContextOffset = JSObject::kHeaderSize; | 6006 static const int kContextOffset = JSObject::kHeaderSize; |
| 6044 static const int kScopeInfoOffset = kContextOffset + kPointerSize; | 6007 static const int kScopeInfoOffset = kContextOffset + kPointerSize; |
| 6045 static const int kSize = kScopeInfoOffset + kPointerSize; | 6008 static const int kSize = kScopeInfoOffset + kPointerSize; |
| 6046 | 6009 |
| 6047 private: | 6010 private: |
| 6048 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); | 6011 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); |
| 6049 }; | 6012 }; |
| 6050 | 6013 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6191 // through pointers to the first instruction in the code object. | 6154 // through pointers to the first instruction in the code object. |
| 6192 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); | 6155 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); |
| 6193 | 6156 |
| 6194 // Dispatched behavior. | 6157 // Dispatched behavior. |
| 6195 #ifdef OBJECT_PRINT | 6158 #ifdef OBJECT_PRINT |
| 6196 inline void JSFunctionPrint() { | 6159 inline void JSFunctionPrint() { |
| 6197 JSFunctionPrint(stdout); | 6160 JSFunctionPrint(stdout); |
| 6198 } | 6161 } |
| 6199 void JSFunctionPrint(FILE* out); | 6162 void JSFunctionPrint(FILE* out); |
| 6200 #endif | 6163 #endif |
| 6201 #ifdef DEBUG | 6164 DECLARE_VERIFIER(JSFunction) |
| 6202 void JSFunctionVerify(); | |
| 6203 #endif | |
| 6204 | 6165 |
| 6205 // Returns the number of allocated literals. | 6166 // Returns the number of allocated literals. |
| 6206 inline int NumberOfLiterals(); | 6167 inline int NumberOfLiterals(); |
| 6207 | 6168 |
| 6208 // Retrieve the native context from a function's literal array. | 6169 // Retrieve the native context from a function's literal array. |
| 6209 static Context* NativeContextFromLiterals(FixedArray* literals); | 6170 static Context* NativeContextFromLiterals(FixedArray* literals); |
| 6210 | 6171 |
| 6211 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to | 6172 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to |
| 6212 // kSize) is weak and has special handling during garbage collection. | 6173 // kSize) is weak and has special handling during garbage collection. |
| 6213 static const int kCodeEntryOffset = JSObject::kHeaderSize; | 6174 static const int kCodeEntryOffset = JSObject::kHeaderSize; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6252 // Casting. | 6213 // Casting. |
| 6253 static inline JSGlobalProxy* cast(Object* obj); | 6214 static inline JSGlobalProxy* cast(Object* obj); |
| 6254 | 6215 |
| 6255 // Dispatched behavior. | 6216 // Dispatched behavior. |
| 6256 #ifdef OBJECT_PRINT | 6217 #ifdef OBJECT_PRINT |
| 6257 inline void JSGlobalProxyPrint() { | 6218 inline void JSGlobalProxyPrint() { |
| 6258 JSGlobalProxyPrint(stdout); | 6219 JSGlobalProxyPrint(stdout); |
| 6259 } | 6220 } |
| 6260 void JSGlobalProxyPrint(FILE* out); | 6221 void JSGlobalProxyPrint(FILE* out); |
| 6261 #endif | 6222 #endif |
| 6262 #ifdef DEBUG | 6223 DECLARE_VERIFIER(JSGlobalProxy) |
| 6263 void JSGlobalProxyVerify(); | |
| 6264 #endif | |
| 6265 | 6224 |
| 6266 // Layout description. | 6225 // Layout description. |
| 6267 static const int kNativeContextOffset = JSObject::kHeaderSize; | 6226 static const int kNativeContextOffset = JSObject::kHeaderSize; |
| 6268 static const int kSize = kNativeContextOffset + kPointerSize; | 6227 static const int kSize = kNativeContextOffset + kPointerSize; |
| 6269 | 6228 |
| 6270 private: | 6229 private: |
| 6271 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); | 6230 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); |
| 6272 }; | 6231 }; |
| 6273 | 6232 |
| 6274 | 6233 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6332 // Casting. | 6291 // Casting. |
| 6333 static inline JSGlobalObject* cast(Object* obj); | 6292 static inline JSGlobalObject* cast(Object* obj); |
| 6334 | 6293 |
| 6335 // Dispatched behavior. | 6294 // Dispatched behavior. |
| 6336 #ifdef OBJECT_PRINT | 6295 #ifdef OBJECT_PRINT |
| 6337 inline void JSGlobalObjectPrint() { | 6296 inline void JSGlobalObjectPrint() { |
| 6338 JSGlobalObjectPrint(stdout); | 6297 JSGlobalObjectPrint(stdout); |
| 6339 } | 6298 } |
| 6340 void JSGlobalObjectPrint(FILE* out); | 6299 void JSGlobalObjectPrint(FILE* out); |
| 6341 #endif | 6300 #endif |
| 6342 #ifdef DEBUG | 6301 DECLARE_VERIFIER(JSGlobalObject) |
| 6343 void JSGlobalObjectVerify(); | |
| 6344 #endif | |
| 6345 | 6302 |
| 6346 // Layout description. | 6303 // Layout description. |
| 6347 static const int kSize = GlobalObject::kHeaderSize; | 6304 static const int kSize = GlobalObject::kHeaderSize; |
| 6348 | 6305 |
| 6349 private: | 6306 private: |
| 6350 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); | 6307 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); |
| 6351 }; | 6308 }; |
| 6352 | 6309 |
| 6353 | 6310 |
| 6354 // Builtins global object which holds the runtime routines written in | 6311 // Builtins global object which holds the runtime routines written in |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6366 // Casting. | 6323 // Casting. |
| 6367 static inline JSBuiltinsObject* cast(Object* obj); | 6324 static inline JSBuiltinsObject* cast(Object* obj); |
| 6368 | 6325 |
| 6369 // Dispatched behavior. | 6326 // Dispatched behavior. |
| 6370 #ifdef OBJECT_PRINT | 6327 #ifdef OBJECT_PRINT |
| 6371 inline void JSBuiltinsObjectPrint() { | 6328 inline void JSBuiltinsObjectPrint() { |
| 6372 JSBuiltinsObjectPrint(stdout); | 6329 JSBuiltinsObjectPrint(stdout); |
| 6373 } | 6330 } |
| 6374 void JSBuiltinsObjectPrint(FILE* out); | 6331 void JSBuiltinsObjectPrint(FILE* out); |
| 6375 #endif | 6332 #endif |
| 6376 #ifdef DEBUG | 6333 DECLARE_VERIFIER(JSBuiltinsObject) |
| 6377 void JSBuiltinsObjectVerify(); | |
| 6378 #endif | |
| 6379 | 6334 |
| 6380 // Layout description. The size of the builtins object includes | 6335 // Layout description. The size of the builtins object includes |
| 6381 // room for two pointers per runtime routine written in javascript | 6336 // room for two pointers per runtime routine written in javascript |
| 6382 // (function and code object). | 6337 // (function and code object). |
| 6383 static const int kJSBuiltinsCount = Builtins::id_count; | 6338 static const int kJSBuiltinsCount = Builtins::id_count; |
| 6384 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize; | 6339 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize; |
| 6385 static const int kJSBuiltinsCodeOffset = | 6340 static const int kJSBuiltinsCodeOffset = |
| 6386 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize); | 6341 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize); |
| 6387 static const int kSize = | 6342 static const int kSize = |
| 6388 kJSBuiltinsCodeOffset + (kJSBuiltinsCount * kPointerSize); | 6343 kJSBuiltinsCodeOffset + (kJSBuiltinsCount * kPointerSize); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 6409 // Casting. | 6364 // Casting. |
| 6410 static inline JSValue* cast(Object* obj); | 6365 static inline JSValue* cast(Object* obj); |
| 6411 | 6366 |
| 6412 // Dispatched behavior. | 6367 // Dispatched behavior. |
| 6413 #ifdef OBJECT_PRINT | 6368 #ifdef OBJECT_PRINT |
| 6414 inline void JSValuePrint() { | 6369 inline void JSValuePrint() { |
| 6415 JSValuePrint(stdout); | 6370 JSValuePrint(stdout); |
| 6416 } | 6371 } |
| 6417 void JSValuePrint(FILE* out); | 6372 void JSValuePrint(FILE* out); |
| 6418 #endif | 6373 #endif |
| 6419 #ifdef DEBUG | 6374 DECLARE_VERIFIER(JSValue) |
| 6420 void JSValueVerify(); | |
| 6421 #endif | |
| 6422 | 6375 |
| 6423 // Layout description. | 6376 // Layout description. |
| 6424 static const int kValueOffset = JSObject::kHeaderSize; | 6377 static const int kValueOffset = JSObject::kHeaderSize; |
| 6425 static const int kSize = kValueOffset + kPointerSize; | 6378 static const int kSize = kValueOffset + kPointerSize; |
| 6426 | 6379 |
| 6427 private: | 6380 private: |
| 6428 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); | 6381 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); |
| 6429 }; | 6382 }; |
| 6430 | 6383 |
| 6431 | 6384 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6465 void SetValue(Object* value, bool is_value_nan); | 6418 void SetValue(Object* value, bool is_value_nan); |
| 6466 | 6419 |
| 6467 | 6420 |
| 6468 // Dispatched behavior. | 6421 // Dispatched behavior. |
| 6469 #ifdef OBJECT_PRINT | 6422 #ifdef OBJECT_PRINT |
| 6470 inline void JSDatePrint() { | 6423 inline void JSDatePrint() { |
| 6471 JSDatePrint(stdout); | 6424 JSDatePrint(stdout); |
| 6472 } | 6425 } |
| 6473 void JSDatePrint(FILE* out); | 6426 void JSDatePrint(FILE* out); |
| 6474 #endif | 6427 #endif |
| 6475 #ifdef DEBUG | 6428 DECLARE_VERIFIER(JSDate) |
| 6476 void JSDateVerify(); | 6429 |
| 6477 #endif | |
| 6478 // The order is important. It must be kept in sync with date macros | 6430 // The order is important. It must be kept in sync with date macros |
| 6479 // in macros.py. | 6431 // in macros.py. |
| 6480 enum FieldIndex { | 6432 enum FieldIndex { |
| 6481 kDateValue, | 6433 kDateValue, |
| 6482 kYear, | 6434 kYear, |
| 6483 kMonth, | 6435 kMonth, |
| 6484 kDay, | 6436 kDay, |
| 6485 kWeekday, | 6437 kWeekday, |
| 6486 kHour, | 6438 kHour, |
| 6487 kMinute, | 6439 kMinute, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6563 // Casting. | 6515 // Casting. |
| 6564 static inline JSMessageObject* cast(Object* obj); | 6516 static inline JSMessageObject* cast(Object* obj); |
| 6565 | 6517 |
| 6566 // Dispatched behavior. | 6518 // Dispatched behavior. |
| 6567 #ifdef OBJECT_PRINT | 6519 #ifdef OBJECT_PRINT |
| 6568 inline void JSMessageObjectPrint() { | 6520 inline void JSMessageObjectPrint() { |
| 6569 JSMessageObjectPrint(stdout); | 6521 JSMessageObjectPrint(stdout); |
| 6570 } | 6522 } |
| 6571 void JSMessageObjectPrint(FILE* out); | 6523 void JSMessageObjectPrint(FILE* out); |
| 6572 #endif | 6524 #endif |
| 6573 #ifdef DEBUG | 6525 DECLARE_VERIFIER(JSMessageObject) |
| 6574 void JSMessageObjectVerify(); | |
| 6575 #endif | |
| 6576 | 6526 |
| 6577 // Layout description. | 6527 // Layout description. |
| 6578 static const int kTypeOffset = JSObject::kHeaderSize; | 6528 static const int kTypeOffset = JSObject::kHeaderSize; |
| 6579 static const int kArgumentsOffset = kTypeOffset + kPointerSize; | 6529 static const int kArgumentsOffset = kTypeOffset + kPointerSize; |
| 6580 static const int kScriptOffset = kArgumentsOffset + kPointerSize; | 6530 static const int kScriptOffset = kArgumentsOffset + kPointerSize; |
| 6581 static const int kStackTraceOffset = kScriptOffset + kPointerSize; | 6531 static const int kStackTraceOffset = kScriptOffset + kPointerSize; |
| 6582 static const int kStackFramesOffset = kStackTraceOffset + kPointerSize; | 6532 static const int kStackFramesOffset = kStackTraceOffset + kPointerSize; |
| 6583 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; | 6533 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; |
| 6584 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; | 6534 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; |
| 6585 static const int kSize = kEndPositionOffset + kPointerSize; | 6535 static const int kSize = kEndPositionOffset + kPointerSize; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6654 if (is_ascii) { | 6604 if (is_ascii) { |
| 6655 return kIrregexpASCIICodeSavedIndex; | 6605 return kIrregexpASCIICodeSavedIndex; |
| 6656 } else { | 6606 } else { |
| 6657 return kIrregexpUC16CodeSavedIndex; | 6607 return kIrregexpUC16CodeSavedIndex; |
| 6658 } | 6608 } |
| 6659 } | 6609 } |
| 6660 | 6610 |
| 6661 static inline JSRegExp* cast(Object* obj); | 6611 static inline JSRegExp* cast(Object* obj); |
| 6662 | 6612 |
| 6663 // Dispatched behavior. | 6613 // Dispatched behavior. |
| 6664 #ifdef DEBUG | 6614 DECLARE_VERIFIER(JSRegExp) |
| 6665 void JSRegExpVerify(); | |
| 6666 #endif | |
| 6667 | 6615 |
| 6668 static const int kDataOffset = JSObject::kHeaderSize; | 6616 static const int kDataOffset = JSObject::kHeaderSize; |
| 6669 static const int kSize = kDataOffset + kPointerSize; | 6617 static const int kSize = kDataOffset + kPointerSize; |
| 6670 | 6618 |
| 6671 // Indices in the data array. | 6619 // Indices in the data array. |
| 6672 static const int kTagIndex = 0; | 6620 static const int kTagIndex = 0; |
| 6673 static const int kSourceIndex = kTagIndex + 1; | 6621 static const int kSourceIndex = kTagIndex + 1; |
| 6674 static const int kFlagsIndex = kSourceIndex + 1; | 6622 static const int kFlagsIndex = kSourceIndex + 1; |
| 6675 static const int kDataIndex = kFlagsIndex + 1; | 6623 static const int kDataIndex = kFlagsIndex + 1; |
| 6676 // The data fields are used in different ways depending on the | 6624 // The data fields are used in different ways depending on the |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6812 void RemoveByIndex(Object* name, Code* code, int index); | 6760 void RemoveByIndex(Object* name, Code* code, int index); |
| 6813 | 6761 |
| 6814 static inline CodeCache* cast(Object* obj); | 6762 static inline CodeCache* cast(Object* obj); |
| 6815 | 6763 |
| 6816 #ifdef OBJECT_PRINT | 6764 #ifdef OBJECT_PRINT |
| 6817 inline void CodeCachePrint() { | 6765 inline void CodeCachePrint() { |
| 6818 CodeCachePrint(stdout); | 6766 CodeCachePrint(stdout); |
| 6819 } | 6767 } |
| 6820 void CodeCachePrint(FILE* out); | 6768 void CodeCachePrint(FILE* out); |
| 6821 #endif | 6769 #endif |
| 6822 #ifdef DEBUG | 6770 DECLARE_VERIFIER(CodeCache) |
| 6823 void CodeCacheVerify(); | |
| 6824 #endif | |
| 6825 | 6771 |
| 6826 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; | 6772 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; |
| 6827 static const int kNormalTypeCacheOffset = | 6773 static const int kNormalTypeCacheOffset = |
| 6828 kDefaultCacheOffset + kPointerSize; | 6774 kDefaultCacheOffset + kPointerSize; |
| 6829 static const int kSize = kNormalTypeCacheOffset + kPointerSize; | 6775 static const int kSize = kNormalTypeCacheOffset + kPointerSize; |
| 6830 | 6776 |
| 6831 private: | 6777 private: |
| 6832 MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code); | 6778 MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code); |
| 6833 MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(String* name, Code* code); | 6779 MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(String* name, Code* code); |
| 6834 Object* LookupDefaultCache(String* name, Code::Flags flags); | 6780 Object* LookupDefaultCache(String* name, Code::Flags flags); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6903 Handle<Object> Lookup(MapHandleList* maps, Code::Flags flags); | 6849 Handle<Object> Lookup(MapHandleList* maps, Code::Flags flags); |
| 6904 | 6850 |
| 6905 static inline PolymorphicCodeCache* cast(Object* obj); | 6851 static inline PolymorphicCodeCache* cast(Object* obj); |
| 6906 | 6852 |
| 6907 #ifdef OBJECT_PRINT | 6853 #ifdef OBJECT_PRINT |
| 6908 inline void PolymorphicCodeCachePrint() { | 6854 inline void PolymorphicCodeCachePrint() { |
| 6909 PolymorphicCodeCachePrint(stdout); | 6855 PolymorphicCodeCachePrint(stdout); |
| 6910 } | 6856 } |
| 6911 void PolymorphicCodeCachePrint(FILE* out); | 6857 void PolymorphicCodeCachePrint(FILE* out); |
| 6912 #endif | 6858 #endif |
| 6913 #ifdef DEBUG | 6859 DECLARE_VERIFIER(PolymorphicCodeCache) |
| 6914 void PolymorphicCodeCacheVerify(); | |
| 6915 #endif | |
| 6916 | 6860 |
| 6917 static const int kCacheOffset = HeapObject::kHeaderSize; | 6861 static const int kCacheOffset = HeapObject::kHeaderSize; |
| 6918 static const int kSize = kCacheOffset + kPointerSize; | 6862 static const int kSize = kCacheOffset + kPointerSize; |
| 6919 | 6863 |
| 6920 private: | 6864 private: |
| 6921 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCache); | 6865 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCache); |
| 6922 }; | 6866 }; |
| 6923 | 6867 |
| 6924 | 6868 |
| 6925 class PolymorphicCodeCacheHashTable | 6869 class PolymorphicCodeCacheHashTable |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6958 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) | 6902 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) |
| 6959 | 6903 |
| 6960 static inline TypeFeedbackInfo* cast(Object* obj); | 6904 static inline TypeFeedbackInfo* cast(Object* obj); |
| 6961 | 6905 |
| 6962 #ifdef OBJECT_PRINT | 6906 #ifdef OBJECT_PRINT |
| 6963 inline void TypeFeedbackInfoPrint() { | 6907 inline void TypeFeedbackInfoPrint() { |
| 6964 TypeFeedbackInfoPrint(stdout); | 6908 TypeFeedbackInfoPrint(stdout); |
| 6965 } | 6909 } |
| 6966 void TypeFeedbackInfoPrint(FILE* out); | 6910 void TypeFeedbackInfoPrint(FILE* out); |
| 6967 #endif | 6911 #endif |
| 6968 #ifdef DEBUG | 6912 DECLARE_VERIFIER(TypeFeedbackInfo) |
| 6969 void TypeFeedbackInfoVerify(); | |
| 6970 #endif | |
| 6971 | 6913 |
| 6972 static const int kStorage1Offset = HeapObject::kHeaderSize; | 6914 static const int kStorage1Offset = HeapObject::kHeaderSize; |
| 6973 static const int kStorage2Offset = kStorage1Offset + kPointerSize; | 6915 static const int kStorage2Offset = kStorage1Offset + kPointerSize; |
| 6974 static const int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize; | 6916 static const int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize; |
| 6975 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; | 6917 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; |
| 6976 | 6918 |
| 6977 private: | 6919 private: |
| 6978 static const int kTypeChangeChecksumBits = 7; | 6920 static const int kTypeChangeChecksumBits = 7; |
| 6979 | 6921 |
| 6980 class ICTotalCountField: public BitField<int, 0, | 6922 class ICTotalCountField: public BitField<int, 0, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 7006 inline void set_aliased_context_slot(int count); | 6948 inline void set_aliased_context_slot(int count); |
| 7007 | 6949 |
| 7008 static inline AliasedArgumentsEntry* cast(Object* obj); | 6950 static inline AliasedArgumentsEntry* cast(Object* obj); |
| 7009 | 6951 |
| 7010 #ifdef OBJECT_PRINT | 6952 #ifdef OBJECT_PRINT |
| 7011 inline void AliasedArgumentsEntryPrint() { | 6953 inline void AliasedArgumentsEntryPrint() { |
| 7012 AliasedArgumentsEntryPrint(stdout); | 6954 AliasedArgumentsEntryPrint(stdout); |
| 7013 } | 6955 } |
| 7014 void AliasedArgumentsEntryPrint(FILE* out); | 6956 void AliasedArgumentsEntryPrint(FILE* out); |
| 7015 #endif | 6957 #endif |
| 7016 #ifdef DEBUG | 6958 DECLARE_VERIFIER(AliasedArgumentsEntry) |
| 7017 void AliasedArgumentsEntryVerify(); | |
| 7018 #endif | |
| 7019 | 6959 |
| 7020 static const int kAliasedContextSlot = HeapObject::kHeaderSize; | 6960 static const int kAliasedContextSlot = HeapObject::kHeaderSize; |
| 7021 static const int kSize = kAliasedContextSlot + kPointerSize; | 6961 static const int kSize = kAliasedContextSlot + kPointerSize; |
| 7022 | 6962 |
| 7023 private: | 6963 private: |
| 7024 DISALLOW_IMPLICIT_CONSTRUCTORS(AliasedArgumentsEntry); | 6964 DISALLOW_IMPLICIT_CONSTRUCTORS(AliasedArgumentsEntry); |
| 7025 }; | 6965 }; |
| 7026 | 6966 |
| 7027 | 6967 |
| 7028 enum AllowNullsFlag {ALLOW_NULLS, DISALLOW_NULLS}; | 6968 enum AllowNullsFlag {ALLOW_NULLS, DISALLOW_NULLS}; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7355 // Dispatched behavior. | 7295 // Dispatched behavior. |
| 7356 void StringShortPrint(StringStream* accumulator); | 7296 void StringShortPrint(StringStream* accumulator); |
| 7357 #ifdef OBJECT_PRINT | 7297 #ifdef OBJECT_PRINT |
| 7358 inline void StringPrint() { | 7298 inline void StringPrint() { |
| 7359 StringPrint(stdout); | 7299 StringPrint(stdout); |
| 7360 } | 7300 } |
| 7361 void StringPrint(FILE* out); | 7301 void StringPrint(FILE* out); |
| 7362 | 7302 |
| 7363 char* ToAsciiArray(); | 7303 char* ToAsciiArray(); |
| 7364 #endif | 7304 #endif |
| 7365 #ifdef DEBUG | 7305 DECLARE_VERIFIER(String) |
| 7366 void StringVerify(); | 7306 |
| 7367 #endif | |
| 7368 inline bool IsFlat(); | 7307 inline bool IsFlat(); |
| 7369 | 7308 |
| 7370 // Layout description. | 7309 // Layout description. |
| 7371 static const int kLengthOffset = HeapObject::kHeaderSize; | 7310 static const int kLengthOffset = HeapObject::kHeaderSize; |
| 7372 static const int kHashFieldOffset = kLengthOffset + kPointerSize; | 7311 static const int kHashFieldOffset = kLengthOffset + kPointerSize; |
| 7373 static const int kSize = kHashFieldOffset + kPointerSize; | 7312 static const int kSize = kHashFieldOffset + kPointerSize; |
| 7374 | 7313 |
| 7375 // Maximum number of characters to consider when trying to convert a string | 7314 // Maximum number of characters to consider when trying to convert a string |
| 7376 // value into an array index. | 7315 // value into an array index. |
| 7377 static const int kMaxArrayIndexSize = 10; | 7316 static const int kMaxArrayIndexSize = 10; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7594 static const int kMaxLength = (kMaxSize - kHeaderSize); | 7533 static const int kMaxLength = (kMaxSize - kHeaderSize); |
| 7595 | 7534 |
| 7596 // Support for StringInputBuffer. | 7535 // Support for StringInputBuffer. |
| 7597 inline void SeqAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 7536 inline void SeqAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
| 7598 unsigned* offset, | 7537 unsigned* offset, |
| 7599 unsigned chars); | 7538 unsigned chars); |
| 7600 inline const unibrow::byte* SeqAsciiStringReadBlock(unsigned* remaining, | 7539 inline const unibrow::byte* SeqAsciiStringReadBlock(unsigned* remaining, |
| 7601 unsigned* offset, | 7540 unsigned* offset, |
| 7602 unsigned chars); | 7541 unsigned chars); |
| 7603 | 7542 |
| 7604 #ifdef DEBUG | 7543 DECLARE_VERIFIER(SeqAsciiString) |
| 7605 void SeqAsciiStringVerify(); | |
| 7606 #endif | |
| 7607 | 7544 |
| 7608 private: | 7545 private: |
| 7609 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqAsciiString); | 7546 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqAsciiString); |
| 7610 }; | 7547 }; |
| 7611 | 7548 |
| 7612 | 7549 |
| 7613 // The TwoByteString class captures sequential unicode string objects. | 7550 // The TwoByteString class captures sequential unicode string objects. |
| 7614 // Each character in the TwoByteString is a two-byte uint16_t. | 7551 // Each character in the TwoByteString is a two-byte uint16_t. |
| 7615 class SeqTwoByteString: public SeqString { | 7552 class SeqTwoByteString: public SeqString { |
| 7616 public: | 7553 public: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7701 inline void ConsStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 7638 inline void ConsStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
| 7702 unsigned* offset_ptr, | 7639 unsigned* offset_ptr, |
| 7703 unsigned chars); | 7640 unsigned chars); |
| 7704 | 7641 |
| 7705 // Minimum length for a cons string. | 7642 // Minimum length for a cons string. |
| 7706 static const int kMinLength = 13; | 7643 static const int kMinLength = 13; |
| 7707 | 7644 |
| 7708 typedef FixedBodyDescriptor<kFirstOffset, kSecondOffset + kPointerSize, kSize> | 7645 typedef FixedBodyDescriptor<kFirstOffset, kSecondOffset + kPointerSize, kSize> |
| 7709 BodyDescriptor; | 7646 BodyDescriptor; |
| 7710 | 7647 |
| 7711 #ifdef DEBUG | 7648 DECLARE_VERIFIER(ConsString) |
| 7712 void ConsStringVerify(); | |
| 7713 #endif | |
| 7714 | 7649 |
| 7715 private: | 7650 private: |
| 7716 DISALLOW_IMPLICIT_CONSTRUCTORS(ConsString); | 7651 DISALLOW_IMPLICIT_CONSTRUCTORS(ConsString); |
| 7717 }; | 7652 }; |
| 7718 | 7653 |
| 7719 | 7654 |
| 7720 // The Sliced String class describes strings that are substrings of another | 7655 // The Sliced String class describes strings that are substrings of another |
| 7721 // sequential string. The motivation is to save time and memory when creating | 7656 // sequential string. The motivation is to save time and memory when creating |
| 7722 // a substring. A Sliced String is described as a pointer to the parent, | 7657 // a substring. A Sliced String is described as a pointer to the parent, |
| 7723 // the offset from the start of the parent string and the length. Using | 7658 // the offset from the start of the parent string and the length. Using |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7755 inline void SlicedStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 7690 inline void SlicedStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
| 7756 unsigned* offset_ptr, | 7691 unsigned* offset_ptr, |
| 7757 unsigned chars); | 7692 unsigned chars); |
| 7758 // Minimum length for a sliced string. | 7693 // Minimum length for a sliced string. |
| 7759 static const int kMinLength = 13; | 7694 static const int kMinLength = 13; |
| 7760 | 7695 |
| 7761 typedef FixedBodyDescriptor<kParentOffset, | 7696 typedef FixedBodyDescriptor<kParentOffset, |
| 7762 kOffsetOffset + kPointerSize, kSize> | 7697 kOffsetOffset + kPointerSize, kSize> |
| 7763 BodyDescriptor; | 7698 BodyDescriptor; |
| 7764 | 7699 |
| 7765 #ifdef DEBUG | 7700 DECLARE_VERIFIER(SlicedString) |
| 7766 void SlicedStringVerify(); | |
| 7767 #endif | |
| 7768 | 7701 |
| 7769 private: | 7702 private: |
| 7770 DISALLOW_IMPLICIT_CONSTRUCTORS(SlicedString); | 7703 DISALLOW_IMPLICIT_CONSTRUCTORS(SlicedString); |
| 7771 }; | 7704 }; |
| 7772 | 7705 |
| 7773 | 7706 |
| 7774 // The ExternalString class describes string values that are backed by | 7707 // The ExternalString class describes string values that are backed by |
| 7775 // a string resource that lies outside the V8 heap. ExternalStrings | 7708 // a string resource that lies outside the V8 heap. ExternalStrings |
| 7776 // consist of the length field common to all strings, a pointer to the | 7709 // consist of the length field common to all strings, a pointer to the |
| 7777 // external resource. It is important to ensure (externally) that the | 7710 // external resource. It is important to ensure (externally) that the |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7984 // [to_number]: Cached to_number computed at startup. | 7917 // [to_number]: Cached to_number computed at startup. |
| 7985 DECL_ACCESSORS(to_number, Object) | 7918 DECL_ACCESSORS(to_number, Object) |
| 7986 | 7919 |
| 7987 inline byte kind(); | 7920 inline byte kind(); |
| 7988 inline void set_kind(byte kind); | 7921 inline void set_kind(byte kind); |
| 7989 | 7922 |
| 7990 // Casting. | 7923 // Casting. |
| 7991 static inline Oddball* cast(Object* obj); | 7924 static inline Oddball* cast(Object* obj); |
| 7992 | 7925 |
| 7993 // Dispatched behavior. | 7926 // Dispatched behavior. |
| 7994 #ifdef DEBUG | 7927 DECLARE_VERIFIER(Oddball) |
| 7995 void OddballVerify(); | |
| 7996 #endif | |
| 7997 | 7928 |
| 7998 // Initialize the fields. | 7929 // Initialize the fields. |
| 7999 MUST_USE_RESULT MaybeObject* Initialize(const char* to_string, | 7930 MUST_USE_RESULT MaybeObject* Initialize(const char* to_string, |
| 8000 Object* to_number, | 7931 Object* to_number, |
| 8001 byte kind); | 7932 byte kind); |
| 8002 | 7933 |
| 8003 // Layout description. | 7934 // Layout description. |
| 8004 static const int kToStringOffset = HeapObject::kHeaderSize; | 7935 static const int kToStringOffset = HeapObject::kHeaderSize; |
| 8005 static const int kToNumberOffset = kToStringOffset + kPointerSize; | 7936 static const int kToNumberOffset = kToStringOffset + kPointerSize; |
| 8006 static const int kKindOffset = kToNumberOffset + kPointerSize; | 7937 static const int kKindOffset = kToNumberOffset + kPointerSize; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 8037 static inline JSGlobalPropertyCell* cast(Object* obj); | 7968 static inline JSGlobalPropertyCell* cast(Object* obj); |
| 8038 | 7969 |
| 8039 static inline JSGlobalPropertyCell* FromValueAddress(Address value) { | 7970 static inline JSGlobalPropertyCell* FromValueAddress(Address value) { |
| 8040 return cast(FromAddress(value - kValueOffset)); | 7971 return cast(FromAddress(value - kValueOffset)); |
| 8041 } | 7972 } |
| 8042 | 7973 |
| 8043 inline Address ValueAddress() { | 7974 inline Address ValueAddress() { |
| 8044 return address() + kValueOffset; | 7975 return address() + kValueOffset; |
| 8045 } | 7976 } |
| 8046 | 7977 |
| 8047 #ifdef DEBUG | 7978 DECLARE_VERIFIER(JSGlobalPropertyCell) |
| 8048 void JSGlobalPropertyCellVerify(); | 7979 |
| 8049 #endif | |
| 8050 #ifdef OBJECT_PRINT | 7980 #ifdef OBJECT_PRINT |
| 8051 inline void JSGlobalPropertyCellPrint() { | 7981 inline void JSGlobalPropertyCellPrint() { |
| 8052 JSGlobalPropertyCellPrint(stdout); | 7982 JSGlobalPropertyCellPrint(stdout); |
| 8053 } | 7983 } |
| 8054 void JSGlobalPropertyCellPrint(FILE* out); | 7984 void JSGlobalPropertyCellPrint(FILE* out); |
| 8055 #endif | 7985 #endif |
| 8056 | 7986 |
| 8057 // Layout description. | 7987 // Layout description. |
| 8058 static const int kValueOffset = HeapObject::kHeaderSize; | 7988 static const int kValueOffset = HeapObject::kHeaderSize; |
| 8059 static const int kSize = kValueOffset + kPointerSize; | 7989 static const int kSize = kValueOffset + kPointerSize; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8142 int argc, | 8072 int argc, |
| 8143 Handle<Object> args[]); | 8073 Handle<Object> args[]); |
| 8144 | 8074 |
| 8145 // Dispatched behavior. | 8075 // Dispatched behavior. |
| 8146 #ifdef OBJECT_PRINT | 8076 #ifdef OBJECT_PRINT |
| 8147 inline void JSProxyPrint() { | 8077 inline void JSProxyPrint() { |
| 8148 JSProxyPrint(stdout); | 8078 JSProxyPrint(stdout); |
| 8149 } | 8079 } |
| 8150 void JSProxyPrint(FILE* out); | 8080 void JSProxyPrint(FILE* out); |
| 8151 #endif | 8081 #endif |
| 8152 #ifdef DEBUG | 8082 DECLARE_VERIFIER(JSProxy) |
| 8153 void JSProxyVerify(); | |
| 8154 #endif | |
| 8155 | 8083 |
| 8156 // Layout description. We add padding so that a proxy has the same | 8084 // Layout description. We add padding so that a proxy has the same |
| 8157 // size as a virgin JSObject. This is essential for becoming a JSObject | 8085 // size as a virgin JSObject. This is essential for becoming a JSObject |
| 8158 // upon freeze. | 8086 // upon freeze. |
| 8159 static const int kHandlerOffset = HeapObject::kHeaderSize; | 8087 static const int kHandlerOffset = HeapObject::kHeaderSize; |
| 8160 static const int kHashOffset = kHandlerOffset + kPointerSize; | 8088 static const int kHashOffset = kHandlerOffset + kPointerSize; |
| 8161 static const int kPaddingOffset = kHashOffset + kPointerSize; | 8089 static const int kPaddingOffset = kHashOffset + kPointerSize; |
| 8162 static const int kSize = JSObject::kHeaderSize; | 8090 static const int kSize = JSObject::kHeaderSize; |
| 8163 static const int kHeaderSize = kPaddingOffset; | 8091 static const int kHeaderSize = kPaddingOffset; |
| 8164 static const int kPaddingSize = kSize - kPaddingOffset; | 8092 static const int kPaddingSize = kSize - kPaddingOffset; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 8185 // Casting. | 8113 // Casting. |
| 8186 static inline JSFunctionProxy* cast(Object* obj); | 8114 static inline JSFunctionProxy* cast(Object* obj); |
| 8187 | 8115 |
| 8188 // Dispatched behavior. | 8116 // Dispatched behavior. |
| 8189 #ifdef OBJECT_PRINT | 8117 #ifdef OBJECT_PRINT |
| 8190 inline void JSFunctionProxyPrint() { | 8118 inline void JSFunctionProxyPrint() { |
| 8191 JSFunctionProxyPrint(stdout); | 8119 JSFunctionProxyPrint(stdout); |
| 8192 } | 8120 } |
| 8193 void JSFunctionProxyPrint(FILE* out); | 8121 void JSFunctionProxyPrint(FILE* out); |
| 8194 #endif | 8122 #endif |
| 8195 #ifdef DEBUG | 8123 DECLARE_VERIFIER(JSFunctionProxy) |
| 8196 void JSFunctionProxyVerify(); | |
| 8197 #endif | |
| 8198 | 8124 |
| 8199 // Layout description. | 8125 // Layout description. |
| 8200 static const int kCallTrapOffset = JSProxy::kPaddingOffset; | 8126 static const int kCallTrapOffset = JSProxy::kPaddingOffset; |
| 8201 static const int kConstructTrapOffset = kCallTrapOffset + kPointerSize; | 8127 static const int kConstructTrapOffset = kCallTrapOffset + kPointerSize; |
| 8202 static const int kPaddingOffset = kConstructTrapOffset + kPointerSize; | 8128 static const int kPaddingOffset = kConstructTrapOffset + kPointerSize; |
| 8203 static const int kSize = JSFunction::kSize; | 8129 static const int kSize = JSFunction::kSize; |
| 8204 static const int kPaddingSize = kSize - kPaddingOffset; | 8130 static const int kPaddingSize = kSize - kPaddingOffset; |
| 8205 | 8131 |
| 8206 STATIC_CHECK(kPaddingSize >= 0); | 8132 STATIC_CHECK(kPaddingSize >= 0); |
| 8207 | 8133 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 8222 | 8148 |
| 8223 // Casting. | 8149 // Casting. |
| 8224 static inline JSSet* cast(Object* obj); | 8150 static inline JSSet* cast(Object* obj); |
| 8225 | 8151 |
| 8226 #ifdef OBJECT_PRINT | 8152 #ifdef OBJECT_PRINT |
| 8227 inline void JSSetPrint() { | 8153 inline void JSSetPrint() { |
| 8228 JSSetPrint(stdout); | 8154 JSSetPrint(stdout); |
| 8229 } | 8155 } |
| 8230 void JSSetPrint(FILE* out); | 8156 void JSSetPrint(FILE* out); |
| 8231 #endif | 8157 #endif |
| 8232 #ifdef DEBUG | 8158 DECLARE_VERIFIER(JSSet) |
| 8233 void JSSetVerify(); | |
| 8234 #endif | |
| 8235 | 8159 |
| 8236 static const int kTableOffset = JSObject::kHeaderSize; | 8160 static const int kTableOffset = JSObject::kHeaderSize; |
| 8237 static const int kSize = kTableOffset + kPointerSize; | 8161 static const int kSize = kTableOffset + kPointerSize; |
| 8238 | 8162 |
| 8239 private: | 8163 private: |
| 8240 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet); | 8164 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet); |
| 8241 }; | 8165 }; |
| 8242 | 8166 |
| 8243 | 8167 |
| 8244 // The JSMap describes EcmaScript Harmony maps | 8168 // The JSMap describes EcmaScript Harmony maps |
| 8245 class JSMap: public JSObject { | 8169 class JSMap: public JSObject { |
| 8246 public: | 8170 public: |
| 8247 // [table]: the backing hash table mapping keys to values. | 8171 // [table]: the backing hash table mapping keys to values. |
| 8248 DECL_ACCESSORS(table, Object) | 8172 DECL_ACCESSORS(table, Object) |
| 8249 | 8173 |
| 8250 // Casting. | 8174 // Casting. |
| 8251 static inline JSMap* cast(Object* obj); | 8175 static inline JSMap* cast(Object* obj); |
| 8252 | 8176 |
| 8253 #ifdef OBJECT_PRINT | 8177 #ifdef OBJECT_PRINT |
| 8254 inline void JSMapPrint() { | 8178 inline void JSMapPrint() { |
| 8255 JSMapPrint(stdout); | 8179 JSMapPrint(stdout); |
| 8256 } | 8180 } |
| 8257 void JSMapPrint(FILE* out); | 8181 void JSMapPrint(FILE* out); |
| 8258 #endif | 8182 #endif |
| 8259 #ifdef DEBUG | 8183 DECLARE_VERIFIER(JSMap) |
| 8260 void JSMapVerify(); | |
| 8261 #endif | |
| 8262 | 8184 |
| 8263 static const int kTableOffset = JSObject::kHeaderSize; | 8185 static const int kTableOffset = JSObject::kHeaderSize; |
| 8264 static const int kSize = kTableOffset + kPointerSize; | 8186 static const int kSize = kTableOffset + kPointerSize; |
| 8265 | 8187 |
| 8266 private: | 8188 private: |
| 8267 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 8189 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); |
| 8268 }; | 8190 }; |
| 8269 | 8191 |
| 8270 | 8192 |
| 8271 // The JSWeakMap describes EcmaScript Harmony weak maps | 8193 // The JSWeakMap describes EcmaScript Harmony weak maps |
| 8272 class JSWeakMap: public JSObject { | 8194 class JSWeakMap: public JSObject { |
| 8273 public: | 8195 public: |
| 8274 // [table]: the backing hash table mapping keys to values. | 8196 // [table]: the backing hash table mapping keys to values. |
| 8275 DECL_ACCESSORS(table, Object) | 8197 DECL_ACCESSORS(table, Object) |
| 8276 | 8198 |
| 8277 // [next]: linked list of encountered weak maps during GC. | 8199 // [next]: linked list of encountered weak maps during GC. |
| 8278 DECL_ACCESSORS(next, Object) | 8200 DECL_ACCESSORS(next, Object) |
| 8279 | 8201 |
| 8280 // Casting. | 8202 // Casting. |
| 8281 static inline JSWeakMap* cast(Object* obj); | 8203 static inline JSWeakMap* cast(Object* obj); |
| 8282 | 8204 |
| 8283 #ifdef OBJECT_PRINT | 8205 #ifdef OBJECT_PRINT |
| 8284 inline void JSWeakMapPrint() { | 8206 inline void JSWeakMapPrint() { |
| 8285 JSWeakMapPrint(stdout); | 8207 JSWeakMapPrint(stdout); |
| 8286 } | 8208 } |
| 8287 void JSWeakMapPrint(FILE* out); | 8209 void JSWeakMapPrint(FILE* out); |
| 8288 #endif | 8210 #endif |
| 8289 #ifdef DEBUG | 8211 DECLARE_VERIFIER(JSWeakMap) |
| 8290 void JSWeakMapVerify(); | |
| 8291 #endif | |
| 8292 | 8212 |
| 8293 static const int kTableOffset = JSObject::kHeaderSize; | 8213 static const int kTableOffset = JSObject::kHeaderSize; |
| 8294 static const int kNextOffset = kTableOffset + kPointerSize; | 8214 static const int kNextOffset = kTableOffset + kPointerSize; |
| 8295 static const int kSize = kNextOffset + kPointerSize; | 8215 static const int kSize = kNextOffset + kPointerSize; |
| 8296 | 8216 |
| 8297 private: | 8217 private: |
| 8298 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); | 8218 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); |
| 8299 }; | 8219 }; |
| 8300 | 8220 |
| 8301 | 8221 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 8316 | 8236 |
| 8317 template<typename StaticVisitor> | 8237 template<typename StaticVisitor> |
| 8318 inline void ForeignIterateBody(); | 8238 inline void ForeignIterateBody(); |
| 8319 | 8239 |
| 8320 #ifdef OBJECT_PRINT | 8240 #ifdef OBJECT_PRINT |
| 8321 inline void ForeignPrint() { | 8241 inline void ForeignPrint() { |
| 8322 ForeignPrint(stdout); | 8242 ForeignPrint(stdout); |
| 8323 } | 8243 } |
| 8324 void ForeignPrint(FILE* out); | 8244 void ForeignPrint(FILE* out); |
| 8325 #endif | 8245 #endif |
| 8326 #ifdef DEBUG | 8246 DECLARE_VERIFIER(Foreign) |
| 8327 void ForeignVerify(); | |
| 8328 #endif | |
| 8329 | 8247 |
| 8330 // Layout description. | 8248 // Layout description. |
| 8331 | 8249 |
| 8332 static const int kForeignAddressOffset = HeapObject::kHeaderSize; | 8250 static const int kForeignAddressOffset = HeapObject::kHeaderSize; |
| 8333 static const int kSize = kForeignAddressOffset + kPointerSize; | 8251 static const int kSize = kForeignAddressOffset + kPointerSize; |
| 8334 | 8252 |
| 8335 STATIC_CHECK(kForeignAddressOffset == Internals::kForeignAddressOffset); | 8253 STATIC_CHECK(kForeignAddressOffset == Internals::kForeignAddressOffset); |
| 8336 | 8254 |
| 8337 private: | 8255 private: |
| 8338 DISALLOW_IMPLICIT_CONSTRUCTORS(Foreign); | 8256 DISALLOW_IMPLICIT_CONSTRUCTORS(Foreign); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8375 // least the stated size. | 8293 // least the stated size. |
| 8376 inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 8294 inline void EnsureSize(int minimum_size_of_backing_fixed_array); |
| 8377 | 8295 |
| 8378 // Dispatched behavior. | 8296 // Dispatched behavior. |
| 8379 #ifdef OBJECT_PRINT | 8297 #ifdef OBJECT_PRINT |
| 8380 inline void JSArrayPrint() { | 8298 inline void JSArrayPrint() { |
| 8381 JSArrayPrint(stdout); | 8299 JSArrayPrint(stdout); |
| 8382 } | 8300 } |
| 8383 void JSArrayPrint(FILE* out); | 8301 void JSArrayPrint(FILE* out); |
| 8384 #endif | 8302 #endif |
| 8385 #ifdef DEBUG | 8303 DECLARE_VERIFIER(JSArray) |
| 8386 void JSArrayVerify(); | |
| 8387 #endif | |
| 8388 | 8304 |
| 8389 // Number of element slots to pre-allocate for an empty array. | 8305 // Number of element slots to pre-allocate for an empty array. |
| 8390 static const int kPreallocatedArrayElements = 4; | 8306 static const int kPreallocatedArrayElements = 4; |
| 8391 | 8307 |
| 8392 // Layout description. | 8308 // Layout description. |
| 8393 static const int kLengthOffset = JSObject::kHeaderSize; | 8309 static const int kLengthOffset = JSObject::kHeaderSize; |
| 8394 static const int kSize = kLengthOffset + kPointerSize; | 8310 static const int kSize = kLengthOffset + kPointerSize; |
| 8395 | 8311 |
| 8396 private: | 8312 private: |
| 8397 // Expand the fixed array backing of a fast-case JSArray to at least | 8313 // Expand the fixed array backing of a fast-case JSArray to at least |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8456 inline bool IsCompatibleReceiver(Object* receiver); | 8372 inline bool IsCompatibleReceiver(Object* receiver); |
| 8457 | 8373 |
| 8458 static inline AccessorInfo* cast(Object* obj); | 8374 static inline AccessorInfo* cast(Object* obj); |
| 8459 | 8375 |
| 8460 #ifdef OBJECT_PRINT | 8376 #ifdef OBJECT_PRINT |
| 8461 inline void AccessorInfoPrint() { | 8377 inline void AccessorInfoPrint() { |
| 8462 AccessorInfoPrint(stdout); | 8378 AccessorInfoPrint(stdout); |
| 8463 } | 8379 } |
| 8464 void AccessorInfoPrint(FILE* out); | 8380 void AccessorInfoPrint(FILE* out); |
| 8465 #endif | 8381 #endif |
| 8466 #ifdef DEBUG | 8382 DECLARE_VERIFIER(AccessorInfo) |
| 8467 void AccessorInfoVerify(); | |
| 8468 #endif | |
| 8469 | 8383 |
| 8470 static const int kGetterOffset = HeapObject::kHeaderSize; | 8384 static const int kGetterOffset = HeapObject::kHeaderSize; |
| 8471 static const int kSetterOffset = kGetterOffset + kPointerSize; | 8385 static const int kSetterOffset = kGetterOffset + kPointerSize; |
| 8472 static const int kDataOffset = kSetterOffset + kPointerSize; | 8386 static const int kDataOffset = kSetterOffset + kPointerSize; |
| 8473 static const int kNameOffset = kDataOffset + kPointerSize; | 8387 static const int kNameOffset = kDataOffset + kPointerSize; |
| 8474 static const int kFlagOffset = kNameOffset + kPointerSize; | 8388 static const int kFlagOffset = kNameOffset + kPointerSize; |
| 8475 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 8389 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
| 8476 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 8390 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; |
| 8477 | 8391 |
| 8478 private: | 8392 private: |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8522 if (!setter->IsNull()) set_setter(setter); | 8436 if (!setter->IsNull()) set_setter(setter); |
| 8523 } | 8437 } |
| 8524 | 8438 |
| 8525 bool ContainsAccessor() { | 8439 bool ContainsAccessor() { |
| 8526 return IsJSAccessor(getter()) || IsJSAccessor(setter()); | 8440 return IsJSAccessor(getter()) || IsJSAccessor(setter()); |
| 8527 } | 8441 } |
| 8528 | 8442 |
| 8529 #ifdef OBJECT_PRINT | 8443 #ifdef OBJECT_PRINT |
| 8530 void AccessorPairPrint(FILE* out = stdout); | 8444 void AccessorPairPrint(FILE* out = stdout); |
| 8531 #endif | 8445 #endif |
| 8532 #ifdef DEBUG | 8446 DECLARE_VERIFIER(AccessorPair) |
| 8533 void AccessorPairVerify(); | |
| 8534 #endif | |
| 8535 | 8447 |
| 8536 static const int kGetterOffset = HeapObject::kHeaderSize; | 8448 static const int kGetterOffset = HeapObject::kHeaderSize; |
| 8537 static const int kSetterOffset = kGetterOffset + kPointerSize; | 8449 static const int kSetterOffset = kGetterOffset + kPointerSize; |
| 8538 static const int kSize = kSetterOffset + kPointerSize; | 8450 static const int kSize = kSetterOffset + kPointerSize; |
| 8539 | 8451 |
| 8540 private: | 8452 private: |
| 8541 // Strangely enough, in addition to functions and harmony proxies, the spec | 8453 // Strangely enough, in addition to functions and harmony proxies, the spec |
| 8542 // requires us to consider undefined as a kind of accessor, too: | 8454 // requires us to consider undefined as a kind of accessor, too: |
| 8543 // var obj = {}; | 8455 // var obj = {}; |
| 8544 // Object.defineProperty(obj, "foo", {get: undefined}); | 8456 // Object.defineProperty(obj, "foo", {get: undefined}); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 8558 DECL_ACCESSORS(data, Object) | 8470 DECL_ACCESSORS(data, Object) |
| 8559 | 8471 |
| 8560 static inline AccessCheckInfo* cast(Object* obj); | 8472 static inline AccessCheckInfo* cast(Object* obj); |
| 8561 | 8473 |
| 8562 #ifdef OBJECT_PRINT | 8474 #ifdef OBJECT_PRINT |
| 8563 inline void AccessCheckInfoPrint() { | 8475 inline void AccessCheckInfoPrint() { |
| 8564 AccessCheckInfoPrint(stdout); | 8476 AccessCheckInfoPrint(stdout); |
| 8565 } | 8477 } |
| 8566 void AccessCheckInfoPrint(FILE* out); | 8478 void AccessCheckInfoPrint(FILE* out); |
| 8567 #endif | 8479 #endif |
| 8568 #ifdef DEBUG | 8480 DECLARE_VERIFIER(AccessCheckInfo) |
| 8569 void AccessCheckInfoVerify(); | |
| 8570 #endif | |
| 8571 | 8481 |
| 8572 static const int kNamedCallbackOffset = HeapObject::kHeaderSize; | 8482 static const int kNamedCallbackOffset = HeapObject::kHeaderSize; |
| 8573 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize; | 8483 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize; |
| 8574 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize; | 8484 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize; |
| 8575 static const int kSize = kDataOffset + kPointerSize; | 8485 static const int kSize = kDataOffset + kPointerSize; |
| 8576 | 8486 |
| 8577 private: | 8487 private: |
| 8578 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); | 8488 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); |
| 8579 }; | 8489 }; |
| 8580 | 8490 |
| 8581 | 8491 |
| 8582 class InterceptorInfo: public Struct { | 8492 class InterceptorInfo: public Struct { |
| 8583 public: | 8493 public: |
| 8584 DECL_ACCESSORS(getter, Object) | 8494 DECL_ACCESSORS(getter, Object) |
| 8585 DECL_ACCESSORS(setter, Object) | 8495 DECL_ACCESSORS(setter, Object) |
| 8586 DECL_ACCESSORS(query, Object) | 8496 DECL_ACCESSORS(query, Object) |
| 8587 DECL_ACCESSORS(deleter, Object) | 8497 DECL_ACCESSORS(deleter, Object) |
| 8588 DECL_ACCESSORS(enumerator, Object) | 8498 DECL_ACCESSORS(enumerator, Object) |
| 8589 DECL_ACCESSORS(data, Object) | 8499 DECL_ACCESSORS(data, Object) |
| 8590 | 8500 |
| 8591 static inline InterceptorInfo* cast(Object* obj); | 8501 static inline InterceptorInfo* cast(Object* obj); |
| 8592 | 8502 |
| 8593 #ifdef OBJECT_PRINT | 8503 #ifdef OBJECT_PRINT |
| 8594 inline void InterceptorInfoPrint() { | 8504 inline void InterceptorInfoPrint() { |
| 8595 InterceptorInfoPrint(stdout); | 8505 InterceptorInfoPrint(stdout); |
| 8596 } | 8506 } |
| 8597 void InterceptorInfoPrint(FILE* out); | 8507 void InterceptorInfoPrint(FILE* out); |
| 8598 #endif | 8508 #endif |
| 8599 #ifdef DEBUG | 8509 DECLARE_VERIFIER(InterceptorInfo) |
| 8600 void InterceptorInfoVerify(); | |
| 8601 #endif | |
| 8602 | 8510 |
| 8603 static const int kGetterOffset = HeapObject::kHeaderSize; | 8511 static const int kGetterOffset = HeapObject::kHeaderSize; |
| 8604 static const int kSetterOffset = kGetterOffset + kPointerSize; | 8512 static const int kSetterOffset = kGetterOffset + kPointerSize; |
| 8605 static const int kQueryOffset = kSetterOffset + kPointerSize; | 8513 static const int kQueryOffset = kSetterOffset + kPointerSize; |
| 8606 static const int kDeleterOffset = kQueryOffset + kPointerSize; | 8514 static const int kDeleterOffset = kQueryOffset + kPointerSize; |
| 8607 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; | 8515 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; |
| 8608 static const int kDataOffset = kEnumeratorOffset + kPointerSize; | 8516 static const int kDataOffset = kEnumeratorOffset + kPointerSize; |
| 8609 static const int kSize = kDataOffset + kPointerSize; | 8517 static const int kSize = kDataOffset + kPointerSize; |
| 8610 | 8518 |
| 8611 private: | 8519 private: |
| 8612 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); | 8520 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); |
| 8613 }; | 8521 }; |
| 8614 | 8522 |
| 8615 | 8523 |
| 8616 class CallHandlerInfo: public Struct { | 8524 class CallHandlerInfo: public Struct { |
| 8617 public: | 8525 public: |
| 8618 DECL_ACCESSORS(callback, Object) | 8526 DECL_ACCESSORS(callback, Object) |
| 8619 DECL_ACCESSORS(data, Object) | 8527 DECL_ACCESSORS(data, Object) |
| 8620 | 8528 |
| 8621 static inline CallHandlerInfo* cast(Object* obj); | 8529 static inline CallHandlerInfo* cast(Object* obj); |
| 8622 | 8530 |
| 8623 #ifdef OBJECT_PRINT | 8531 #ifdef OBJECT_PRINT |
| 8624 inline void CallHandlerInfoPrint() { | 8532 inline void CallHandlerInfoPrint() { |
| 8625 CallHandlerInfoPrint(stdout); | 8533 CallHandlerInfoPrint(stdout); |
| 8626 } | 8534 } |
| 8627 void CallHandlerInfoPrint(FILE* out); | 8535 void CallHandlerInfoPrint(FILE* out); |
| 8628 #endif | 8536 #endif |
| 8629 #ifdef DEBUG | 8537 DECLARE_VERIFIER(CallHandlerInfo) |
| 8630 void CallHandlerInfoVerify(); | |
| 8631 #endif | |
| 8632 | 8538 |
| 8633 static const int kCallbackOffset = HeapObject::kHeaderSize; | 8539 static const int kCallbackOffset = HeapObject::kHeaderSize; |
| 8634 static const int kDataOffset = kCallbackOffset + kPointerSize; | 8540 static const int kDataOffset = kCallbackOffset + kPointerSize; |
| 8635 static const int kSize = kDataOffset + kPointerSize; | 8541 static const int kSize = kDataOffset + kPointerSize; |
| 8636 | 8542 |
| 8637 private: | 8543 private: |
| 8638 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); | 8544 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); |
| 8639 }; | 8545 }; |
| 8640 | 8546 |
| 8641 | 8547 |
| 8642 class TemplateInfo: public Struct { | 8548 class TemplateInfo: public Struct { |
| 8643 public: | 8549 public: |
| 8644 DECL_ACCESSORS(tag, Object) | 8550 DECL_ACCESSORS(tag, Object) |
| 8645 DECL_ACCESSORS(property_list, Object) | 8551 DECL_ACCESSORS(property_list, Object) |
| 8646 | 8552 |
| 8647 #ifdef DEBUG | 8553 DECLARE_VERIFIER(TemplateInfo) |
| 8648 void TemplateInfoVerify(); | |
| 8649 #endif | |
| 8650 | 8554 |
| 8651 static const int kTagOffset = HeapObject::kHeaderSize; | 8555 static const int kTagOffset = HeapObject::kHeaderSize; |
| 8652 static const int kPropertyListOffset = kTagOffset + kPointerSize; | 8556 static const int kPropertyListOffset = kTagOffset + kPointerSize; |
| 8653 static const int kHeaderSize = kPropertyListOffset + kPointerSize; | 8557 static const int kHeaderSize = kPropertyListOffset + kPointerSize; |
| 8654 | 8558 |
| 8655 private: | 8559 private: |
| 8656 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); | 8560 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); |
| 8657 }; | 8561 }; |
| 8658 | 8562 |
| 8659 | 8563 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 8682 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 8586 DECL_BOOLEAN_ACCESSORS(read_only_prototype) |
| 8683 | 8587 |
| 8684 static inline FunctionTemplateInfo* cast(Object* obj); | 8588 static inline FunctionTemplateInfo* cast(Object* obj); |
| 8685 | 8589 |
| 8686 #ifdef OBJECT_PRINT | 8590 #ifdef OBJECT_PRINT |
| 8687 inline void FunctionTemplateInfoPrint() { | 8591 inline void FunctionTemplateInfoPrint() { |
| 8688 FunctionTemplateInfoPrint(stdout); | 8592 FunctionTemplateInfoPrint(stdout); |
| 8689 } | 8593 } |
| 8690 void FunctionTemplateInfoPrint(FILE* out); | 8594 void FunctionTemplateInfoPrint(FILE* out); |
| 8691 #endif | 8595 #endif |
| 8692 #ifdef DEBUG | 8596 DECLARE_VERIFIER(FunctionTemplateInfo) |
| 8693 void FunctionTemplateInfoVerify(); | |
| 8694 #endif | |
| 8695 | 8597 |
| 8696 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; | 8598 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; |
| 8697 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; | 8599 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; |
| 8698 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize; | 8600 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize; |
| 8699 static const int kPrototypeTemplateOffset = | 8601 static const int kPrototypeTemplateOffset = |
| 8700 kPropertyAccessorsOffset + kPointerSize; | 8602 kPropertyAccessorsOffset + kPointerSize; |
| 8701 static const int kParentTemplateOffset = | 8603 static const int kParentTemplateOffset = |
| 8702 kPrototypeTemplateOffset + kPointerSize; | 8604 kPrototypeTemplateOffset + kPointerSize; |
| 8703 static const int kNamedPropertyHandlerOffset = | 8605 static const int kNamedPropertyHandlerOffset = |
| 8704 kParentTemplateOffset + kPointerSize; | 8606 kParentTemplateOffset + kPointerSize; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 8731 DECL_ACCESSORS(internal_field_count, Object) | 8633 DECL_ACCESSORS(internal_field_count, Object) |
| 8732 | 8634 |
| 8733 static inline ObjectTemplateInfo* cast(Object* obj); | 8635 static inline ObjectTemplateInfo* cast(Object* obj); |
| 8734 | 8636 |
| 8735 #ifdef OBJECT_PRINT | 8637 #ifdef OBJECT_PRINT |
| 8736 inline void ObjectTemplateInfoPrint() { | 8638 inline void ObjectTemplateInfoPrint() { |
| 8737 ObjectTemplateInfoPrint(stdout); | 8639 ObjectTemplateInfoPrint(stdout); |
| 8738 } | 8640 } |
| 8739 void ObjectTemplateInfoPrint(FILE* out); | 8641 void ObjectTemplateInfoPrint(FILE* out); |
| 8740 #endif | 8642 #endif |
| 8741 #ifdef DEBUG | 8643 DECLARE_VERIFIER(ObjectTemplateInfo) |
| 8742 void ObjectTemplateInfoVerify(); | |
| 8743 #endif | |
| 8744 | 8644 |
| 8745 static const int kConstructorOffset = TemplateInfo::kHeaderSize; | 8645 static const int kConstructorOffset = TemplateInfo::kHeaderSize; |
| 8746 static const int kInternalFieldCountOffset = | 8646 static const int kInternalFieldCountOffset = |
| 8747 kConstructorOffset + kPointerSize; | 8647 kConstructorOffset + kPointerSize; |
| 8748 static const int kSize = kInternalFieldCountOffset + kPointerSize; | 8648 static const int kSize = kInternalFieldCountOffset + kPointerSize; |
| 8749 }; | 8649 }; |
| 8750 | 8650 |
| 8751 | 8651 |
| 8752 class SignatureInfo: public Struct { | 8652 class SignatureInfo: public Struct { |
| 8753 public: | 8653 public: |
| 8754 DECL_ACCESSORS(receiver, Object) | 8654 DECL_ACCESSORS(receiver, Object) |
| 8755 DECL_ACCESSORS(args, Object) | 8655 DECL_ACCESSORS(args, Object) |
| 8756 | 8656 |
| 8757 static inline SignatureInfo* cast(Object* obj); | 8657 static inline SignatureInfo* cast(Object* obj); |
| 8758 | 8658 |
| 8759 #ifdef OBJECT_PRINT | 8659 #ifdef OBJECT_PRINT |
| 8760 inline void SignatureInfoPrint() { | 8660 inline void SignatureInfoPrint() { |
| 8761 SignatureInfoPrint(stdout); | 8661 SignatureInfoPrint(stdout); |
| 8762 } | 8662 } |
| 8763 void SignatureInfoPrint(FILE* out); | 8663 void SignatureInfoPrint(FILE* out); |
| 8764 #endif | 8664 #endif |
| 8765 #ifdef DEBUG | 8665 DECLARE_VERIFIER(SignatureInfo) |
| 8766 void SignatureInfoVerify(); | |
| 8767 #endif | |
| 8768 | 8666 |
| 8769 static const int kReceiverOffset = Struct::kHeaderSize; | 8667 static const int kReceiverOffset = Struct::kHeaderSize; |
| 8770 static const int kArgsOffset = kReceiverOffset + kPointerSize; | 8668 static const int kArgsOffset = kReceiverOffset + kPointerSize; |
| 8771 static const int kSize = kArgsOffset + kPointerSize; | 8669 static const int kSize = kArgsOffset + kPointerSize; |
| 8772 | 8670 |
| 8773 private: | 8671 private: |
| 8774 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo); | 8672 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo); |
| 8775 }; | 8673 }; |
| 8776 | 8674 |
| 8777 | 8675 |
| 8778 class TypeSwitchInfo: public Struct { | 8676 class TypeSwitchInfo: public Struct { |
| 8779 public: | 8677 public: |
| 8780 DECL_ACCESSORS(types, Object) | 8678 DECL_ACCESSORS(types, Object) |
| 8781 | 8679 |
| 8782 static inline TypeSwitchInfo* cast(Object* obj); | 8680 static inline TypeSwitchInfo* cast(Object* obj); |
| 8783 | 8681 |
| 8784 #ifdef OBJECT_PRINT | 8682 #ifdef OBJECT_PRINT |
| 8785 inline void TypeSwitchInfoPrint() { | 8683 inline void TypeSwitchInfoPrint() { |
| 8786 TypeSwitchInfoPrint(stdout); | 8684 TypeSwitchInfoPrint(stdout); |
| 8787 } | 8685 } |
| 8788 void TypeSwitchInfoPrint(FILE* out); | 8686 void TypeSwitchInfoPrint(FILE* out); |
| 8789 #endif | 8687 #endif |
| 8790 #ifdef DEBUG | 8688 DECLARE_VERIFIER(TypeSwitchInfo) |
| 8791 void TypeSwitchInfoVerify(); | |
| 8792 #endif | |
| 8793 | 8689 |
| 8794 static const int kTypesOffset = Struct::kHeaderSize; | 8690 static const int kTypesOffset = Struct::kHeaderSize; |
| 8795 static const int kSize = kTypesOffset + kPointerSize; | 8691 static const int kSize = kTypesOffset + kPointerSize; |
| 8796 }; | 8692 }; |
| 8797 | 8693 |
| 8798 | 8694 |
| 8799 #ifdef ENABLE_DEBUGGER_SUPPORT | 8695 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 8800 // The DebugInfo class holds additional information for a function being | 8696 // The DebugInfo class holds additional information for a function being |
| 8801 // debugged. | 8697 // debugged. |
| 8802 class DebugInfo: public Struct { | 8698 class DebugInfo: public Struct { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 8832 int GetBreakPointCount(); | 8728 int GetBreakPointCount(); |
| 8833 | 8729 |
| 8834 static inline DebugInfo* cast(Object* obj); | 8730 static inline DebugInfo* cast(Object* obj); |
| 8835 | 8731 |
| 8836 #ifdef OBJECT_PRINT | 8732 #ifdef OBJECT_PRINT |
| 8837 inline void DebugInfoPrint() { | 8733 inline void DebugInfoPrint() { |
| 8838 DebugInfoPrint(stdout); | 8734 DebugInfoPrint(stdout); |
| 8839 } | 8735 } |
| 8840 void DebugInfoPrint(FILE* out); | 8736 void DebugInfoPrint(FILE* out); |
| 8841 #endif | 8737 #endif |
| 8842 #ifdef DEBUG | 8738 DECLARE_VERIFIER(DebugInfo) |
| 8843 void DebugInfoVerify(); | |
| 8844 #endif | |
| 8845 | 8739 |
| 8846 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | 8740 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; |
| 8847 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize; | 8741 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize; |
| 8848 static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize; | 8742 static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize; |
| 8849 static const int kActiveBreakPointsCountIndex = | 8743 static const int kActiveBreakPointsCountIndex = |
| 8850 kPatchedCodeIndex + kPointerSize; | 8744 kPatchedCodeIndex + kPointerSize; |
| 8851 static const int kBreakPointsStateIndex = | 8745 static const int kBreakPointsStateIndex = |
| 8852 kActiveBreakPointsCountIndex + kPointerSize; | 8746 kActiveBreakPointsCountIndex + kPointerSize; |
| 8853 static const int kSize = kBreakPointsStateIndex + kPointerSize; | 8747 static const int kSize = kBreakPointsStateIndex + kPointerSize; |
| 8854 | 8748 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8890 int GetBreakPointCount(); | 8784 int GetBreakPointCount(); |
| 8891 | 8785 |
| 8892 static inline BreakPointInfo* cast(Object* obj); | 8786 static inline BreakPointInfo* cast(Object* obj); |
| 8893 | 8787 |
| 8894 #ifdef OBJECT_PRINT | 8788 #ifdef OBJECT_PRINT |
| 8895 inline void BreakPointInfoPrint() { | 8789 inline void BreakPointInfoPrint() { |
| 8896 BreakPointInfoPrint(stdout); | 8790 BreakPointInfoPrint(stdout); |
| 8897 } | 8791 } |
| 8898 void BreakPointInfoPrint(FILE* out); | 8792 void BreakPointInfoPrint(FILE* out); |
| 8899 #endif | 8793 #endif |
| 8900 #ifdef DEBUG | 8794 DECLARE_VERIFIER(BreakPointInfo) |
| 8901 void BreakPointInfoVerify(); | |
| 8902 #endif | |
| 8903 | 8795 |
| 8904 static const int kCodePositionIndex = Struct::kHeaderSize; | 8796 static const int kCodePositionIndex = Struct::kHeaderSize; |
| 8905 static const int kSourcePositionIndex = kCodePositionIndex + kPointerSize; | 8797 static const int kSourcePositionIndex = kCodePositionIndex + kPointerSize; |
| 8906 static const int kStatementPositionIndex = | 8798 static const int kStatementPositionIndex = |
| 8907 kSourcePositionIndex + kPointerSize; | 8799 kSourcePositionIndex + kPointerSize; |
| 8908 static const int kBreakPointObjectsIndex = | 8800 static const int kBreakPointObjectsIndex = |
| 8909 kStatementPositionIndex + kPointerSize; | 8801 kStatementPositionIndex + kPointerSize; |
| 8910 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 8802 static const int kSize = kBreakPointObjectsIndex + kPointerSize; |
| 8911 | 8803 |
| 8912 private: | 8804 private: |
| 8913 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); | 8805 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); |
| 8914 }; | 8806 }; |
| 8915 #endif // ENABLE_DEBUGGER_SUPPORT | 8807 #endif // ENABLE_DEBUGGER_SUPPORT |
| 8916 | 8808 |
| 8917 | 8809 |
| 8918 #undef DECL_BOOLEAN_ACCESSORS | 8810 #undef DECL_BOOLEAN_ACCESSORS |
| 8919 #undef DECL_ACCESSORS | 8811 #undef DECL_ACCESSORS |
| 8812 #undef DECLARE_VERIFIER |
| 8920 | 8813 |
| 8921 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \ | 8814 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \ |
| 8922 V(kSymbolTable, "symbol_table", "(Symbols)") \ | 8815 V(kSymbolTable, "symbol_table", "(Symbols)") \ |
| 8923 V(kExternalStringsTable, "external_strings_table", "(External strings)") \ | 8816 V(kExternalStringsTable, "external_strings_table", "(External strings)") \ |
| 8924 V(kStrongRootList, "strong_root_list", "(Strong roots)") \ | 8817 V(kStrongRootList, "strong_root_list", "(Strong roots)") \ |
| 8925 V(kSymbol, "symbol", "(Symbol)") \ | 8818 V(kSymbol, "symbol", "(Symbol)") \ |
| 8926 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \ | 8819 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \ |
| 8927 V(kTop, "top", "(Isolate)") \ | 8820 V(kTop, "top", "(Isolate)") \ |
| 8928 V(kRelocatable, "relocatable", "(Relocatable)") \ | 8821 V(kRelocatable, "relocatable", "(Relocatable)") \ |
| 8929 V(kDebug, "debug", "(Debugger)") \ | 8822 V(kDebug, "debug", "(Debugger)") \ |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9039 } else { | 8932 } else { |
| 9040 value &= ~(1 << bit_position); | 8933 value &= ~(1 << bit_position); |
| 9041 } | 8934 } |
| 9042 return value; | 8935 return value; |
| 9043 } | 8936 } |
| 9044 }; | 8937 }; |
| 9045 | 8938 |
| 9046 } } // namespace v8::internal | 8939 } } // namespace v8::internal |
| 9047 | 8940 |
| 9048 #endif // V8_OBJECTS_H_ | 8941 #endif // V8_OBJECTS_H_ |
| OLD | NEW |