OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_MACRO_ASSEMBLER_PPC_H_ | 5 #ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 #define Div divw | 104 #define Div divw |
105 #endif | 105 #endif |
106 | 106 |
107 | 107 |
108 // MacroAssembler implements a collection of frequently used macros. | 108 // MacroAssembler implements a collection of frequently used macros. |
109 class MacroAssembler : public Assembler { | 109 class MacroAssembler : public Assembler { |
110 public: | 110 public: |
111 MacroAssembler(Isolate* isolate, void* buffer, int size, | 111 MacroAssembler(Isolate* isolate, void* buffer, int size, |
112 CodeObjectRequired create_code_object); | 112 CodeObjectRequired create_code_object); |
113 | 113 |
| 114 Isolate* isolate() const { return isolate_; } |
114 | 115 |
115 // Returns the size of a call in instructions. Note, the value returned is | 116 // Returns the size of a call in instructions. Note, the value returned is |
116 // only valid as long as no entries are added to the constant pool between | 117 // only valid as long as no entries are added to the constant pool between |
117 // checking the call size and emitting the actual call. | 118 // checking the call size and emitting the actual call. |
118 static int CallSize(Register target); | 119 static int CallSize(Register target); |
119 int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al); | 120 int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al); |
120 static int CallSizeNotPredictableCodeSize(Address target, | 121 static int CallSizeNotPredictableCodeSize(Address target, |
121 RelocInfo::Mode rmode, | 122 RelocInfo::Mode rmode, |
122 Condition cond = al); | 123 Condition cond = al); |
123 | 124 |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 static const RegList kSafepointSavedRegisters; | 1503 static const RegList kSafepointSavedRegisters; |
1503 static const int kNumSafepointSavedRegisters; | 1504 static const int kNumSafepointSavedRegisters; |
1504 | 1505 |
1505 // Compute memory operands for safepoint stack slots. | 1506 // Compute memory operands for safepoint stack slots. |
1506 static int SafepointRegisterStackIndex(int reg_code); | 1507 static int SafepointRegisterStackIndex(int reg_code); |
1507 MemOperand SafepointRegisterSlot(Register reg); | 1508 MemOperand SafepointRegisterSlot(Register reg); |
1508 MemOperand SafepointRegistersAndDoublesSlot(Register reg); | 1509 MemOperand SafepointRegistersAndDoublesSlot(Register reg); |
1509 | 1510 |
1510 bool generating_stub_; | 1511 bool generating_stub_; |
1511 bool has_frame_; | 1512 bool has_frame_; |
| 1513 Isolate* isolate_; |
1512 // This handle will be patched with the code object on installation. | 1514 // This handle will be patched with the code object on installation. |
1513 Handle<Object> code_object_; | 1515 Handle<Object> code_object_; |
1514 | 1516 |
1515 // Needs access to SafepointRegisterStackIndex for compiled frame | 1517 // Needs access to SafepointRegisterStackIndex for compiled frame |
1516 // traversal. | 1518 // traversal. |
1517 friend class StandardFrame; | 1519 friend class StandardFrame; |
1518 }; | 1520 }; |
1519 | 1521 |
1520 | |
1521 // The code patcher is used to patch (typically) small parts of code e.g. for | 1522 // The code patcher is used to patch (typically) small parts of code e.g. for |
1522 // debugging and other types of instrumentation. When using the code patcher | 1523 // debugging and other types of instrumentation. When using the code patcher |
1523 // the exact number of bytes specified must be emitted. It is not legal to emit | 1524 // the exact number of bytes specified must be emitted. It is not legal to emit |
1524 // relocation information. If any of these constraints are violated it causes | 1525 // relocation information. If any of these constraints are violated it causes |
1525 // an assertion to fail. | 1526 // an assertion to fail. |
1526 class CodePatcher { | 1527 class CodePatcher { |
1527 public: | 1528 public: |
1528 enum FlushICache { FLUSH, DONT_FLUSH }; | 1529 enum FlushICache { FLUSH, DONT_FLUSH }; |
1529 | 1530 |
1530 CodePatcher(Isolate* isolate, byte* address, int instructions, | 1531 CodePatcher(Isolate* isolate, byte* address, int instructions, |
(...skipping 29 matching lines...) Expand all Loading... |
1560 inline MemOperand NativeContextMemOperand() { | 1561 inline MemOperand NativeContextMemOperand() { |
1561 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); | 1562 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); |
1562 } | 1563 } |
1563 | 1564 |
1564 #define ACCESS_MASM(masm) masm-> | 1565 #define ACCESS_MASM(masm) masm-> |
1565 | 1566 |
1566 } // namespace internal | 1567 } // namespace internal |
1567 } // namespace v8 | 1568 } // namespace v8 |
1568 | 1569 |
1569 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 1570 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
OLD | NEW |