OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4163 Register code_object = ToRegister(instr->code_object()); | 4163 Register code_object = ToRegister(instr->code_object()); |
4164 __ add(code_object, code_object, Operand(Code::kHeaderSize - kHeapObjectTag)); | 4164 __ add(code_object, code_object, Operand(Code::kHeaderSize - kHeapObjectTag)); |
4165 __ str(code_object, | 4165 __ str(code_object, |
4166 FieldMemOperand(function, JSFunction::kCodeEntryOffset)); | 4166 FieldMemOperand(function, JSFunction::kCodeEntryOffset)); |
4167 } | 4167 } |
4168 | 4168 |
4169 | 4169 |
4170 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { | 4170 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { |
4171 Register result = ToRegister(instr->result()); | 4171 Register result = ToRegister(instr->result()); |
4172 Register base = ToRegister(instr->base_object()); | 4172 Register base = ToRegister(instr->base_object()); |
4173 __ add(result, base, Operand(instr->offset())); | 4173 if (instr->offset()->IsConstantOperand()) { |
| 4174 LConstantOperand* offset = LConstantOperand::cast(instr->offset()); |
| 4175 __ add(result, base, Operand(ToInteger32(offset))); |
| 4176 } else { |
| 4177 Register offset = ToRegister(instr->offset()); |
| 4178 __ add(result, base, offset); |
| 4179 } |
4174 } | 4180 } |
4175 | 4181 |
4176 | 4182 |
4177 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 4183 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
4178 Representation representation = instr->representation(); | 4184 Representation representation = instr->representation(); |
4179 | 4185 |
4180 Register object = ToRegister(instr->object()); | 4186 Register object = ToRegister(instr->object()); |
4181 Register scratch = scratch0(); | 4187 Register scratch = scratch0(); |
4182 HObjectAccess access = instr->hydrogen()->access(); | 4188 HObjectAccess access = instr->hydrogen()->access(); |
4183 int offset = access.offset(); | 4189 int offset = access.offset(); |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5875 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5881 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5876 __ ldr(result, FieldMemOperand(scratch, | 5882 __ ldr(result, FieldMemOperand(scratch, |
5877 FixedArray::kHeaderSize - kPointerSize)); | 5883 FixedArray::kHeaderSize - kPointerSize)); |
5878 __ bind(&done); | 5884 __ bind(&done); |
5879 } | 5885 } |
5880 | 5886 |
5881 | 5887 |
5882 #undef __ | 5888 #undef __ |
5883 | 5889 |
5884 } } // namespace v8::internal | 5890 } } // namespace v8::internal |
OLD | NEW |