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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 783103003: Clobber non-live temporaries on some paths involving a possible slow-path allocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: unnedded temp saves Created 6 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm64.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 78d768359087fe9ca3b328a68ad6409a64bb4be3..aaff292a99b04411d851379d8e50e0a43f094180 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1450,6 +1450,7 @@ void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
#if defined(DEBUG)
locs->CheckWritableInputs();
+ ClobberDeadTempRegisters(locs);
#endif
// TODO(vegorov): consider saving only caller save (volatile) registers.
@@ -1482,6 +1483,10 @@ void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
+#if defined(DEBUG)
+ ClobberDeadTempRegisters(locs);
+#endif
+
// General purpose registers have the highest register number at the
// lowest address.
for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) {
@@ -1508,6 +1513,21 @@ void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
}
+#if defined(DEBUG)
+void FlowGraphCompiler::ClobberDeadTempRegisters(LocationSummary* locs) {
+ // Clobber temporaries that have not been manually preserved.
+ for (intptr_t i = 0; i < locs->temp_count(); ++i) {
+ Location tmp = locs->temp(i);
+ // TODO(zerny): clobber non-live temporary FPU registers.
+ if (tmp.IsRegister() &&
+ !locs->live_registers()->ContainsRegister(tmp.reg())) {
+ __ movl(tmp.reg(), Immediate(0xf7));
+ }
+ }
+}
+#endif
+
+
void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
Register class_id_reg,
intptr_t argument_count,
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm64.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698