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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3954 3954
3955 Register write_register = object; 3955 Register write_register = object;
3956 if (!instr->is_in_object()) { 3956 if (!instr->is_in_object()) {
3957 write_register = ToRegister(instr->temp()); 3957 write_register = ToRegister(instr->temp());
3958 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); 3958 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
3959 } 3959 }
3960 3960
3961 if (instr->value()->IsConstantOperand()) { 3961 if (instr->value()->IsConstantOperand()) {
3962 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); 3962 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
3963 if (IsInteger32Constant(operand_value)) { 3963 if (IsInteger32Constant(operand_value)) {
3964 int const_value = ToInteger32(operand_value); 3964 // In lithium register preparation, we made sure that the constant integer
3965 __ movq(FieldOperand(write_register, offset), Immediate(const_value)); 3965 // operand fits into smi range.
3966 Smi* smi_value = Smi::FromInt(ToInteger32(operand_value));
3967 __ Move(FieldOperand(write_register, offset), smi_value);
3968 } else if (operand_value->IsRegister()) {
3969 __ movq(FieldOperand(write_register, offset),
3970 ToRegister(operand_value));
3966 } else { 3971 } else {
3967 if (operand_value->IsRegister()) { 3972 Handle<Object> handle_value = ToHandle(operand_value);
3968 __ movq(FieldOperand(write_register, offset), 3973 __ Move(FieldOperand(write_register, offset), handle_value);
3969 ToRegister(operand_value));
3970 } else {
3971 Handle<Object> handle_value = ToHandle(operand_value);
3972 __ Move(FieldOperand(write_register, offset), handle_value);
3973 }
3974 } 3974 }
3975 } else { 3975 } else {
3976 __ movq(FieldOperand(write_register, offset), ToRegister(instr->value())); 3976 __ movq(FieldOperand(write_register, offset), ToRegister(instr->value()));
3977 } 3977 }
3978 3978
3979 if (instr->hydrogen()->NeedsWriteBarrier()) { 3979 if (instr->hydrogen()->NeedsWriteBarrier()) {
3980 Register value = ToRegister(instr->value()); 3980 Register value = ToRegister(instr->value());
3981 Register temp = instr->is_in_object() ? ToRegister(instr->temp()) : object; 3981 Register temp = instr->is_in_object() ? ToRegister(instr->temp()) : object;
3982 // Update the write barrier for the object for in-object properties. 3982 // Update the write barrier for the object for in-object properties.
3983 __ RecordWriteField(write_register, 3983 __ RecordWriteField(write_register,
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5686 FixedArray::kHeaderSize - kPointerSize)); 5686 FixedArray::kHeaderSize - kPointerSize));
5687 __ bind(&done); 5687 __ bind(&done);
5688 } 5688 }
5689 5689
5690 5690
5691 #undef __ 5691 #undef __
5692 5692
5693 } } // namespace v8::internal 5693 } } // namespace v8::internal
5694 5694
5695 #endif // V8_TARGET_ARCH_X64 5695 #endif // V8_TARGET_ARCH_X64
OLDNEW
« 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