OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1223 #endif | 1223 #endif |
1224 | 1224 |
1225 inline void VerifyApiCallResultType(); | 1225 inline void VerifyApiCallResultType(); |
1226 | 1226 |
1227 // Prints this object without details. | 1227 // Prints this object without details. |
1228 void ShortPrint(FILE* out = stdout); | 1228 void ShortPrint(FILE* out = stdout); |
1229 | 1229 |
1230 // Prints this object without details to a message accumulator. | 1230 // Prints this object without details to a message accumulator. |
1231 void ShortPrint(StringStream* accumulator); | 1231 void ShortPrint(StringStream* accumulator); |
1232 | 1232 |
1233 void ShortPrint(std::ostream& os); // NOLINT | |
1234 | |
1233 DECLARE_CAST(Object) | 1235 DECLARE_CAST(Object) |
1234 | 1236 |
1235 // Layout description. | 1237 // Layout description. |
1236 static const int kHeaderSize = 0; // Object does not take up any space. | 1238 static const int kHeaderSize = 0; // Object does not take up any space. |
1237 | 1239 |
1238 #ifdef OBJECT_PRINT | 1240 #ifdef OBJECT_PRINT |
1239 // For our gdb macros, we should perhaps change these in the future. | 1241 // For our gdb macros, we should perhaps change these in the future. |
1240 void Print(); | 1242 void Print(); |
1241 | 1243 |
1242 // Prints this object with details. | 1244 // Prints this object with details. |
1243 void Print(std::ostream& os); // NOLINT | 1245 void Print(std::ostream& os); // NOLINT |
1246 #else | |
1247 void Print() { ShortPrint(); } | |
1248 void Print(std::ostream& os) { ShortPrint(os); } // NOLINT | |
1244 #endif | 1249 #endif |
1245 | 1250 |
1246 private: | 1251 private: |
1247 friend class LookupIterator; | 1252 friend class LookupIterator; |
1248 friend class PrototypeIterator; | 1253 friend class PrototypeIterator; |
1249 | 1254 |
1250 // Return the map of the root of object's prototype chain. | 1255 // Return the map of the root of object's prototype chain. |
1251 Map* GetRootMap(Isolate* isolate); | 1256 Map* GetRootMap(Isolate* isolate); |
1252 | 1257 |
1253 DISALLOW_IMPLICIT_CONSTRUCTORS(Object); | 1258 DISALLOW_IMPLICIT_CONSTRUCTORS(Object); |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2130 | 2135 |
2131 DECLARE_CAST(JSObject) | 2136 DECLARE_CAST(JSObject) |
2132 | 2137 |
2133 // Dispatched behavior. | 2138 // Dispatched behavior. |
2134 void JSObjectShortPrint(StringStream* accumulator); | 2139 void JSObjectShortPrint(StringStream* accumulator); |
2135 DECLARE_PRINTER(JSObject) | 2140 DECLARE_PRINTER(JSObject) |
2136 DECLARE_VERIFIER(JSObject) | 2141 DECLARE_VERIFIER(JSObject) |
2137 #ifdef OBJECT_PRINT | 2142 #ifdef OBJECT_PRINT |
2138 void PrintProperties(std::ostream& os); // NOLINT | 2143 void PrintProperties(std::ostream& os); // NOLINT |
2139 void PrintElements(std::ostream& os); // NOLINT | 2144 void PrintElements(std::ostream& os); // NOLINT |
2145 #endif | |
2146 #ifdef DEBUG | |
2140 void PrintTransitions(std::ostream& os); // NOLINT | 2147 void PrintTransitions(std::ostream& os); // NOLINT |
2141 #endif | 2148 #endif |
2142 | 2149 |
2143 static void PrintElementsTransition( | 2150 static void PrintElementsTransition( |
2144 FILE* file, Handle<JSObject> object, | 2151 FILE* file, Handle<JSObject> object, |
2145 ElementsKind from_kind, Handle<FixedArrayBase> from_elements, | 2152 ElementsKind from_kind, Handle<FixedArrayBase> from_elements, |
2146 ElementsKind to_kind, Handle<FixedArrayBase> to_elements); | 2153 ElementsKind to_kind, Handle<FixedArrayBase> to_elements); |
2147 | 2154 |
2148 void PrintInstanceMigration(FILE* file, Map* original_map, Map* new_map); | 2155 void PrintInstanceMigration(FILE* file, Map* original_map, Map* new_map); |
2149 | 2156 |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3056 | 3063 |
3057 // Layout description for the bridge array. | 3064 // Layout description for the bridge array. |
3058 static const int kEnumCacheBridgeCacheOffset = FixedArray::kHeaderSize; | 3065 static const int kEnumCacheBridgeCacheOffset = FixedArray::kHeaderSize; |
3059 | 3066 |
3060 // Layout of descriptor. | 3067 // Layout of descriptor. |
3061 static const int kDescriptorKey = 0; | 3068 static const int kDescriptorKey = 0; |
3062 static const int kDescriptorDetails = 1; | 3069 static const int kDescriptorDetails = 1; |
3063 static const int kDescriptorValue = 2; | 3070 static const int kDescriptorValue = 2; |
3064 static const int kDescriptorSize = 3; | 3071 static const int kDescriptorSize = 3; |
3065 | 3072 |
3066 #ifdef OBJECT_PRINT | 3073 #ifdef DEBUG |
3067 // For our gdb macros, we should perhaps change these in the future. | 3074 // For our gdb macros, we should perhaps change these in the future. |
3068 void Print(); | 3075 void Print(); |
3069 | 3076 |
3070 // Print all the descriptors. | 3077 // Print all the descriptors. |
3071 void PrintDescriptors(std::ostream& os); // NOLINT | 3078 void PrintDescriptors(std::ostream& os); // NOLINT |
3072 #endif | 3079 #endif |
3073 | 3080 |
3074 #ifdef DEBUG | 3081 #ifdef DEBUG |
Jakob Kummerow
2014/12/04 08:59:45
join this with the above block please
| |
3075 // Is the descriptor array sorted and without duplicates? | 3082 // Is the descriptor array sorted and without duplicates? |
3076 bool IsSortedNoDuplicates(int valid_descriptors = -1); | 3083 bool IsSortedNoDuplicates(int valid_descriptors = -1); |
3077 | 3084 |
3078 // Is the descriptor array consistent with the back pointers in targets? | 3085 // Is the descriptor array consistent with the back pointers in targets? |
3079 bool IsConsistentWithBackPointers(Map* current_map); | 3086 bool IsConsistentWithBackPointers(Map* current_map); |
3080 | 3087 |
3081 // Are two DescriptorArrays equal? | 3088 // Are two DescriptorArrays equal? |
3082 bool IsEqualTo(DescriptorArray* other); | 3089 bool IsEqualTo(DescriptorArray* other); |
3083 #endif | 3090 #endif |
3084 | 3091 |
(...skipping 5864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8949 DECLARE_CAST(String) | 8956 DECLARE_CAST(String) |
8950 | 8957 |
8951 void PrintOn(FILE* out); | 8958 void PrintOn(FILE* out); |
8952 | 8959 |
8953 // For use during stack traces. Performs rudimentary sanity check. | 8960 // For use during stack traces. Performs rudimentary sanity check. |
8954 bool LooksValid(); | 8961 bool LooksValid(); |
8955 | 8962 |
8956 // Dispatched behavior. | 8963 // Dispatched behavior. |
8957 void StringShortPrint(StringStream* accumulator); | 8964 void StringShortPrint(StringStream* accumulator); |
8958 void PrintUC16(std::ostream& os, int start = 0, int end = -1); // NOLINT | 8965 void PrintUC16(std::ostream& os, int start = 0, int end = -1); // NOLINT |
8959 #ifdef OBJECT_PRINT | 8966 #ifdef DEBUG |
8960 char* ToAsciiArray(); | 8967 char* ToAsciiArray(); |
8961 #endif | 8968 #endif |
8962 DECLARE_PRINTER(String) | 8969 DECLARE_PRINTER(String) |
8963 DECLARE_VERIFIER(String) | 8970 DECLARE_VERIFIER(String) |
8964 | 8971 |
8965 inline bool IsFlat(); | 8972 inline bool IsFlat(); |
8966 | 8973 |
8967 // Layout description. | 8974 // Layout description. |
8968 static const int kLengthOffset = Name::kSize; | 8975 static const int kLengthOffset = Name::kSize; |
8969 static const int kSize = kLengthOffset + kPointerSize; | 8976 static const int kSize = kLengthOffset + kPointerSize; |
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11005 } else { | 11012 } else { |
11006 value &= ~(1 << bit_position); | 11013 value &= ~(1 << bit_position); |
11007 } | 11014 } |
11008 return value; | 11015 return value; |
11009 } | 11016 } |
11010 }; | 11017 }; |
11011 | 11018 |
11012 } } // namespace v8::internal | 11019 } } // namespace v8::internal |
11013 | 11020 |
11014 #endif // V8_OBJECTS_H_ | 11021 #endif // V8_OBJECTS_H_ |
OLD | NEW |