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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 25679008: Revert "Add support to load/store byte fields." and "MIPS: Add support to load/store byte fields.". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('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 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 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 } 3035 }
3036 3036
3037 3037
3038 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 3038 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
3039 HObjectAccess access = instr->hydrogen()->access(); 3039 HObjectAccess access = instr->hydrogen()->access();
3040 int offset = access.offset(); 3040 int offset = access.offset();
3041 Register object = ToRegister(instr->object()); 3041 Register object = ToRegister(instr->object());
3042 3042
3043 if (access.IsExternalMemory()) { 3043 if (access.IsExternalMemory()) {
3044 Register result = ToRegister(instr->result()); 3044 Register result = ToRegister(instr->result());
3045 MemOperand operand = MemOperand(object, offset); 3045 __ ldr(result, MemOperand(object, offset));
3046 if (access.representation().IsByte()) {
3047 __ ldrb(result, operand);
3048 } else {
3049 __ ldr(result, operand);
3050 }
3051 return; 3046 return;
3052 } 3047 }
3053 3048
3054 if (instr->hydrogen()->representation().IsDouble()) { 3049 if (instr->hydrogen()->representation().IsDouble()) {
3055 DwVfpRegister result = ToDoubleRegister(instr->result()); 3050 DwVfpRegister result = ToDoubleRegister(instr->result());
3056 __ vldr(result, FieldMemOperand(object, offset)); 3051 __ vldr(result, FieldMemOperand(object, offset));
3057 return; 3052 return;
3058 } 3053 }
3059 3054
3060 Register result = ToRegister(instr->result()); 3055 Register result = ToRegister(instr->result());
3061 if (!access.IsInobject()) { 3056 if (access.IsInobject()) {
3057 __ ldr(result, FieldMemOperand(object, offset));
3058 } else {
3062 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 3059 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
3063 object = result; 3060 __ ldr(result, FieldMemOperand(result, offset));
3064 }
3065 MemOperand operand = FieldMemOperand(object, offset);
3066 if (access.representation().IsByte()) {
3067 __ ldrb(result, operand);
3068 } else {
3069 __ ldr(result, operand);
3070 } 3061 }
3071 } 3062 }
3072 3063
3073 3064
3074 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3065 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3075 ASSERT(ToRegister(instr->context()).is(cp)); 3066 ASSERT(ToRegister(instr->context()).is(cp));
3076 ASSERT(ToRegister(instr->object()).is(r0)); 3067 ASSERT(ToRegister(instr->object()).is(r0));
3077 ASSERT(ToRegister(instr->result()).is(r0)); 3068 ASSERT(ToRegister(instr->result()).is(r0));
3078 3069
3079 // Name is always in r2. 3070 // Name is always in r2.
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
4165 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { 4156 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
4166 Representation representation = instr->representation(); 4157 Representation representation = instr->representation();
4167 4158
4168 Register object = ToRegister(instr->object()); 4159 Register object = ToRegister(instr->object());
4169 Register scratch = scratch0(); 4160 Register scratch = scratch0();
4170 HObjectAccess access = instr->hydrogen()->access(); 4161 HObjectAccess access = instr->hydrogen()->access();
4171 int offset = access.offset(); 4162 int offset = access.offset();
4172 4163
4173 if (access.IsExternalMemory()) { 4164 if (access.IsExternalMemory()) {
4174 Register value = ToRegister(instr->value()); 4165 Register value = ToRegister(instr->value());
4175 MemOperand operand = MemOperand(object, offset); 4166 __ str(value, MemOperand(object, offset));
4176 if (representation.IsByte()) {
4177 __ strb(value, operand);
4178 } else {
4179 __ str(value, operand);
4180 }
4181 return; 4167 return;
4182 } 4168 }
4183 4169
4184 Handle<Map> transition = instr->transition(); 4170 Handle<Map> transition = instr->transition();
4185 4171
4186 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 4172 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
4187 Register value = ToRegister(instr->value()); 4173 Register value = ToRegister(instr->value());
4188 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 4174 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
4189 __ SmiTst(value); 4175 __ SmiTst(value);
4190 DeoptimizeIf(eq, instr->environment()); 4176 DeoptimizeIf(eq, instr->environment());
(...skipping 24 matching lines...) Expand all
4215 } 4201 }
4216 } 4202 }
4217 4203
4218 // Do the store. 4204 // Do the store.
4219 Register value = ToRegister(instr->value()); 4205 Register value = ToRegister(instr->value());
4220 ASSERT(!object.is(value)); 4206 ASSERT(!object.is(value));
4221 SmiCheck check_needed = 4207 SmiCheck check_needed =
4222 instr->hydrogen()->value()->IsHeapObject() 4208 instr->hydrogen()->value()->IsHeapObject()
4223 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4209 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4224 if (access.IsInobject()) { 4210 if (access.IsInobject()) {
4225 MemOperand operand = FieldMemOperand(object, offset); 4211 __ str(value, FieldMemOperand(object, offset));
4226 if (representation.IsByte()) {
4227 __ strb(value, operand);
4228 } else {
4229 __ str(value, operand);
4230 }
4231 if (instr->hydrogen()->NeedsWriteBarrier()) { 4212 if (instr->hydrogen()->NeedsWriteBarrier()) {
4232 // Update the write barrier for the object for in-object properties. 4213 // Update the write barrier for the object for in-object properties.
4233 __ RecordWriteField(object, 4214 __ RecordWriteField(object,
4234 offset, 4215 offset,
4235 value, 4216 value,
4236 scratch, 4217 scratch,
4237 GetLinkRegisterState(), 4218 GetLinkRegisterState(),
4238 kSaveFPRegs, 4219 kSaveFPRegs,
4239 EMIT_REMEMBERED_SET, 4220 EMIT_REMEMBERED_SET,
4240 check_needed); 4221 check_needed);
4241 } 4222 }
4242 } else { 4223 } else {
4243 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); 4224 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
4244 MemOperand operand = FieldMemOperand(scratch, offset); 4225 __ str(value, FieldMemOperand(scratch, offset));
4245 if (representation.IsByte()) {
4246 __ strb(value, operand);
4247 } else {
4248 __ str(value, operand);
4249 }
4250 if (instr->hydrogen()->NeedsWriteBarrier()) { 4226 if (instr->hydrogen()->NeedsWriteBarrier()) {
4251 // Update the write barrier for the properties array. 4227 // Update the write barrier for the properties array.
4252 // object is used as a scratch register. 4228 // object is used as a scratch register.
4253 __ RecordWriteField(scratch, 4229 __ RecordWriteField(scratch,
4254 offset, 4230 offset,
4255 value, 4231 value,
4256 object, 4232 object,
4257 GetLinkRegisterState(), 4233 GetLinkRegisterState(),
4258 kSaveFPRegs, 4234 kSaveFPRegs,
4259 EMIT_REMEMBERED_SET, 4235 EMIT_REMEMBERED_SET,
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
5829 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5805 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5830 __ ldr(result, FieldMemOperand(scratch, 5806 __ ldr(result, FieldMemOperand(scratch,
5831 FixedArray::kHeaderSize - kPointerSize)); 5807 FixedArray::kHeaderSize - kPointerSize));
5832 __ bind(&done); 5808 __ bind(&done);
5833 } 5809 }
5834 5810
5835 5811
5836 #undef __ 5812 #undef __
5837 5813
5838 } } // namespace v8::internal 5814 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698