Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: src/ppc/macro-assembler-ppc.h

Issue 1162993006: Add support for Embedded Constant Pools for PPC and Arm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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. 105 // Returns the size of a call in instructions. Note, the value returned is
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.
106 static int CallSize(Register target); 108 static int CallSize(Register target);
107 int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al); 109 int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al);
108 static int CallSizeNotPredictableCodeSize(Address target, 110 static int CallSizeNotPredictableCodeSize(Address target,
109 RelocInfo::Mode rmode, 111 RelocInfo::Mode rmode,
110 Condition cond = al); 112 Condition cond = al);
111 113
112 // Jump, Call, and Ret pseudo instructions implementing inter-working. 114 // Jump, Call, and Ret pseudo instructions implementing inter-working.
113 void Jump(Register target); 115 void Jump(Register target);
114 void JumpToJSEntry(Register target); 116 void JumpToJSEntry(Register target);
115 void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al, 117 void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al,
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 Label* failure); 1355 Label* failure);
1354 1356
1355 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name); 1357 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
1356 1358
1357 void EmitSeqStringSetCharCheck(Register string, Register index, 1359 void EmitSeqStringSetCharCheck(Register string, Register index,
1358 Register value, uint32_t encoding_mask); 1360 Register value, uint32_t encoding_mask);
1359 1361
1360 // --------------------------------------------------------------------------- 1362 // ---------------------------------------------------------------------------
1361 // Patching helpers. 1363 // Patching helpers.
1362 1364
1363 // Retrieve/patch the relocated value (lis/ori pair). 1365 // Retrieve/patch the relocated value (lis/ori pair or constant pool load).
1364 void GetRelocatedValue(Register location, Register result, Register scratch); 1366 void GetRelocatedValue(Register location, Register result, Register scratch);
1365 void SetRelocatedValue(Register location, Register scratch, 1367 void SetRelocatedValue(Register location, Register scratch,
1366 Register new_value); 1368 Register new_value);
1367 1369
1368 void ClampUint8(Register output_reg, Register input_reg); 1370 void ClampUint8(Register output_reg, Register input_reg);
1369 1371
1370 // Saturate a value into 8-bit unsigned integer 1372 // Saturate a value into 8-bit unsigned integer
1371 // if input_value < 0, output_value is 0 1373 // if input_value < 0, output_value is 0
1372 // if input_value > 255, output_value is 255 1374 // if input_value > 255, output_value is 255
1373 // otherwise output_value is the (int)input_value (round to nearest) 1375 // otherwise output_value is the (int)input_value (round to nearest)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, 1444 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg,
1443 &no_memento_found); 1445 &no_memento_found);
1444 beq(memento_found); 1446 beq(memento_found);
1445 bind(&no_memento_found); 1447 bind(&no_memento_found);
1446 } 1448 }
1447 1449
1448 // Jumps to found label if a prototype map has dictionary elements. 1450 // Jumps to found label if a prototype map has dictionary elements.
1449 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, 1451 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0,
1450 Register scratch1, Label* found); 1452 Register scratch1, Label* found);
1451 1453
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
1452 private: 1467 private:
1453 static const int kSmiShift = kSmiTagSize + kSmiShiftSize; 1468 static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
1454 1469
1455 void CallCFunctionHelper(Register function, int num_reg_arguments, 1470 void CallCFunctionHelper(Register function, int num_reg_arguments,
1456 int num_double_arguments); 1471 int num_double_arguments);
1457 1472
1458 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al, 1473 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al,
1459 CRegister cr = cr7); 1474 CRegister cr = cr7);
1460 1475
1461 // Helper functions for generating invokes. 1476 // Helper functions for generating invokes.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 #define ACCESS_MASM(masm) \ 1564 #define ACCESS_MASM(masm) \
1550 masm->stop(__FILE_LINE__); \ 1565 masm->stop(__FILE_LINE__); \
1551 masm-> 1566 masm->
1552 #else 1567 #else
1553 #define ACCESS_MASM(masm) masm-> 1568 #define ACCESS_MASM(masm) masm->
1554 #endif 1569 #endif
1555 } 1570 }
1556 } // namespace v8::internal 1571 } // namespace v8::internal
1557 1572
1558 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ 1573 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698