OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_V8GLOBALS_H_ | 28 #ifndef V8_V8GLOBALS_H_ |
29 #define V8_V8GLOBALS_H_ | 29 #define V8_V8GLOBALS_H_ |
30 | 30 |
31 #include "globals.h" | 31 #include "globals.h" |
| 32 #include "checks.h" |
32 | 33 |
33 namespace v8 { | 34 namespace v8 { |
34 namespace internal { | 35 namespace internal { |
35 | 36 |
36 // This file contains constants and global declarations related to the | 37 // This file contains constants and global declarations related to the |
37 // V8 system. | 38 // V8 system. |
38 | 39 |
39 // Mask for the sign bit in a smi. | 40 // Mask for the sign bit in a smi. |
40 const intptr_t kSmiSignMask = kIntptrSignBit; | 41 const intptr_t kSmiSignMask = kIntptrSignBit; |
41 | 42 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 NULL_DESCRIPTOR = 9, // only in fast mode | 341 NULL_DESCRIPTOR = 9, // only in fast mode |
341 // All properties before MAP_TRANSITION are real. | 342 // All properties before MAP_TRANSITION are real. |
342 FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION, | 343 FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION, |
343 // There are no IC stubs for NULL_DESCRIPTORS. Therefore, | 344 // There are no IC stubs for NULL_DESCRIPTORS. Therefore, |
344 // NULL_DESCRIPTOR can be used as the type flag for IC stubs for | 345 // NULL_DESCRIPTOR can be used as the type flag for IC stubs for |
345 // nonexistent properties. | 346 // nonexistent properties. |
346 NONEXISTENT = NULL_DESCRIPTOR | 347 NONEXISTENT = NULL_DESCRIPTOR |
347 }; | 348 }; |
348 | 349 |
349 | 350 |
| 351 inline bool IsTransitionType(PropertyType type) { |
| 352 switch (type) { |
| 353 case MAP_TRANSITION: |
| 354 case CONSTANT_TRANSITION: |
| 355 case ELEMENTS_TRANSITION: |
| 356 return true; |
| 357 case NORMAL: |
| 358 case FIELD: |
| 359 case CONSTANT_FUNCTION: |
| 360 case CALLBACKS: |
| 361 case HANDLER: |
| 362 case INTERCEPTOR: |
| 363 case NULL_DESCRIPTOR: |
| 364 return false; |
| 365 } |
| 366 UNREACHABLE(); // keep the compiler happy |
| 367 return false; |
| 368 } |
| 369 |
350 // Whether to remove map transitions and constant transitions from a | 370 // Whether to remove map transitions and constant transitions from a |
351 // DescriptorArray. | 371 // DescriptorArray. |
352 enum TransitionFlag { | 372 enum TransitionFlag { |
353 REMOVE_TRANSITIONS, | 373 REMOVE_TRANSITIONS, |
354 KEEP_TRANSITIONS | 374 KEEP_TRANSITIONS |
355 }; | 375 }; |
356 | 376 |
357 | 377 |
358 // Union used for fast testing of specific double values. | 378 // Union used for fast testing of specific double values. |
359 union DoubleRepresentation { | 379 union DoubleRepresentation { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 608 |
589 enum ClearExceptionFlag { | 609 enum ClearExceptionFlag { |
590 KEEP_EXCEPTION, | 610 KEEP_EXCEPTION, |
591 CLEAR_EXCEPTION | 611 CLEAR_EXCEPTION |
592 }; | 612 }; |
593 | 613 |
594 | 614 |
595 } } // namespace v8::internal | 615 } } // namespace v8::internal |
596 | 616 |
597 #endif // V8_V8GLOBALS_H_ | 617 #endif // V8_V8GLOBALS_H_ |
OLD | NEW |