OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ | 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ |
6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ | 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ |
7 | 7 |
8 #include <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 | 1297 |
1298 | 1298 |
1299 void MacroAssembler::InitializeRootRegister() { | 1299 void MacroAssembler::InitializeRootRegister() { |
1300 ExternalReference roots_array_start = | 1300 ExternalReference roots_array_start = |
1301 ExternalReference::roots_array_start(isolate()); | 1301 ExternalReference::roots_array_start(isolate()); |
1302 Mov(root, Operand(roots_array_start)); | 1302 Mov(root, Operand(roots_array_start)); |
1303 } | 1303 } |
1304 | 1304 |
1305 | 1305 |
1306 void MacroAssembler::SmiTag(Register dst, Register src) { | 1306 void MacroAssembler::SmiTag(Register dst, Register src) { |
| 1307 STATIC_ASSERT(kSmiValueSize + kSmiShift == kXRegSizeInBits); |
1307 ASSERT(dst.Is64Bits() && src.Is64Bits()); | 1308 ASSERT(dst.Is64Bits() && src.Is64Bits()); |
1308 Lsl(dst, src, kSmiShift); | 1309 Lsl(dst, src, kSmiShift); |
1309 } | 1310 } |
1310 | 1311 |
1311 | 1312 |
1312 void MacroAssembler::SmiTag(Register smi) { SmiTag(smi, smi); } | 1313 void MacroAssembler::SmiTag(Register smi) { SmiTag(smi, smi); } |
1313 | 1314 |
1314 | 1315 |
1315 void MacroAssembler::SmiUntag(Register dst, Register src) { | 1316 void MacroAssembler::SmiUntag(Register dst, Register src) { |
| 1317 STATIC_ASSERT(kSmiValueSize + kSmiShift == kXRegSizeInBits); |
1316 ASSERT(dst.Is64Bits() && src.Is64Bits()); | 1318 ASSERT(dst.Is64Bits() && src.Is64Bits()); |
1317 if (FLAG_enable_slow_asserts) { | 1319 if (FLAG_enable_slow_asserts) { |
1318 AssertSmi(src); | 1320 AssertSmi(src); |
1319 } | 1321 } |
1320 Asr(dst, src, kSmiShift); | 1322 Asr(dst, src, kSmiShift); |
1321 } | 1323 } |
1322 | 1324 |
1323 | 1325 |
1324 void MacroAssembler::SmiUntag(Register smi) { SmiUntag(smi, smi); } | 1326 void MacroAssembler::SmiUntag(Register smi) { SmiUntag(smi, smi); } |
1325 | 1327 |
(...skipping 14 matching lines...) Expand all Loading... |
1340 UntagMode mode) { | 1342 UntagMode mode) { |
1341 ASSERT(dst.Is32Bits() && src.Is64Bits()); | 1343 ASSERT(dst.Is32Bits() && src.Is64Bits()); |
1342 if (FLAG_enable_slow_asserts && (mode == kNotSpeculativeUntag)) { | 1344 if (FLAG_enable_slow_asserts && (mode == kNotSpeculativeUntag)) { |
1343 AssertSmi(src); | 1345 AssertSmi(src); |
1344 } | 1346 } |
1345 Scvtf(dst, src, kSmiShift); | 1347 Scvtf(dst, src, kSmiShift); |
1346 } | 1348 } |
1347 | 1349 |
1348 | 1350 |
1349 void MacroAssembler::SmiTagAndPush(Register src) { | 1351 void MacroAssembler::SmiTagAndPush(Register src) { |
1350 STATIC_ASSERT((kSmiShift == 32) && (kSmiTag == 0)); | 1352 STATIC_ASSERT((kSmiShift == kWRegSizeInBits) && |
| 1353 (kSmiValueSize == kWRegSizeInBits) && |
| 1354 (kSmiTag == 0)); |
1351 Push(src.W(), wzr); | 1355 Push(src.W(), wzr); |
1352 } | 1356 } |
1353 | 1357 |
1354 | 1358 |
1355 void MacroAssembler::SmiTagAndPush(Register src1, Register src2) { | 1359 void MacroAssembler::SmiTagAndPush(Register src1, Register src2) { |
1356 STATIC_ASSERT((kSmiShift == 32) && (kSmiTag == 0)); | 1360 STATIC_ASSERT((kSmiShift == kWRegSizeInBits) && |
| 1361 (kSmiValueSize == kWRegSizeInBits) && |
| 1362 (kSmiTag == 0)); |
1357 Push(src1.W(), wzr, src2.W(), wzr); | 1363 Push(src1.W(), wzr, src2.W(), wzr); |
1358 } | 1364 } |
1359 | 1365 |
1360 | 1366 |
1361 void MacroAssembler::JumpIfSmi(Register value, | 1367 void MacroAssembler::JumpIfSmi(Register value, |
1362 Label* smi_label, | 1368 Label* smi_label, |
1363 Label* not_smi_label) { | 1369 Label* not_smi_label) { |
1364 STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0)); | 1370 STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0)); |
1365 // Check if the tag bit is set. | 1371 // Check if the tag bit is set. |
1366 if (smi_label) { | 1372 if (smi_label) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 // characters are reserved for controlling features of the instrumentation. | 1703 // characters are reserved for controlling features of the instrumentation. |
1698 ASSERT(isprint(marker_name[0]) && isprint(marker_name[1])); | 1704 ASSERT(isprint(marker_name[0]) && isprint(marker_name[1])); |
1699 | 1705 |
1700 InstructionAccurateScope scope(this, 1); | 1706 InstructionAccurateScope scope(this, 1); |
1701 movn(xzr, (marker_name[1] << 8) | marker_name[0]); | 1707 movn(xzr, (marker_name[1] << 8) | marker_name[0]); |
1702 } | 1708 } |
1703 | 1709 |
1704 } } // namespace v8::internal | 1710 } } // namespace v8::internal |
1705 | 1711 |
1706 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ | 1712 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ |
OLD | NEW |