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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 48743002: Do not directly load smi constants larger than a 16 bit payload on ia32. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 ce869b63655001b27b247f4d702d4bcb49babb67..6ecfe790c10af2c7fbc78937f50ac4bcd4cc11fc 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1770,7 +1770,7 @@ void ParallelMoveResolver::EmitMove(int index) {
if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
__ xorl(destination.reg(), destination.reg());
} else {
- __ LoadObject(destination.reg(), constant);
+ __ LoadObjectSafely(destination.reg(), constant);
}
} else {
ASSERT(destination.IsStackSlot());
@@ -1869,11 +1869,11 @@ void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
- if (obj.IsSmi() || obj.IsNull()) {
+ if (Assembler::IsSafeSmi(obj) || obj.IsNull()) {
__ movl(dst, Immediate(reinterpret_cast<int32_t>(obj.raw())));
} else {
ScratchRegisterScope ensure_scratch(this, kNoRegister);
- __ LoadObject(ensure_scratch.reg(), obj);
+ __ LoadObjectSafely(ensure_scratch.reg(), obj);
__ movl(dst, ensure_scratch.reg());
}
}

Powered by Google App Engine
This is Rietveld 408576698