| 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 783 |
| 784 // Returns true if this object is an instance of the specified | 784 // Returns true if this object is an instance of the specified |
| 785 // function template. | 785 // function template. |
| 786 inline bool IsInstanceOf(FunctionTemplateInfo* type); | 786 inline bool IsInstanceOf(FunctionTemplateInfo* type); |
| 787 | 787 |
| 788 inline bool IsStruct(); | 788 inline bool IsStruct(); |
| 789 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); | 789 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); |
| 790 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 790 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
| 791 #undef DECLARE_STRUCT_PREDICATE | 791 #undef DECLARE_STRUCT_PREDICATE |
| 792 | 792 |
| 793 INLINE(bool IsSpecObject()); |
| 794 |
| 793 // Oddball testing. | 795 // Oddball testing. |
| 794 INLINE(bool IsUndefined()); | 796 INLINE(bool IsUndefined()); |
| 795 INLINE(bool IsNull()); | 797 INLINE(bool IsNull()); |
| 796 INLINE(bool IsTheHole()); // Shadows MaybeObject's implementation. | 798 INLINE(bool IsTheHole()); // Shadows MaybeObject's implementation. |
| 797 INLINE(bool IsTrue()); | 799 INLINE(bool IsTrue()); |
| 798 INLINE(bool IsFalse()); | 800 INLINE(bool IsFalse()); |
| 799 inline bool IsArgumentsMarker(); | 801 inline bool IsArgumentsMarker(); |
| 800 | 802 |
| 801 // Extract the number. | 803 // Extract the number. |
| 802 inline double Number(); | 804 inline double Number(); |
| (...skipping 2670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3473 BUILTIN, | 3475 BUILTIN, |
| 3474 LOAD_IC, | 3476 LOAD_IC, |
| 3475 KEYED_LOAD_IC, | 3477 KEYED_LOAD_IC, |
| 3476 CALL_IC, | 3478 CALL_IC, |
| 3477 KEYED_CALL_IC, | 3479 KEYED_CALL_IC, |
| 3478 STORE_IC, | 3480 STORE_IC, |
| 3479 KEYED_STORE_IC, | 3481 KEYED_STORE_IC, |
| 3480 UNARY_OP_IC, | 3482 UNARY_OP_IC, |
| 3481 BINARY_OP_IC, | 3483 BINARY_OP_IC, |
| 3482 COMPARE_IC, | 3484 COMPARE_IC, |
| 3485 TO_BOOLEAN_IC, |
| 3483 // No more than 16 kinds. The value currently encoded in four bits in | 3486 // No more than 16 kinds. The value currently encoded in four bits in |
| 3484 // Flags. | 3487 // Flags. |
| 3485 | 3488 |
| 3486 // Pseudo-kinds. | 3489 // Pseudo-kinds. |
| 3487 REGEXP = BUILTIN, | 3490 REGEXP = BUILTIN, |
| 3488 FIRST_IC_KIND = LOAD_IC, | 3491 FIRST_IC_KIND = LOAD_IC, |
| 3489 LAST_IC_KIND = COMPARE_IC | 3492 LAST_IC_KIND = TO_BOOLEAN_IC |
| 3490 }; | 3493 }; |
| 3491 | 3494 |
| 3492 enum { | 3495 enum { |
| 3493 NUMBER_OF_KINDS = LAST_IC_KIND + 1 | 3496 NUMBER_OF_KINDS = LAST_IC_KIND + 1 |
| 3494 }; | 3497 }; |
| 3495 | 3498 |
| 3496 typedef int ExtraICState; | 3499 typedef int ExtraICState; |
| 3497 | 3500 |
| 3498 static const ExtraICState kNoExtraICState = 0; | 3501 static const ExtraICState kNoExtraICState = 0; |
| 3499 | 3502 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3545 inline int arguments_count(); // Only valid for call IC stubs. | 3548 inline int arguments_count(); // Only valid for call IC stubs. |
| 3546 | 3549 |
| 3547 // Testers for IC stub kinds. | 3550 // Testers for IC stub kinds. |
| 3548 inline bool is_inline_cache_stub(); | 3551 inline bool is_inline_cache_stub(); |
| 3549 inline bool is_load_stub() { return kind() == LOAD_IC; } | 3552 inline bool is_load_stub() { return kind() == LOAD_IC; } |
| 3550 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 3553 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
| 3551 inline bool is_store_stub() { return kind() == STORE_IC; } | 3554 inline bool is_store_stub() { return kind() == STORE_IC; } |
| 3552 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 3555 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
| 3553 inline bool is_call_stub() { return kind() == CALL_IC; } | 3556 inline bool is_call_stub() { return kind() == CALL_IC; } |
| 3554 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } | 3557 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } |
| 3555 inline bool is_unary_op_stub() { | 3558 inline bool is_unary_op_stub() { return kind() == UNARY_OP_IC; } |
| 3556 return kind() == UNARY_OP_IC; | 3559 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } |
| 3557 } | |
| 3558 inline bool is_binary_op_stub() { | |
| 3559 return kind() == BINARY_OP_IC; | |
| 3560 } | |
| 3561 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } | 3560 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } |
| 3561 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } |
| 3562 | 3562 |
| 3563 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. | 3563 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. |
| 3564 inline int major_key(); | 3564 inline int major_key(); |
| 3565 inline void set_major_key(int value); | 3565 inline void set_major_key(int value); |
| 3566 | 3566 |
| 3567 // [optimizable]: For FUNCTION kind, tells if it is optimizable. | 3567 // [optimizable]: For FUNCTION kind, tells if it is optimizable. |
| 3568 inline bool optimizable(); | 3568 inline bool optimizable(); |
| 3569 inline void set_optimizable(bool value); | 3569 inline void set_optimizable(bool value); |
| 3570 | 3570 |
| 3571 // [has_deoptimization_support]: For FUNCTION kind, tells if it has | 3571 // [has_deoptimization_support]: For FUNCTION kind, tells if it has |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3593 // [stack_check_table_start]: For kind FUNCTION, the offset in the | 3593 // [stack_check_table_start]: For kind FUNCTION, the offset in the |
| 3594 // instruction stream where the stack check table starts. | 3594 // instruction stream where the stack check table starts. |
| 3595 inline unsigned stack_check_table_offset(); | 3595 inline unsigned stack_check_table_offset(); |
| 3596 inline void set_stack_check_table_offset(unsigned offset); | 3596 inline void set_stack_check_table_offset(unsigned offset); |
| 3597 | 3597 |
| 3598 // [check type]: For kind CALL_IC, tells how to check if the | 3598 // [check type]: For kind CALL_IC, tells how to check if the |
| 3599 // receiver is valid for the given call. | 3599 // receiver is valid for the given call. |
| 3600 inline CheckType check_type(); | 3600 inline CheckType check_type(); |
| 3601 inline void set_check_type(CheckType value); | 3601 inline void set_check_type(CheckType value); |
| 3602 | 3602 |
| 3603 // [type-recording unary op type]: For all UNARY_OP_IC. | 3603 // [type-recording unary op type]: For kind UNARY_OP_IC. |
| 3604 inline byte unary_op_type(); | 3604 inline byte unary_op_type(); |
| 3605 inline void set_unary_op_type(byte value); | 3605 inline void set_unary_op_type(byte value); |
| 3606 | 3606 |
| 3607 // [type-recording binary op type]: For all TYPE_RECORDING_BINARY_OP_IC. | 3607 // [type-recording binary op type]: For kind BINARY_OP_IC. |
| 3608 inline byte binary_op_type(); | 3608 inline byte binary_op_type(); |
| 3609 inline void set_binary_op_type(byte value); | 3609 inline void set_binary_op_type(byte value); |
| 3610 inline byte binary_op_result_type(); | 3610 inline byte binary_op_result_type(); |
| 3611 inline void set_binary_op_result_type(byte value); | 3611 inline void set_binary_op_result_type(byte value); |
| 3612 | 3612 |
| 3613 // [compare state]: For kind compare IC stubs, tells what state the | 3613 // [compare state]: For kind COMPARE_IC, tells what state the stub is in. |
| 3614 // stub is in. | |
| 3615 inline byte compare_state(); | 3614 inline byte compare_state(); |
| 3616 inline void set_compare_state(byte value); | 3615 inline void set_compare_state(byte value); |
| 3617 | 3616 |
| 3617 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. |
| 3618 inline byte to_boolean_state(); |
| 3619 inline void set_to_boolean_state(byte value); |
| 3620 |
| 3618 // Get the safepoint entry for the given pc. | 3621 // Get the safepoint entry for the given pc. |
| 3619 SafepointEntry GetSafepointEntry(Address pc); | 3622 SafepointEntry GetSafepointEntry(Address pc); |
| 3620 | 3623 |
| 3621 // Mark this code object as not having a stack check table. Assumes kind | 3624 // Mark this code object as not having a stack check table. Assumes kind |
| 3622 // is FUNCTION. | 3625 // is FUNCTION. |
| 3623 void SetNoStackCheckTable(); | 3626 void SetNoStackCheckTable(); |
| 3624 | 3627 |
| 3625 // Find the first map in an IC stub. | 3628 // Find the first map in an IC stub. |
| 3626 Map* FindFirstMap(); | 3629 Map* FindFirstMap(); |
| 3627 | 3630 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3749 // the Code object header. | 3752 // the Code object header. |
| 3750 static const int kHeaderSize = | 3753 static const int kHeaderSize = |
| 3751 (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask; | 3754 (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask; |
| 3752 | 3755 |
| 3753 // Byte offsets within kKindSpecificFlagsOffset. | 3756 // Byte offsets within kKindSpecificFlagsOffset. |
| 3754 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset; | 3757 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset; |
| 3755 static const int kOptimizableOffset = kKindSpecificFlagsOffset; | 3758 static const int kOptimizableOffset = kKindSpecificFlagsOffset; |
| 3756 static const int kStackSlotsOffset = kKindSpecificFlagsOffset; | 3759 static const int kStackSlotsOffset = kKindSpecificFlagsOffset; |
| 3757 static const int kCheckTypeOffset = kKindSpecificFlagsOffset; | 3760 static const int kCheckTypeOffset = kKindSpecificFlagsOffset; |
| 3758 | 3761 |
| 3759 static const int kCompareStateOffset = kStubMajorKeyOffset + 1; | |
| 3760 static const int kUnaryOpTypeOffset = kStubMajorKeyOffset + 1; | 3762 static const int kUnaryOpTypeOffset = kStubMajorKeyOffset + 1; |
| 3761 static const int kBinaryOpTypeOffset = kStubMajorKeyOffset + 1; | 3763 static const int kBinaryOpTypeOffset = kStubMajorKeyOffset + 1; |
| 3764 static const int kCompareStateOffset = kStubMajorKeyOffset + 1; |
| 3765 static const int kToBooleanTypeOffset = kStubMajorKeyOffset + 1; |
| 3762 static const int kHasDeoptimizationSupportOffset = kOptimizableOffset + 1; | 3766 static const int kHasDeoptimizationSupportOffset = kOptimizableOffset + 1; |
| 3763 | 3767 |
| 3764 static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1; | 3768 static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1; |
| 3765 static const int kAllowOSRAtLoopNestingLevelOffset = | 3769 static const int kAllowOSRAtLoopNestingLevelOffset = |
| 3766 kHasDeoptimizationSupportOffset + 1; | 3770 kHasDeoptimizationSupportOffset + 1; |
| 3767 | 3771 |
| 3768 static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize; | 3772 static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize; |
| 3769 static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize; | 3773 static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize; |
| 3770 | 3774 |
| 3771 // Flags layout. | 3775 // Flags layout. |
| (...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7174 } else { | 7178 } else { |
| 7175 value &= ~(1 << bit_position); | 7179 value &= ~(1 << bit_position); |
| 7176 } | 7180 } |
| 7177 return value; | 7181 return value; |
| 7178 } | 7182 } |
| 7179 }; | 7183 }; |
| 7180 | 7184 |
| 7181 } } // namespace v8::internal | 7185 } } // namespace v8::internal |
| 7182 | 7186 |
| 7183 #endif // V8_OBJECTS_H_ | 7187 #endif // V8_OBJECTS_H_ |
| OLD | NEW |