| Index: src/arm/assembler-arm.h
|
| diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
|
| index 4e5f84662d1bd62f58db60f69fa4a9bfe27c2005..b5bc34e36d65599acf25a5b07fe23f2613a134cc 100644
|
| --- a/src/arm/assembler-arm.h
|
| +++ b/src/arm/assembler-arm.h
|
| @@ -69,7 +69,39 @@ namespace internal {
|
| //
|
| // Core register
|
| struct Register {
|
| - bool is_valid() const { return 0 <= code_ && code_ < 16; }
|
| + static const int kNumRegisters = 16;
|
| + static const int kNumAllocatableRegisters = 8;
|
| +
|
| + static int ToAllocationIndex(Register reg) {
|
| + return reg.code();
|
| + }
|
| +
|
| + static Register FromAllocationIndex(int index) {
|
| + ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| + return from_code(index);
|
| + }
|
| +
|
| + static const char* AllocationIndexToString(int index) {
|
| + ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| + const char* const names[] = {
|
| + "r0",
|
| + "r1",
|
| + "r2",
|
| + "r3",
|
| + "r4",
|
| + "r5",
|
| + "r6",
|
| + "r7",
|
| + };
|
| + return names[index];
|
| + }
|
| +
|
| + static Register from_code(int code) {
|
| + Register r = { code };
|
| + return r;
|
| + }
|
| +
|
| + bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
|
| bool is(Register reg) const { return code_ == reg.code_; }
|
| int code() const {
|
| ASSERT(is_valid());
|
| @@ -132,6 +164,48 @@ struct SwVfpRegister {
|
|
|
| // Double word VFP register.
|
| struct DwVfpRegister {
|
| + // d0 has been excluded from allocation. This is following ia32
|
| + // where xmm0 is excluded. This should be revisited.
|
| + static const int kNumRegisters = 16;
|
| + static const int kNumAllocatableRegisters = 15;
|
| +
|
| + static int ToAllocationIndex(DwVfpRegister reg) {
|
| + ASSERT(reg.code() != 0);
|
| + return reg.code() - 1;
|
| + }
|
| +
|
| + static DwVfpRegister FromAllocationIndex(int index) {
|
| + ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| + return from_code(index + 1);
|
| + }
|
| +
|
| + static const char* AllocationIndexToString(int index) {
|
| + ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| + const char* const names[] = {
|
| + "d1",
|
| + "d2",
|
| + "d3",
|
| + "d4",
|
| + "d5",
|
| + "d6",
|
| + "d7",
|
| + "d8",
|
| + "d9",
|
| + "d10",
|
| + "d11",
|
| + "d12",
|
| + "d13",
|
| + "d14",
|
| + "d15"
|
| + };
|
| + return names[index];
|
| + }
|
| +
|
| + static DwVfpRegister from_code(int code) {
|
| + DwVfpRegister r = { code };
|
| + return r;
|
| + }
|
| +
|
| // Supporting d0 to d15, can be later extended to d31.
|
| bool is_valid() const { return 0 <= code_ && code_ < 16; }
|
| bool is(DwVfpRegister reg) const { return code_ == reg.code_; }
|
| @@ -167,6 +241,9 @@ struct DwVfpRegister {
|
| };
|
|
|
|
|
| +typedef DwVfpRegister DoubleRegister;
|
| +
|
| +
|
| // Support for the VFP registers s0 to s31 (d0 to d15).
|
| // Note that "s(N):s(N+1)" is the same as "d(N/2)".
|
| const SwVfpRegister s0 = { 0 };
|
| @@ -286,6 +363,9 @@ enum Coprocessor {
|
|
|
| // Condition field in instructions.
|
| enum Condition {
|
| + // any value < 0 is considered no_condition
|
| + no_condition = -1,
|
| +
|
| eq = 0 << 28, // Z set equal.
|
| ne = 1 << 28, // Z clear not equal.
|
| nz = 1 << 28, // Z clear not zero.
|
| @@ -527,7 +607,7 @@ class CpuFeatures {
|
| public:
|
| // Detect features of the target CPU. Set safe defaults if the serializer
|
| // is enabled (snapshots must be portable).
|
| - void Probe();
|
| + void Probe(bool portable);
|
|
|
| // Check whether a feature is supported by the target CPU.
|
| bool IsSupported(CpuFeature f) const {
|
| @@ -1161,15 +1241,20 @@ class Assembler : public Malloced {
|
| void RecordDebugBreakSlot();
|
|
|
| // Record a comment relocation entry that can be used by a disassembler.
|
| - // Use --debug_code to enable.
|
| + // Use --code-comments to enable.
|
| void RecordComment(const char* msg);
|
|
|
| + // Writes a single byte or word of data in the code stream. Used for
|
| + // inline tables, e.g., jump-tables.
|
| + void db(uint8_t data);
|
| + void dd(uint32_t data);
|
| +
|
| int pc_offset() const { return pc_ - buffer_; }
|
|
|
| PositionsRecorder* positions_recorder() { return &positions_recorder_; }
|
|
|
| bool can_peephole_optimize(int instructions) {
|
| - if (!FLAG_peephole_optimization) return false;
|
| + if (!allow_peephole_optimization_) return false;
|
| if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false;
|
| return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize;
|
| }
|
| @@ -1198,6 +1283,8 @@ class Assembler : public Malloced {
|
| static bool IsLdrPcImmediateOffset(Instr instr);
|
| static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
|
|
|
| + // Check if is time to emit a constant pool for pending reloc info entries
|
| + void CheckConstPool(bool force_emit, bool require_jump);
|
|
|
| protected:
|
| int buffer_space() const { return reloc_info_writer.pos() - pc_; }
|
| @@ -1214,9 +1301,6 @@ class Assembler : public Malloced {
|
| // Patch branch instruction at pos to branch to given branch target pos
|
| void target_at_put(int pos, int target_pos);
|
|
|
| - // Check if is time to emit a constant pool for pending reloc info entries
|
| - void CheckConstPool(bool force_emit, bool require_jump);
|
| -
|
| // Block the emission of the constant pool before pc_offset
|
| void BlockConstPoolBefore(int pc_offset) {
|
| if (no_const_pool_before_ < pc_offset) no_const_pool_before_ = pc_offset;
|
| @@ -1330,6 +1414,7 @@ class Assembler : public Malloced {
|
| friend class BlockConstPoolScope;
|
|
|
| PositionsRecorder positions_recorder_;
|
| + bool allow_peephole_optimization_;
|
| friend class PositionsRecorder;
|
| friend class EnsureSpace;
|
| };
|
|
|