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

Unified Diff: src/ia32/lithium-codegen-ia32.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 | « no previous file | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index de62e1fd3b4cde31d756b00611e83975fc236080..10a8aef999ef28061cf0c8e42c2c0650a5f39fda 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -4264,15 +4264,15 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
if (IsInteger32(operand_value)) {
- int const_value = ToInteger32(operand_value);
- __ mov(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));
+ __ mov(FieldOperand(write_register, offset), Immediate(smi_value));
+ } else if (operand_value->IsRegister()) {
+ __ mov(FieldOperand(write_register, offset), ToRegister(operand_value));
} else {
- if (operand_value->IsRegister()) {
- __ mov(FieldOperand(write_register, offset), ToRegister(operand_value));
- } else {
- Handle<Object> handle_value = ToHandle(operand_value);
- __ mov(FieldOperand(write_register, offset), handle_value);
- }
+ Handle<Object> handle_value = ToHandle(operand_value);
+ __ mov(FieldOperand(write_register, offset), handle_value);
}
} else {
__ mov(FieldOperand(write_register, offset), ToRegister(instr->value()));
« no previous file with comments | « no previous file | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698