Added command line flag --sync_with_push (default: true) to

emit 'push' instead of 'sub esp, xxx' followed by 'mov' instructions
Reduces generated code size by 10-15% on several benchmarks.
Done on ia32 and x64 (no sync operation in the virtual frame on ARM 
architecture)

Review URL: http://codereview.chromium.org/259058

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3032 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 61650a0e
......@@ -161,15 +161,16 @@ void VirtualFrame::SyncRange(int begin, int end) {
// on the stack.
int start = Min(begin, stack_pointer_ + 1);
// If positive we have to adjust the stack pointer.
int delta = end - stack_pointer_;
if (delta > 0) {
stack_pointer_ = end;
__ sub(Operand(esp), Immediate(delta * kPointerSize));
}
// Emit normal 'push' instructions for elements above stack pointer
// and use mov instructions if we are below stack pointer.
for (int i = start; i <= end; i++) {
if (!elements_[i].is_synced()) SyncElementBelowStackPointer(i);
if (!elements_[i].is_synced()) {
if (i <= stack_pointer_) {
SyncElementBelowStackPointer(i);
} else {
SyncElementByPushing(i);
}
}
}
}
......
......@@ -883,15 +883,16 @@ void VirtualFrame::SyncRange(int begin, int end) {
// on the stack.
int start = Min(begin, stack_pointer_ + 1);
// If positive we have to adjust the stack pointer.
int delta = end - stack_pointer_;
if (delta > 0) {
stack_pointer_ = end;
__ subq(rsp, Immediate(delta * kPointerSize));
}
// Emit normal 'push' instructions for elements above stack pointer
// and use mov instructions if we are below stack pointer.
for (int i = start; i <= end; i++) {
if (!elements_[i].is_synced()) SyncElementBelowStackPointer(i);
if (!elements_[i].is_synced()) {
if (i <= stack_pointer_) {
SyncElementBelowStackPointer(i);
} else {
SyncElementByPushing(i);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment