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

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

Issue 88043002: Out-of-line constant pool on Arm: Stage 3 - Set Constant Pool Pointer on Function Entry (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Re-upload to fix code-review error. Created 7 years, 1 month 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
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 65962e7fb7f50c3b6da96de139dcc9d26c13f523..8804aea078474c5f938649eb694b72bd312a6cfe 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -602,6 +602,22 @@ void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
}
+void MacroAssembler::PushFixedFrame(Register marker_reg) {
+ ASSERT(!marker_reg.is_valid() || marker_reg.code() < pp.code());
+ stm(db_w, sp, (marker_reg.is_valid() ? marker_reg.bit() : 0) |
+ (FLAG_enable_ool_constant_pool ? pp.bit() : 0) |
+ cp.bit() | fp.bit() | lr.bit());
+}
+
+
+void MacroAssembler::PopFixedFrame(Register marker_reg) {
+ ASSERT(!marker_reg.is_valid() || marker_reg.code() < pp.code());
+ ldm(ia_w, sp, (marker_reg.is_valid() ? marker_reg.bit() : 0) |
+ (FLAG_enable_ool_constant_pool ? pp.bit() : 0) |
+ cp.bit() | fp.bit() | lr.bit());
+}
+
+
// Push and pop all registers that can hold pointers.
void MacroAssembler::PushSafepointRegisters() {
// Safepoints expect a block of contiguous register values starting with r0:
@@ -870,7 +886,7 @@ void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) {
void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
if (frame_mode == BUILD_STUB_FRAME) {
- stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
+ PushFixedFrame();
Push(Smi::FromInt(StackFrame::STUB));
// Adjust FP to point to saved FP.
add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
@@ -886,7 +902,7 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
ldr(pc, MemOperand(pc, -4));
emit_code_stub_address(stub);
} else {
- stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
+ PushFixedFrame(r1);
nop(ip.code());
// Adjust FP to point to saved FP.
add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
@@ -897,7 +913,7 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
void MacroAssembler::EnterFrame(StackFrame::Type type) {
// r0-r3: preserved
- stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
+ PushFixedFrame();
mov(ip, Operand(Smi::FromInt(type)));
push(ip);
mov(ip, Operand(CodeObject()));
@@ -1034,6 +1050,20 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles,
}
+void MacroAssembler::RestoreConstantPoolPointer() {
+ if (FLAG_enable_ool_constant_pool) {
+ ldr(pp, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset));
+ }
+}
+
+
+void MacroAssembler::LoadConstantPoolPointer(Register js_function) {
+ if (FLAG_enable_ool_constant_pool) {
+ ldr(pp, FieldMemOperand(js_function, JSFunction::kConstantPoolOffset));
+ }
+}
+
+
void MacroAssembler::GetCFunctionDoubleResult(const DwVfpRegister dst) {
if (use_eabi_hardfloat()) {
Move(dst, d0);
@@ -1217,6 +1247,7 @@ void MacroAssembler::InvokeFunction(Register fun,
ldr(code_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
+ LoadConstantPoolPointer(r1);
ldr(expected_reg,
FieldMemOperand(code_reg,
SharedFunctionInfo::kFormalParameterCountOffset));
@@ -1241,6 +1272,7 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
// Get the function and setup the context.
Move(r1, function);
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
+ LoadConstantPoolPointer(r1);
// We call indirectly through the code field in the function to
// allow recompilation to take effect without changing any of the

Powered by Google App Engine
This is Rietveld 408576698