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

Unified Diff: src/virtual-frame-ia32.cc

Issue 13234: Experimental: three small codegen changes.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years 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
« src/jump-target-ia32.cc ('K') | « src/jump-target-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame-ia32.cc
===================================================================
--- src/virtual-frame-ia32.cc (revision 927)
+++ src/virtual-frame-ia32.cc (working copy)
@@ -219,6 +219,7 @@
}
}
+
// Make the type of all elements be MEMORY.
void VirtualFrame::SpillAll() {
for (int i = 0; i < elements_.length(); i++) {
@@ -297,10 +298,6 @@
if (element.is_synced()) {
new_elements[i] = memory_element;
} else {
- // This code path is currently not triggered. UNIMPLEMENTED is
- // temporarily used to trap when it becomes active so we can test
- // it.
- UNIMPLEMENTED();
Register reg = cgen_->allocator()->AllocateWithoutSpilling();
if (reg.is(no_reg)) {
new_elements[i] = memory_element;
@@ -411,17 +408,36 @@
stack_pointer_--;
__ pop(target.reg());
}
- Use(target.reg());
- } else if (source.is_constant()) {
- // Not yet implemented. When done, code in common with the
- // memory-to-register just above case can be factored out.
- UNIMPLEMENTED();
+ } else {
+ // Source is constant.
+ __ Set(target.reg(), Immediate(source.handle()));
}
+ Use(target.reg());
elements_[i] = target;
}
}
+ // At this point, the frames should be identical.
ASSERT(stack_pointer_ == expected->stack_pointer_);
+#ifdef DEBUG
+ for (int i = 0; i < elements_.length(); i++) {
+ FrameElement expect = expected->elements_[i];
+ if (expect.is_memory()) {
+ ASSERT(elements_[i].is_memory());
+ ASSERT(elements_[i].is_synced() && expect.is_synced());
+ } else if (expect.is_register()) {
+ ASSERT(elements_[i].is_register());
+ ASSERT(elements_[i].reg().is(expect.reg()));
+ ASSERT(elements_[i].is_synced() == expect.is_synced());
+ } else {
+ ASSERT(expect.is_constant());
+ ASSERT(elements_[i].is_constant());
+ ASSERT(elements_[i].handle().location() ==
+ expect.handle().location());
+ ASSERT(elements_[i].is_synced() == expect.is_synced());
+ }
+ }
+#endif
}
@@ -433,11 +449,14 @@
frame_pointer_ = stack_pointer_;
__ mov(ebp, Operand(esp));
- // Store the context and the function in the frame.
- Push(esi);
- // The frame owns the register reference now.
- cgen_->allocator()->Unuse(esi);
+ // Store the context in the frame. The context is kept in esi, so the
+ // register reference is not owned by the frame (ie, the frame is not free
+ // to spill it). This is implemented by making the in-frame value be
+ // memory.
+ EmitPush(esi);
+ // Store the function in the frame. The frame owns the register reference
+ // now (ie, it can keep it in edi or spill it later).
Push(edi);
cgen_->allocator()->Unuse(edi);
}
« src/jump-target-ia32.cc ('K') | « src/jump-target-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698