OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM_MACRO_ASSEMBLER_ARM_H_ | 5 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
6 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 6 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
7 | 7 |
8 #include "assembler.h" | 8 #include "assembler.h" |
9 #include "frames.h" | 9 #include "frames.h" |
10 #include "globals.h" | 10 #include "globals.h" |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 DwVfpRegister input_reg, | 1350 DwVfpRegister input_reg, |
1351 LowDwVfpRegister double_scratch); | 1351 LowDwVfpRegister double_scratch); |
1352 | 1352 |
1353 | 1353 |
1354 void LoadInstanceDescriptors(Register map, Register descriptors); | 1354 void LoadInstanceDescriptors(Register map, Register descriptors); |
1355 void EnumLength(Register dst, Register map); | 1355 void EnumLength(Register dst, Register map); |
1356 void NumberOfOwnDescriptors(Register dst, Register map); | 1356 void NumberOfOwnDescriptors(Register dst, Register map); |
1357 | 1357 |
1358 template<typename Field> | 1358 template<typename Field> |
1359 void DecodeField(Register dst, Register src) { | 1359 void DecodeField(Register dst, Register src) { |
1360 static const int shift = Field::kShift; | 1360 Ubfx(dst, src, Field::kShift, Field::kSize); |
1361 static const int mask = Field::kMask >> shift; | |
1362 static const int size = Field::kSize; | |
1363 mov(dst, Operand(src, LSR, shift)); | |
1364 if (shift + size != 32) { | |
1365 and_(dst, dst, Operand(mask)); | |
1366 } | |
1367 } | 1361 } |
1368 | 1362 |
1369 template<typename Field> | 1363 template<typename Field> |
1370 void DecodeField(Register reg) { | 1364 void DecodeField(Register reg) { |
1371 DecodeField<Field>(reg, reg); | 1365 DecodeField<Field>(reg, reg); |
1372 } | 1366 } |
1373 | 1367 |
| 1368 template<typename Field> |
| 1369 void DecodeFieldToSmi(Register dst, Register src) { |
| 1370 static const int shift = Field::kShift; |
| 1371 static const int mask = Field::kMask >> shift << kSmiTagSize; |
| 1372 STATIC_ASSERT((mask & (0x80000000u >> (kSmiTagSize - 1))) == 0); |
| 1373 STATIC_ASSERT(kSmiTag == 0); |
| 1374 if (shift < kSmiTagSize) { |
| 1375 mov(dst, Operand(src, LSL, kSmiTagSize - shift)); |
| 1376 and_(dst, dst, Operand(mask)); |
| 1377 } else if (shift > kSmiTagSize) { |
| 1378 mov(dst, Operand(src, LSR, shift - kSmiTagSize)); |
| 1379 and_(dst, dst, Operand(mask)); |
| 1380 } else { |
| 1381 and_(dst, src, Operand(mask)); |
| 1382 } |
| 1383 } |
| 1384 |
| 1385 template<typename Field> |
| 1386 void DecodeFieldToSmi(Register reg) { |
| 1387 DecodeField<Field>(reg, reg); |
| 1388 } |
| 1389 |
1374 // Activation support. | 1390 // Activation support. |
1375 void EnterFrame(StackFrame::Type type, bool load_constant_pool = false); | 1391 void EnterFrame(StackFrame::Type type, bool load_constant_pool = false); |
1376 // Returns the pc offset at which the frame ends. | 1392 // Returns the pc offset at which the frame ends. |
1377 int LeaveFrame(StackFrame::Type type); | 1393 int LeaveFrame(StackFrame::Type type); |
1378 | 1394 |
1379 // Expects object in r0 and returns map with validated enum cache | 1395 // Expects object in r0 and returns map with validated enum cache |
1380 // in r0. Assumes that any other register can be used as a scratch. | 1396 // in r0. Assumes that any other register can be used as a scratch. |
1381 void CheckEnumCache(Register null_value, Label* call_runtime); | 1397 void CheckEnumCache(Register null_value, Label* call_runtime); |
1382 | 1398 |
1383 // AllocationMemento support. Arrays may have an associated | 1399 // AllocationMemento support. Arrays may have an associated |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1601 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1586 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1602 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1587 #else | 1603 #else |
1588 #define ACCESS_MASM(masm) masm-> | 1604 #define ACCESS_MASM(masm) masm-> |
1589 #endif | 1605 #endif |
1590 | 1606 |
1591 | 1607 |
1592 } } // namespace v8::internal | 1608 } } // namespace v8::internal |
1593 | 1609 |
1594 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1610 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |