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

Unified Diff: src/x64/cfg-x64.cc

Issue 159701: Restructure to support recursive invocation of the CFG builder. Add... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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
« src/cfg.cc ('K') | « src/ia32/cfg-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/cfg-x64.cc
===================================================================
--- src/x64/cfg-x64.cc (revision 2602)
+++ src/x64/cfg-x64.cc (working copy)
@@ -60,10 +60,11 @@
__ movq(rbp, rsp);
__ push(rsi);
__ push(rdi);
- if (local_count_ > 0) {
+ int count = CfgGlobals::current()->fun()->scope()->num_stack_slots();
+ if (count > 0) {
__ movq(kScratchRegister, Factory::undefined_value(),
RelocInfo::EMBEDDED_OBJECT);
- for (int i = 0; i < local_count_; i++) {
+ for (int i = 0; i < count; i++) {
__ push(kScratchRegister);
}
}
@@ -101,7 +102,8 @@
__ RecordJSReturn();
__ movq(rsp, rbp);
__ pop(rbp);
- __ ret((parameter_count_ + 1) * kPointerSize);
+ int count = CfgGlobals::current()->fun()->scope()->num_parameters();
+ __ ret((count + 1) * kPointerSize);
// Add padding that will be overwritten by a debugger breakpoint.
// "movq rsp, rbp; pop rbp" has length 5. "ret k" has length 2.
const int kPadding = Debug::kX64JSReturnSequenceLength - 5 - 2;
@@ -121,6 +123,24 @@
__ Move(reg, handle_);
}
+
+void SlotLocation::ToRegister(MacroAssembler* masm, Register reg) {
+ switch (type_) {
+ case Slot::PARAMETER: {
+ int count = CfgGlobals::current()->fun()->scope()->num_parameters();
+ __ movq(reg, Operand(rbp, (1 + count - index_) * kPointerSize));
+ break;
+ }
+ case Slot::LOCAL: {
+ const int kOffset = JavaScriptFrameConstants::kLocal0Offset;
+ __ movq(reg, Operand(rbp, kOffset - index_ * kPointerSize));
+ break;
+ }
+ default:
+ UNREACHABLE();
+ }
+}
+
#undef __
} } // namespace v8::internal
« src/cfg.cc ('K') | « src/ia32/cfg-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698