OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // heap.cc and mark-compact.cc. | 448 // heap.cc and mark-compact.cc. |
449 const uint32_t kShortcutTypeMask = | 449 const uint32_t kShortcutTypeMask = |
450 kIsNotStringMask | | 450 kIsNotStringMask | |
451 kIsSymbolMask | | 451 kIsSymbolMask | |
452 kStringRepresentationMask; | 452 kStringRepresentationMask; |
453 const uint32_t kShortcutTypeTag = kConsStringTag; | 453 const uint32_t kShortcutTypeTag = kConsStringTag; |
454 | 454 |
455 | 455 |
456 enum InstanceType { | 456 enum InstanceType { |
457 // String types. | 457 // String types. |
| 458 // FIRST_STRING_TYPE |
458 SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag, | 459 SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag, |
459 ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag, | 460 ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag, |
460 CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag, | 461 CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag, |
461 CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag, | 462 CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag, |
462 EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag, | 463 EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag, |
463 EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE = | 464 EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE = |
464 kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag, | 465 kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag, |
465 EXTERNAL_ASCII_SYMBOL_TYPE = | 466 EXTERNAL_ASCII_SYMBOL_TYPE = |
466 kAsciiStringTag | kSymbolTag | kExternalStringTag, | 467 kAsciiStringTag | kSymbolTag | kExternalStringTag, |
467 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, | 468 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, |
468 ASCII_STRING_TYPE = kAsciiStringTag | kSeqStringTag, | 469 ASCII_STRING_TYPE = kAsciiStringTag | kSeqStringTag, |
469 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, | 470 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, |
470 CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag, | 471 CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag, |
471 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, | 472 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, |
472 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = | 473 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = |
473 kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag, | 474 kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag, |
| 475 // LAST_STRING_TYPE |
474 EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag, | 476 EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag, |
475 PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE, | 477 PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE, |
476 | 478 |
477 // Objects allocated in their own spaces (never in new space). | 479 // Objects allocated in their own spaces (never in new space). |
478 MAP_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE | 480 MAP_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE |
479 CODE_TYPE, | 481 CODE_TYPE, |
480 ODDBALL_TYPE, | 482 ODDBALL_TYPE, |
481 JS_GLOBAL_PROPERTY_CELL_TYPE, | 483 JS_GLOBAL_PROPERTY_CELL_TYPE, |
482 | 484 |
483 // "Data", objects that cannot contain non-map-word pointers to heap | 485 // "Data", objects that cannot contain non-map-word pointers to heap |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 JS_ARRAY_TYPE, | 527 JS_ARRAY_TYPE, |
526 JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE | 528 JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE |
527 | 529 |
528 JS_FUNCTION_TYPE, | 530 JS_FUNCTION_TYPE, |
529 | 531 |
530 // Pseudo-types | 532 // Pseudo-types |
531 FIRST_TYPE = 0x0, | 533 FIRST_TYPE = 0x0, |
532 LAST_TYPE = JS_FUNCTION_TYPE, | 534 LAST_TYPE = JS_FUNCTION_TYPE, |
533 INVALID_TYPE = FIRST_TYPE - 1, | 535 INVALID_TYPE = FIRST_TYPE - 1, |
534 FIRST_NONSTRING_TYPE = MAP_TYPE, | 536 FIRST_NONSTRING_TYPE = MAP_TYPE, |
| 537 FIRST_STRING_TYPE = FIRST_TYPE, |
| 538 LAST_STRING_TYPE = FIRST_NONSTRING_TYPE - 1, |
535 // Boundaries for testing for an external array. | 539 // Boundaries for testing for an external array. |
536 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE, | 540 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE, |
537 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_FLOAT_ARRAY_TYPE, | 541 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_FLOAT_ARRAY_TYPE, |
538 // Boundary for promotion to old data space/old pointer space. | 542 // Boundary for promotion to old data space/old pointer space. |
539 LAST_DATA_TYPE = FILLER_TYPE, | 543 LAST_DATA_TYPE = FILLER_TYPE, |
540 // Boundaries for testing the type is a JavaScript "object". Note that | 544 // Boundaries for testing the type is a JavaScript "object". Note that |
541 // function objects are not counted as objects, even though they are | 545 // function objects are not counted as objects, even though they are |
542 // implemented as such; only values whose typeof is "object" are included. | 546 // implemented as such; only values whose typeof is "object" are included. |
543 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, | 547 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, |
544 LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE | 548 LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE |
(...skipping 5864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6409 } else { | 6413 } else { |
6410 value &= ~(1 << bit_position); | 6414 value &= ~(1 << bit_position); |
6411 } | 6415 } |
6412 return value; | 6416 return value; |
6413 } | 6417 } |
6414 }; | 6418 }; |
6415 | 6419 |
6416 } } // namespace v8::internal | 6420 } } // namespace v8::internal |
6417 | 6421 |
6418 #endif // V8_OBJECTS_H_ | 6422 #endif // V8_OBJECTS_H_ |
OLD | NEW |