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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // MacroAssembler implements a collection of frequently used macros. | 95 // MacroAssembler implements a collection of frequently used macros. |
96 class MacroAssembler : public Assembler { | 96 class MacroAssembler : public Assembler { |
97 public: | 97 public: |
98 // The isolate parameter can be NULL if the macro assembler should | 98 // The isolate parameter can be NULL if the macro assembler should |
99 // not use isolate-dependent functionality. In this case, it's the | 99 // not use isolate-dependent functionality. In this case, it's the |
100 // responsibility of the caller to never invoke such function on the | 100 // responsibility of the caller to never invoke such function on the |
101 // macro assembler. | 101 // macro assembler. |
102 MacroAssembler(Isolate* isolate, void* buffer, int size); | 102 MacroAssembler(Isolate* isolate, void* buffer, int size); |
103 | 103 |
104 | 104 |
105 // Returns the size of a call in instructions. Note, the value returned is | 105 // Returns the size of a call in instructions. |
106 // only valid as long as no entries are added to the constant pool between | |
107 // checking the call size and emitting the actual call. | |
108 static int CallSize(Register target); | 106 static int CallSize(Register target); |
109 int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al); | 107 int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al); |
110 static int CallSizeNotPredictableCodeSize(Address target, | 108 static int CallSizeNotPredictableCodeSize(Address target, |
111 RelocInfo::Mode rmode, | 109 RelocInfo::Mode rmode, |
112 Condition cond = al); | 110 Condition cond = al); |
113 | 111 |
114 // Jump, Call, and Ret pseudo instructions implementing inter-working. | 112 // Jump, Call, and Ret pseudo instructions implementing inter-working. |
115 void Jump(Register target); | 113 void Jump(Register target); |
116 void JumpToJSEntry(Register target); | 114 void JumpToJSEntry(Register target); |
117 void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al, | 115 void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al, |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 Label* failure); | 1353 Label* failure); |
1356 | 1354 |
1357 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name); | 1355 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name); |
1358 | 1356 |
1359 void EmitSeqStringSetCharCheck(Register string, Register index, | 1357 void EmitSeqStringSetCharCheck(Register string, Register index, |
1360 Register value, uint32_t encoding_mask); | 1358 Register value, uint32_t encoding_mask); |
1361 | 1359 |
1362 // --------------------------------------------------------------------------- | 1360 // --------------------------------------------------------------------------- |
1363 // Patching helpers. | 1361 // Patching helpers. |
1364 | 1362 |
1365 // Retrieve/patch the relocated value (lis/ori pair or constant pool load). | 1363 // Retrieve/patch the relocated value (lis/ori pair). |
1366 void GetRelocatedValue(Register location, Register result, Register scratch); | 1364 void GetRelocatedValue(Register location, Register result, Register scratch); |
1367 void SetRelocatedValue(Register location, Register scratch, | 1365 void SetRelocatedValue(Register location, Register scratch, |
1368 Register new_value); | 1366 Register new_value); |
1369 | 1367 |
1370 void ClampUint8(Register output_reg, Register input_reg); | 1368 void ClampUint8(Register output_reg, Register input_reg); |
1371 | 1369 |
1372 // Saturate a value into 8-bit unsigned integer | 1370 // Saturate a value into 8-bit unsigned integer |
1373 // if input_value < 0, output_value is 0 | 1371 // if input_value < 0, output_value is 0 |
1374 // if input_value > 255, output_value is 255 | 1372 // if input_value > 255, output_value is 255 |
1375 // otherwise output_value is the (int)input_value (round to nearest) | 1373 // otherwise output_value is the (int)input_value (round to nearest) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, | 1442 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, |
1445 &no_memento_found); | 1443 &no_memento_found); |
1446 beq(memento_found); | 1444 beq(memento_found); |
1447 bind(&no_memento_found); | 1445 bind(&no_memento_found); |
1448 } | 1446 } |
1449 | 1447 |
1450 // Jumps to found label if a prototype map has dictionary elements. | 1448 // Jumps to found label if a prototype map has dictionary elements. |
1451 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, | 1449 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, |
1452 Register scratch1, Label* found); | 1450 Register scratch1, Label* found); |
1453 | 1451 |
1454 // Loads the constant pool pointer (kConstantPoolRegister). | |
1455 void LoadConstantPoolPointerRegisterFromCodeTargetAddress( | |
1456 Register code_target_address); | |
1457 void LoadConstantPoolPointerRegister(); | |
1458 void LoadConstantPoolPointerRegister(Register base, int code_entry_delta = 0); | |
1459 | |
1460 void AbortConstantPoolBuilding() { | |
1461 #ifdef DEBUG | |
1462 // Avoid DCHECK(!is_linked()) failure in ~Label() | |
1463 bind(ConstantPoolPosition()); | |
1464 #endif | |
1465 } | |
1466 | |
1467 private: | 1452 private: |
1468 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; | 1453 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; |
1469 | 1454 |
1470 void CallCFunctionHelper(Register function, int num_reg_arguments, | 1455 void CallCFunctionHelper(Register function, int num_reg_arguments, |
1471 int num_double_arguments); | 1456 int num_double_arguments); |
1472 | 1457 |
1473 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al, | 1458 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al, |
1474 CRegister cr = cr7); | 1459 CRegister cr = cr7); |
1475 | 1460 |
1476 // Helper functions for generating invokes. | 1461 // Helper functions for generating invokes. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 #define ACCESS_MASM(masm) \ | 1549 #define ACCESS_MASM(masm) \ |
1565 masm->stop(__FILE_LINE__); \ | 1550 masm->stop(__FILE_LINE__); \ |
1566 masm-> | 1551 masm-> |
1567 #else | 1552 #else |
1568 #define ACCESS_MASM(masm) masm-> | 1553 #define ACCESS_MASM(masm) masm-> |
1569 #endif | 1554 #endif |
1570 } | 1555 } |
1571 } // namespace v8::internal | 1556 } // namespace v8::internal |
1572 | 1557 |
1573 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 1558 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
OLD | NEW |