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