| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 inline MemOperand FieldMemOperand(Register object, int offset); | 55 inline MemOperand FieldMemOperand(Register object, int offset); |
| 56 inline MemOperand UntagSmiFieldMemOperand(Register object, int offset); | 56 inline MemOperand UntagSmiFieldMemOperand(Register object, int offset); |
| 57 | 57 |
| 58 // Generate a MemOperand for loading a SMI from memory. | 58 // Generate a MemOperand for loading a SMI from memory. |
| 59 inline MemOperand UntagSmiMemOperand(Register object, int offset); | 59 inline MemOperand UntagSmiMemOperand(Register object, int offset); |
| 60 | 60 |
| 61 | 61 |
| 62 // ---------------------------------------------------------------------------- | 62 // ---------------------------------------------------------------------------- |
| 63 // MacroAssembler | 63 // MacroAssembler |
| 64 | 64 |
| 65 enum PregenExpectation { MAYBE_PREGENERATED, EXPECT_PREGENERATED }; | |
| 66 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; | 65 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; |
| 67 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; | 66 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
| 68 enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved }; | 67 enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved }; |
| 69 enum TargetAddressStorageMode { | 68 enum TargetAddressStorageMode { |
| 70 CAN_INLINE_TARGET_ADDRESS, | 69 CAN_INLINE_TARGET_ADDRESS, |
| 71 NEVER_INLINE_TARGET_ADDRESS | 70 NEVER_INLINE_TARGET_ADDRESS |
| 72 }; | 71 }; |
| 73 enum UntagMode { kNotSpeculativeUntag, kSpeculativeUntag }; | 72 enum UntagMode { kNotSpeculativeUntag, kSpeculativeUntag }; |
| 74 enum ArrayHasHoles { kArrayCantHaveHoles, kArrayCanHaveHoles }; | 73 enum ArrayHasHoles { kArrayCantHaveHoles, kArrayCanHaveHoles }; |
| 75 enum CopyHint { kCopyUnknown, kCopyShort, kCopyLong }; | 74 enum CopyHint { kCopyUnknown, kCopyShort, kCopyLong }; |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 RelocInfo::Mode rmode, | 1088 RelocInfo::Mode rmode, |
| 1090 InvokeFlag flag, | 1089 InvokeFlag flag, |
| 1091 CallKind call_kind); | 1090 CallKind call_kind); |
| 1092 // Invoke the JavaScript function in the given register. | 1091 // Invoke the JavaScript function in the given register. |
| 1093 // Changes the current context to the context in the function before invoking. | 1092 // Changes the current context to the context in the function before invoking. |
| 1094 void InvokeFunction(Register function, | 1093 void InvokeFunction(Register function, |
| 1095 const ParameterCount& actual, | 1094 const ParameterCount& actual, |
| 1096 InvokeFlag flag, | 1095 InvokeFlag flag, |
| 1097 const CallWrapper& call_wrapper, | 1096 const CallWrapper& call_wrapper, |
| 1098 CallKind call_kind); | 1097 CallKind call_kind); |
| 1098 void InvokeFunction(Register function, |
| 1099 const ParameterCount& expected, |
| 1100 const ParameterCount& actual, |
| 1101 InvokeFlag flag, |
| 1102 const CallWrapper& call_wrapper, |
| 1103 CallKind call_kind); |
| 1099 void InvokeFunction(Handle<JSFunction> function, | 1104 void InvokeFunction(Handle<JSFunction> function, |
| 1100 const ParameterCount& expected, | 1105 const ParameterCount& expected, |
| 1101 const ParameterCount& actual, | 1106 const ParameterCount& actual, |
| 1102 InvokeFlag flag, | 1107 InvokeFlag flag, |
| 1103 const CallWrapper& call_wrapper, | 1108 const CallWrapper& call_wrapper, |
| 1104 CallKind call_kind, | 1109 CallKind call_kind); |
| 1105 Register function_reg = NoReg); | |
| 1106 | 1110 |
| 1107 | 1111 |
| 1108 // ---- Floating point helpers ---- | 1112 // ---- Floating point helpers ---- |
| 1109 | 1113 |
| 1110 enum ECMA262ToInt32Result { | 1114 enum ECMA262ToInt32Result { |
| 1111 // Provide an untagged int32_t which can be read using result.W(). That is, | 1115 // Provide an untagged int32_t which can be read using result.W(). That is, |
| 1112 // the upper 32 bits of result are undefined. | 1116 // the upper 32 bits of result are undefined. |
| 1113 INT32_IN_W, | 1117 INT32_IN_W, |
| 1114 | 1118 |
| 1115 // Provide an untagged int32_t which can be read using the 64-bit result | 1119 // Provide an untagged int32_t which can be read using the 64-bit result |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1132 Register heap_number, | 1136 Register heap_number, |
| 1133 Register scratch1, | 1137 Register scratch1, |
| 1134 Register scratch2, | 1138 Register scratch2, |
| 1135 DoubleRegister double_scratch, | 1139 DoubleRegister double_scratch, |
| 1136 ECMA262ToInt32Result format = INT32_IN_X); | 1140 ECMA262ToInt32Result format = INT32_IN_X); |
| 1137 | 1141 |
| 1138 // ---- Code generation helpers ---- | 1142 // ---- Code generation helpers ---- |
| 1139 | 1143 |
| 1140 void set_generating_stub(bool value) { generating_stub_ = value; } | 1144 void set_generating_stub(bool value) { generating_stub_ = value; } |
| 1141 bool generating_stub() const { return generating_stub_; } | 1145 bool generating_stub() const { return generating_stub_; } |
| 1142 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | |
| 1143 bool allow_stub_calls() const { return allow_stub_calls_; } | |
| 1144 #if DEBUG | 1146 #if DEBUG |
| 1145 void set_allow_macro_instructions(bool value) { | 1147 void set_allow_macro_instructions(bool value) { |
| 1146 allow_macro_instructions_ = value; | 1148 allow_macro_instructions_ = value; |
| 1147 } | 1149 } |
| 1148 bool allow_macro_instructions() const { return allow_macro_instructions_; } | 1150 bool allow_macro_instructions() const { return allow_macro_instructions_; } |
| 1149 #endif | 1151 #endif |
| 1150 bool use_real_aborts() const { return use_real_aborts_; } | 1152 bool use_real_aborts() const { return use_real_aborts_; } |
| 1151 void set_has_frame(bool value) { has_frame_ = value; } | 1153 void set_has_frame(bool value) { has_frame_ = value; } |
| 1152 bool has_frame() const { return has_frame_; } | 1154 bool has_frame() const { return has_frame_; } |
| 1153 bool AllowThisStubCall(CodeStub* stub); | 1155 bool AllowThisStubCall(CodeStub* stub); |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 // The offset is the offset from the start of the object, not the offset from | 1686 // The offset is the offset from the start of the object, not the offset from |
| 1685 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). | 1687 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). |
| 1686 void RecordWriteField( | 1688 void RecordWriteField( |
| 1687 Register object, | 1689 Register object, |
| 1688 int offset, | 1690 int offset, |
| 1689 Register value, | 1691 Register value, |
| 1690 Register scratch, | 1692 Register scratch, |
| 1691 LinkRegisterStatus lr_status, | 1693 LinkRegisterStatus lr_status, |
| 1692 SaveFPRegsMode save_fp, | 1694 SaveFPRegsMode save_fp, |
| 1693 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 1695 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 1694 SmiCheck smi_check = INLINE_SMI_CHECK, | 1696 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 1695 PregenExpectation pregen_expectation = MAYBE_PREGENERATED); | |
| 1696 | 1697 |
| 1697 // As above, but the offset has the tag presubtracted. For use with | 1698 // As above, but the offset has the tag presubtracted. For use with |
| 1698 // MemOperand(reg, off). | 1699 // MemOperand(reg, off). |
| 1699 inline void RecordWriteContextSlot( | 1700 inline void RecordWriteContextSlot( |
| 1700 Register context, | 1701 Register context, |
| 1701 int offset, | 1702 int offset, |
| 1702 Register value, | 1703 Register value, |
| 1703 Register scratch, | 1704 Register scratch, |
| 1704 LinkRegisterStatus lr_status, | 1705 LinkRegisterStatus lr_status, |
| 1705 SaveFPRegsMode save_fp, | 1706 SaveFPRegsMode save_fp, |
| 1706 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 1707 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 1707 SmiCheck smi_check = INLINE_SMI_CHECK, | 1708 SmiCheck smi_check = INLINE_SMI_CHECK) { |
| 1708 PregenExpectation pregen_expectation = MAYBE_PREGENERATED) { | |
| 1709 RecordWriteField(context, | 1709 RecordWriteField(context, |
| 1710 offset + kHeapObjectTag, | 1710 offset + kHeapObjectTag, |
| 1711 value, | 1711 value, |
| 1712 scratch, | 1712 scratch, |
| 1713 lr_status, | 1713 lr_status, |
| 1714 save_fp, | 1714 save_fp, |
| 1715 remembered_set_action, | 1715 remembered_set_action, |
| 1716 smi_check, | 1716 smi_check); |
| 1717 pregen_expectation); | |
| 1718 } | 1717 } |
| 1719 | 1718 |
| 1720 // For a given |object| notify the garbage collector that the slot |address| | 1719 // For a given |object| notify the garbage collector that the slot |address| |
| 1721 // has been written. |value| is the object being stored. The value and | 1720 // has been written. |value| is the object being stored. The value and |
| 1722 // address registers are clobbered by the operation. | 1721 // address registers are clobbered by the operation. |
| 1723 void RecordWrite( | 1722 void RecordWrite( |
| 1724 Register object, | 1723 Register object, |
| 1725 Register address, | 1724 Register address, |
| 1726 Register value, | 1725 Register value, |
| 1727 LinkRegisterStatus lr_status, | 1726 LinkRegisterStatus lr_status, |
| 1728 SaveFPRegsMode save_fp, | 1727 SaveFPRegsMode save_fp, |
| 1729 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 1728 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 1730 SmiCheck smi_check = INLINE_SMI_CHECK, | 1729 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 1731 PregenExpectation pregen_expecation = MAYBE_PREGENERATED); | |
| 1732 | 1730 |
| 1733 // Checks the color of an object. If the object is already grey or black | 1731 // Checks the color of an object. If the object is already grey or black |
| 1734 // then we just fall through, since it is already live. If it is white and | 1732 // then we just fall through, since it is already live. If it is white and |
| 1735 // we can determine that it doesn't need to be scanned, then we just mark it | 1733 // we can determine that it doesn't need to be scanned, then we just mark it |
| 1736 // black and fall through. For the rest we jump to the label so the | 1734 // black and fall through. For the rest we jump to the label so the |
| 1737 // incremental marker can fix its assumptions. | 1735 // incremental marker can fix its assumptions. |
| 1738 void EnsureNotWhite(Register object, | 1736 void EnsureNotWhite(Register object, |
| 1739 Register scratch1, | 1737 Register scratch1, |
| 1740 Register scratch2, | 1738 Register scratch2, |
| 1741 Register scratch3, | 1739 Register scratch3, |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 // | 2047 // |
| 2050 // This does not distinguish between +0 and -0, so if this distinction is | 2048 // This does not distinguish between +0 and -0, so if this distinction is |
| 2051 // important it must be checked separately. | 2049 // important it must be checked separately. |
| 2052 void TryConvertDoubleToInt(Register as_int, | 2050 void TryConvertDoubleToInt(Register as_int, |
| 2053 FPRegister value, | 2051 FPRegister value, |
| 2054 FPRegister scratch_d, | 2052 FPRegister scratch_d, |
| 2055 Label* on_successful_conversion, | 2053 Label* on_successful_conversion, |
| 2056 Label* on_failed_conversion = NULL); | 2054 Label* on_failed_conversion = NULL); |
| 2057 | 2055 |
| 2058 bool generating_stub_; | 2056 bool generating_stub_; |
| 2059 bool allow_stub_calls_; | |
| 2060 #if DEBUG | 2057 #if DEBUG |
| 2061 // Tell whether any of the macro instruction can be used. When false the | 2058 // Tell whether any of the macro instruction can be used. When false the |
| 2062 // MacroAssembler will assert if a method which can emit a variable number | 2059 // MacroAssembler will assert if a method which can emit a variable number |
| 2063 // of instructions is called. | 2060 // of instructions is called. |
| 2064 bool allow_macro_instructions_; | 2061 bool allow_macro_instructions_; |
| 2065 #endif | 2062 #endif |
| 2066 bool has_frame_; | 2063 bool has_frame_; |
| 2067 | 2064 |
| 2068 // The Abort method should call a V8 runtime function, but the CallRuntime | 2065 // The Abort method should call a V8 runtime function, but the CallRuntime |
| 2069 // mechanism depends on CEntryStub. If use_real_aborts is false, Abort will | 2066 // mechanism depends on CEntryStub. If use_real_aborts is false, Abort will |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 #error "Unsupported option" | 2197 #error "Unsupported option" |
| 2201 #define CODE_COVERAGE_STRINGIFY(x) #x | 2198 #define CODE_COVERAGE_STRINGIFY(x) #x |
| 2202 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2199 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 2203 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2200 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 2204 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2201 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 2205 #else | 2202 #else |
| 2206 #define ACCESS_MASM(masm) masm-> | 2203 #define ACCESS_MASM(masm) masm-> |
| 2207 #endif | 2204 #endif |
| 2208 | 2205 |
| 2209 #endif // V8_A64_MACRO_ASSEMBLER_A64_H_ | 2206 #endif // V8_A64_MACRO_ASSEMBLER_A64_H_ |
| OLD | NEW |