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_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #include "assembler.h" | 8 #include "assembler.h" |
9 #include "mips/assembler-mips.h" | 9 #include "mips/assembler-mips.h" |
10 #include "globals.h" | 10 #include "globals.h" |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 DoubleRegister input_reg, | 1478 DoubleRegister input_reg, |
1479 DoubleRegister temp_double_reg); | 1479 DoubleRegister temp_double_reg); |
1480 | 1480 |
1481 | 1481 |
1482 void LoadInstanceDescriptors(Register map, Register descriptors); | 1482 void LoadInstanceDescriptors(Register map, Register descriptors); |
1483 void EnumLength(Register dst, Register map); | 1483 void EnumLength(Register dst, Register map); |
1484 void NumberOfOwnDescriptors(Register dst, Register map); | 1484 void NumberOfOwnDescriptors(Register dst, Register map); |
1485 | 1485 |
1486 template<typename Field> | 1486 template<typename Field> |
1487 void DecodeField(Register dst, Register src) { | 1487 void DecodeField(Register dst, Register src) { |
1488 static const int shift = Field::kShift; | 1488 Ext(dst, src, Field::kShift, Field::kSize); |
1489 static const int mask = Field::kMask >> shift; | |
1490 static const int size = Field::kSize; | |
1491 srl(dst, src, shift); | |
1492 if (shift + size != 32) { | |
1493 And(dst, dst, Operand(mask)); | |
1494 } | |
1495 } | 1489 } |
1496 | 1490 |
1497 template<typename Field> | 1491 template<typename Field> |
1498 void DecodeField(Register reg) { | 1492 void DecodeField(Register reg) { |
1499 DecodeField<Field>(reg, reg); | 1493 DecodeField<Field>(reg, reg); |
1500 } | 1494 } |
1501 | 1495 |
| 1496 template<typename Field> |
| 1497 void DecodeFieldToSmi(Register dst, Register src) { |
| 1498 static const int shift = Field::kShift; |
| 1499 static const int mask = Field::kMask >> shift << kSmiTagSize; |
| 1500 STATIC_ASSERT((mask & (0x80000000u >> (kSmiTagSize - 1))) == 0); |
| 1501 STATIC_ASSERT(kSmiTag == 0); |
| 1502 if (shift < kSmiTagSize) { |
| 1503 sll(dst, src, kSmiTagSize - shift); |
| 1504 And(dst, dst, Operand(mask)); |
| 1505 } else if (shift > kSmiTagSize) { |
| 1506 srl(dst, src, shift - kSmiTagSize); |
| 1507 And(dst, dst, Operand(mask)); |
| 1508 } else { |
| 1509 And(dst, src, Operand(mask)); |
| 1510 } |
| 1511 } |
| 1512 |
| 1513 template<typename Field> |
| 1514 void DecodeFieldToSmi(Register reg) { |
| 1515 DecodeField<Field>(reg, reg); |
| 1516 } |
| 1517 |
1502 // Generates function and stub prologue code. | 1518 // Generates function and stub prologue code. |
1503 void StubPrologue(); | 1519 void StubPrologue(); |
1504 void Prologue(bool code_pre_aging); | 1520 void Prologue(bool code_pre_aging); |
1505 | 1521 |
1506 // Activation support. | 1522 // Activation support. |
1507 void EnterFrame(StackFrame::Type type); | 1523 void EnterFrame(StackFrame::Type type); |
1508 void LeaveFrame(StackFrame::Type type); | 1524 void LeaveFrame(StackFrame::Type type); |
1509 | 1525 |
1510 // Patch the relocated value (lui/ori pair). | 1526 // Patch the relocated value (lui/ori pair). |
1511 void PatchRelocatedValue(Register li_location, | 1527 void PatchRelocatedValue(Register li_location, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1676 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1661 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1677 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1662 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1678 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1663 #else | 1679 #else |
1664 #define ACCESS_MASM(masm) masm-> | 1680 #define ACCESS_MASM(masm) masm-> |
1665 #endif | 1681 #endif |
1666 | 1682 |
1667 } } // namespace v8::internal | 1683 } } // namespace v8::internal |
1668 | 1684 |
1669 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1685 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |