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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug-mode Arm issue. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm64/assembler-arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 31d2f7335264fc5b47b8e3385c95edaa229a1f09..61b59edf868c08b11cd80ef246550d679f2df753 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -691,21 +691,17 @@ void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
void MacroAssembler::PushFixedFrame(Register marker_reg) {
DCHECK(!marker_reg.is_valid() || marker_reg.code() < cp.code());
- stm(db_w, sp, (marker_reg.is_valid() ? marker_reg.bit() : 0) |
- cp.bit() |
- (FLAG_enable_ool_constant_pool ? pp.bit() : 0) |
- fp.bit() |
- lr.bit());
+ stm(db_w, sp, (marker_reg.is_valid() ? marker_reg.bit() : 0) | cp.bit() |
+ (FLAG_enable_embedded_constant_pool ? pp.bit() : 0) |
+ fp.bit() | lr.bit());
}
void MacroAssembler::PopFixedFrame(Register marker_reg) {
DCHECK(!marker_reg.is_valid() || marker_reg.code() < cp.code());
- ldm(ia_w, sp, (marker_reg.is_valid() ? marker_reg.bit() : 0) |
- cp.bit() |
- (FLAG_enable_ool_constant_pool ? pp.bit() : 0) |
- fp.bit() |
- lr.bit());
+ ldm(ia_w, sp, (marker_reg.is_valid() ? marker_reg.bit() : 0) | cp.bit() |
+ (FLAG_enable_embedded_constant_pool ? pp.bit() : 0) |
+ fp.bit() | lr.bit());
}
@@ -985,13 +981,20 @@ void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) {
}
+void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
+ Register code_target_address) {
+ DCHECK(FLAG_enable_embedded_constant_pool);
+ ldr(pp, MemOperand(code_target_address,
+ Code::kConstantPoolOffset - Code::kHeaderSize));
+ add(pp, pp, code_target_address);
+}
+
+
void MacroAssembler::LoadConstantPoolPointerRegister() {
- if (FLAG_enable_ool_constant_pool) {
- int constant_pool_offset = Code::kConstantPoolOffset - Code::kHeaderSize -
- pc_offset() - Instruction::kPCReadOffset;
- DCHECK(ImmediateFitsAddrMode2Instruction(constant_pool_offset));
- ldr(pp, MemOperand(pc, constant_pool_offset));
- }
+ DCHECK(FLAG_enable_embedded_constant_pool);
+ int entry_offset = pc_offset() + Instruction::kPCReadOffset;
+ sub(ip, pc, Operand(entry_offset));
+ LoadConstantPoolPointerRegisterFromCodeTargetAddress(ip);
}
@@ -1000,9 +1003,9 @@ void MacroAssembler::StubPrologue() {
Push(Smi::FromInt(StackFrame::STUB));
// Adjust FP to point to saved FP.
add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
LoadConstantPoolPointerRegister();
- set_ool_constant_pool_available(true);
+ set_constant_pool_available(true);
}
}
@@ -1025,9 +1028,9 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
}
}
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
LoadConstantPoolPointerRegister();
- set_ool_constant_pool_available(true);
+ set_constant_pool_available(true);
}
}
@@ -1036,7 +1039,7 @@ void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// r0-r3: preserved
PushFixedFrame();
- if (FLAG_enable_ool_constant_pool && load_constant_pool_pointer_reg) {
+ if (FLAG_enable_embedded_constant_pool && load_constant_pool_pointer_reg) {
LoadConstantPoolPointerRegister();
}
mov(ip, Operand(Smi::FromInt(type)));
@@ -1056,9 +1059,9 @@ int MacroAssembler::LeaveFrame(StackFrame::Type type) {
// Drop the execution stack down to the frame pointer and restore
// the caller frame pointer, return address and constant pool pointer
- // (if FLAG_enable_ool_constant_pool).
+ // (if FLAG_enable_embedded_constant_pool).
int frame_ends;
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
add(sp, fp, Operand(StandardFrameConstants::kConstantPoolOffset));
frame_ends = pc_offset();
ldm(ia_w, sp, pp.bit() | fp.bit() | lr.bit());
@@ -1084,7 +1087,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) {
mov(ip, Operand::Zero());
str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
}
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset));
}
mov(ip, Operand(CodeObject()));
@@ -1103,7 +1106,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) {
// fp - ExitFrameConstants::kFrameSize -
// DwVfpRegister::kMaxNumRegisters * kDoubleSize,
// since the sp slot, code slot and constant pool slot (if
- // FLAG_enable_ool_constant_pool) were pushed after the fp.
+ // FLAG_enable_embedded_constant_pool) were pushed after the fp.
}
// Reserve place for the return address and stack space and align the frame
@@ -1183,7 +1186,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
#endif
// Tear down the exit frame, pop the arguments, and return.
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
ldr(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset));
}
mov(sp, Operand(fp));
@@ -3402,7 +3405,7 @@ void MacroAssembler::GetRelocatedValueLocation(Register ldr_location,
Label small_constant_pool_load, load_result;
ldr(result, MemOperand(ldr_location));
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
// Check if this is an extended constant pool load.
and_(scratch, result, Operand(GetConsantPoolLoadMask()));
teq(scratch, Operand(GetConsantPoolLoadPattern()));
@@ -3456,7 +3459,7 @@ void MacroAssembler::GetRelocatedValueLocation(Register ldr_location,
bind(&load_result);
// Get the address of the constant.
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_embedded_constant_pool) {
add(result, pp, Operand(result));
} else {
add(result, ldr_location, Operand(result));
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm64/assembler-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698