Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects.h

Issue 760213005: Turn on DCHECKs and other debugging code if dcheck_always_on is 1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updaets Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
3073 3079
3074 #ifdef DEBUG
3075 // Is the descriptor array sorted and without duplicates? 3080 // Is the descriptor array sorted and without duplicates?
3076 bool IsSortedNoDuplicates(int valid_descriptors = -1); 3081 bool IsSortedNoDuplicates(int valid_descriptors = -1);
3077 3082
3078 // Is the descriptor array consistent with the back pointers in targets? 3083 // Is the descriptor array consistent with the back pointers in targets?
3079 bool IsConsistentWithBackPointers(Map* current_map); 3084 bool IsConsistentWithBackPointers(Map* current_map);
3080 3085
3081 // Are two DescriptorArrays equal? 3086 // Are two DescriptorArrays equal?
3082 bool IsEqualTo(DescriptorArray* other); 3087 bool IsEqualTo(DescriptorArray* other);
3083 #endif 3088 #endif
3084 3089
(...skipping 5861 matching lines...) Expand 10 before | Expand all | Expand 10 after
8946 DECLARE_CAST(String) 8951 DECLARE_CAST(String)
8947 8952
8948 void PrintOn(FILE* out); 8953 void PrintOn(FILE* out);
8949 8954
8950 // For use during stack traces. Performs rudimentary sanity check. 8955 // For use during stack traces. Performs rudimentary sanity check.
8951 bool LooksValid(); 8956 bool LooksValid();
8952 8957
8953 // Dispatched behavior. 8958 // Dispatched behavior.
8954 void StringShortPrint(StringStream* accumulator); 8959 void StringShortPrint(StringStream* accumulator);
8955 void PrintUC16(std::ostream& os, int start = 0, int end = -1); // NOLINT 8960 void PrintUC16(std::ostream& os, int start = 0, int end = -1); // NOLINT
8956 #ifdef OBJECT_PRINT 8961 #ifdef DEBUG
8957 char* ToAsciiArray(); 8962 char* ToAsciiArray();
8958 #endif 8963 #endif
8959 DECLARE_PRINTER(String) 8964 DECLARE_PRINTER(String)
8960 DECLARE_VERIFIER(String) 8965 DECLARE_VERIFIER(String)
8961 8966
8962 inline bool IsFlat(); 8967 inline bool IsFlat();
8963 8968
8964 // Layout description. 8969 // Layout description.
8965 static const int kLengthOffset = Name::kSize; 8970 static const int kLengthOffset = Name::kSize;
8966 static const int kSize = kLengthOffset + kPointerSize; 8971 static const int kSize = kLengthOffset + kPointerSize;
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after
11002 } else { 11007 } else {
11003 value &= ~(1 << bit_position); 11008 value &= ~(1 << bit_position);
11004 } 11009 }
11005 return value; 11010 return value;
11006 } 11011 }
11007 }; 11012 };
11008 11013
11009 } } // namespace v8::internal 11014 } } // namespace v8::internal
11010 11015
11011 #endif // V8_OBJECTS_H_ 11016 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698