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_PROPERTY_DETAILS_H_ | 5 #ifndef V8_PROPERTY_DETAILS_H_ |
6 #define V8_PROPERTY_DETAILS_H_ | 6 #define V8_PROPERTY_DETAILS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/utils.h" | 10 #include "src/utils.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 STATIC_ASSERT(DictionaryStorageField::kNext <= 31); | 368 STATIC_ASSERT(DictionaryStorageField::kNext <= 31); |
369 STATIC_ASSERT(FieldIndexField::kNext <= 31); | 369 STATIC_ASSERT(FieldIndexField::kNext <= 31); |
370 | 370 |
371 static const int kInitialIndex = 1; | 371 static const int kInitialIndex = 1; |
372 | 372 |
373 #ifdef OBJECT_PRINT | 373 #ifdef OBJECT_PRINT |
374 // For our gdb macros, we should perhaps change these in the future. | 374 // For our gdb macros, we should perhaps change these in the future. |
375 void Print(bool dictionary_mode); | 375 void Print(bool dictionary_mode); |
376 #endif | 376 #endif |
377 | 377 |
| 378 enum PrintMode { |
| 379 kPrintAttributes = 1 << 0, |
| 380 kPrintFieldIndex = 1 << 1, |
| 381 kPrintRepresentation = 1 << 2, |
| 382 kPrintPointer = 1 << 3, |
| 383 |
| 384 kForProperties = kPrintFieldIndex, |
| 385 kForTransitions = kPrintAttributes, |
| 386 kPrintFull = -1, |
| 387 }; |
| 388 void PrintAsSlowTo(std::ostream& out); |
| 389 void PrintAsFastTo(std::ostream& out, PrintMode mode = kPrintFull); |
| 390 |
378 private: | 391 private: |
379 PropertyDetails(int value, int pointer) { | 392 PropertyDetails(int value, int pointer) { |
380 value_ = DescriptorPointer::update(value, pointer); | 393 value_ = DescriptorPointer::update(value, pointer); |
381 } | 394 } |
382 PropertyDetails(int value, Representation representation) { | 395 PropertyDetails(int value, Representation representation) { |
383 value_ = RepresentationField::update( | 396 value_ = RepresentationField::update( |
384 value, EncodeRepresentation(representation)); | 397 value, EncodeRepresentation(representation)); |
385 } | 398 } |
386 PropertyDetails(int value, PropertyAttributes attributes) { | 399 PropertyDetails(int value, PropertyAttributes attributes) { |
387 value_ = AttributesField::update(value, attributes); | 400 value_ = AttributesField::update(value, attributes); |
388 } | 401 } |
389 | 402 |
390 uint32_t value_; | 403 uint32_t value_; |
391 }; | 404 }; |
392 | 405 |
393 | 406 |
394 std::ostream& operator<<(std::ostream& os, | 407 std::ostream& operator<<(std::ostream& os, |
395 const PropertyAttributes& attributes); | 408 const PropertyAttributes& attributes); |
396 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); | |
397 } // namespace internal | 409 } // namespace internal |
398 } // namespace v8 | 410 } // namespace v8 |
399 | 411 |
400 #endif // V8_PROPERTY_DETAILS_H_ | 412 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |