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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 14075014: Fixed issue in StoreNamedField codegen where integer32 constants were not converted to a smi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Verify that integer32 constants used without a register fit in smi range Created 7 years, 8 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
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index fa1227085dc214728a3ffcb58fba0eef30d5b8c0..16335d0cefec37728c8b632418e9e7a8110e8876 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -3961,16 +3961,16 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
if (IsInteger32Constant(operand_value)) {
- int const_value = ToInteger32(operand_value);
- __ movq(FieldOperand(write_register, offset), Immediate(const_value));
+ // In lithium register preparation, we made sure that the constant integer
+ // operand fits into smi range.
+ Smi* smi_value = Smi::FromInt(ToInteger32(operand_value));
+ __ Move(FieldOperand(write_register, offset), smi_value);
+ } else if (operand_value->IsRegister()) {
+ __ movq(FieldOperand(write_register, offset),
+ ToRegister(operand_value));
} else {
- if (operand_value->IsRegister()) {
- __ movq(FieldOperand(write_register, offset),
- ToRegister(operand_value));
- } else {
- Handle<Object> handle_value = ToHandle(operand_value);
- __ Move(FieldOperand(write_register, offset), handle_value);
- }
+ Handle<Object> handle_value = ToHandle(operand_value);
+ __ Move(FieldOperand(write_register, offset), handle_value);
}
} else {
__ movq(FieldOperand(write_register, offset), ToRegister(instr->value()));
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698