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

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

Issue 61623004: Add signed/unsigned 8-bit and 16-bit Representations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review feedback and prepare to land Created 7 years, 1 month 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/arm/macro-assembler-arm.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 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after
3009 3009
3010 3010
3011 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 3011 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
3012 HObjectAccess access = instr->hydrogen()->access(); 3012 HObjectAccess access = instr->hydrogen()->access();
3013 int offset = access.offset(); 3013 int offset = access.offset();
3014 Register object = ToRegister(instr->object()); 3014 Register object = ToRegister(instr->object());
3015 3015
3016 if (access.IsExternalMemory()) { 3016 if (access.IsExternalMemory()) {
3017 Register result = ToRegister(instr->result()); 3017 Register result = ToRegister(instr->result());
3018 MemOperand operand = MemOperand(object, offset); 3018 MemOperand operand = MemOperand(object, offset);
3019 if (access.representation().IsByte()) { 3019 __ Load(result, operand, access.representation());
3020 __ ldrb(result, operand);
3021 } else {
3022 __ ldr(result, operand);
3023 }
3024 return; 3020 return;
3025 } 3021 }
3026 3022
3027 if (instr->hydrogen()->representation().IsDouble()) { 3023 if (instr->hydrogen()->representation().IsDouble()) {
3028 DwVfpRegister result = ToDoubleRegister(instr->result()); 3024 DwVfpRegister result = ToDoubleRegister(instr->result());
3029 __ vldr(result, FieldMemOperand(object, offset)); 3025 __ vldr(result, FieldMemOperand(object, offset));
3030 return; 3026 return;
3031 } 3027 }
3032 3028
3033 Register result = ToRegister(instr->result()); 3029 Register result = ToRegister(instr->result());
3034 if (!access.IsInobject()) { 3030 if (!access.IsInobject()) {
3035 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 3031 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
3036 object = result; 3032 object = result;
3037 } 3033 }
3038 MemOperand operand = FieldMemOperand(object, offset); 3034 MemOperand operand = FieldMemOperand(object, offset);
3039 if (access.representation().IsByte()) { 3035 __ Load(result, operand, access.representation());
3040 __ ldrb(result, operand);
3041 } else {
3042 __ ldr(result, operand);
3043 }
3044 } 3036 }
3045 3037
3046 3038
3047 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3039 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3048 ASSERT(ToRegister(instr->context()).is(cp)); 3040 ASSERT(ToRegister(instr->context()).is(cp));
3049 ASSERT(ToRegister(instr->object()).is(r0)); 3041 ASSERT(ToRegister(instr->object()).is(r0));
3050 ASSERT(ToRegister(instr->result()).is(r0)); 3042 ASSERT(ToRegister(instr->result()).is(r0));
3051 3043
3052 // Name is always in r2. 3044 // Name is always in r2.
3053 __ mov(r2, Operand(instr->name())); 3045 __ mov(r2, Operand(instr->name()));
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
4136 Representation representation = instr->representation(); 4128 Representation representation = instr->representation();
4137 4129
4138 Register object = ToRegister(instr->object()); 4130 Register object = ToRegister(instr->object());
4139 Register scratch = scratch0(); 4131 Register scratch = scratch0();
4140 HObjectAccess access = instr->hydrogen()->access(); 4132 HObjectAccess access = instr->hydrogen()->access();
4141 int offset = access.offset(); 4133 int offset = access.offset();
4142 4134
4143 if (access.IsExternalMemory()) { 4135 if (access.IsExternalMemory()) {
4144 Register value = ToRegister(instr->value()); 4136 Register value = ToRegister(instr->value());
4145 MemOperand operand = MemOperand(object, offset); 4137 MemOperand operand = MemOperand(object, offset);
4146 if (representation.IsByte()) { 4138 __ Store(value, operand, representation);
4147 __ strb(value, operand);
4148 } else {
4149 __ str(value, operand);
4150 }
4151 return; 4139 return;
4152 } 4140 }
4153 4141
4154 Handle<Map> transition = instr->transition(); 4142 Handle<Map> transition = instr->transition();
4155 4143
4156 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 4144 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
4157 Register value = ToRegister(instr->value()); 4145 Register value = ToRegister(instr->value());
4158 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 4146 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
4159 __ SmiTst(value); 4147 __ SmiTst(value);
4160 DeoptimizeIf(eq, instr->environment()); 4148 DeoptimizeIf(eq, instr->environment());
(...skipping 25 matching lines...) Expand all
4186 } 4174 }
4187 4175
4188 // Do the store. 4176 // Do the store.
4189 Register value = ToRegister(instr->value()); 4177 Register value = ToRegister(instr->value());
4190 ASSERT(!object.is(value)); 4178 ASSERT(!object.is(value));
4191 SmiCheck check_needed = 4179 SmiCheck check_needed =
4192 instr->hydrogen()->value()->IsHeapObject() 4180 instr->hydrogen()->value()->IsHeapObject()
4193 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4181 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4194 if (access.IsInobject()) { 4182 if (access.IsInobject()) {
4195 MemOperand operand = FieldMemOperand(object, offset); 4183 MemOperand operand = FieldMemOperand(object, offset);
4196 if (representation.IsByte()) { 4184 __ Store(value, operand, representation);
4197 __ strb(value, operand);
4198 } else {
4199 __ str(value, operand);
4200 }
4201 if (instr->hydrogen()->NeedsWriteBarrier()) { 4185 if (instr->hydrogen()->NeedsWriteBarrier()) {
4202 // Update the write barrier for the object for in-object properties. 4186 // Update the write barrier for the object for in-object properties.
4203 __ RecordWriteField(object, 4187 __ RecordWriteField(object,
4204 offset, 4188 offset,
4205 value, 4189 value,
4206 scratch, 4190 scratch,
4207 GetLinkRegisterState(), 4191 GetLinkRegisterState(),
4208 kSaveFPRegs, 4192 kSaveFPRegs,
4209 EMIT_REMEMBERED_SET, 4193 EMIT_REMEMBERED_SET,
4210 check_needed); 4194 check_needed);
4211 } 4195 }
4212 } else { 4196 } else {
4213 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); 4197 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
4214 MemOperand operand = FieldMemOperand(scratch, offset); 4198 MemOperand operand = FieldMemOperand(scratch, offset);
4215 if (representation.IsByte()) { 4199 __ Store(value, operand, representation);
4216 __ strb(value, operand);
4217 } else {
4218 __ str(value, operand);
4219 }
4220 if (instr->hydrogen()->NeedsWriteBarrier()) { 4200 if (instr->hydrogen()->NeedsWriteBarrier()) {
4221 // Update the write barrier for the properties array. 4201 // Update the write barrier for the properties array.
4222 // object is used as a scratch register. 4202 // object is used as a scratch register.
4223 __ RecordWriteField(scratch, 4203 __ RecordWriteField(scratch,
4224 offset, 4204 offset,
4225 value, 4205 value,
4226 object, 4206 object,
4227 GetLinkRegisterState(), 4207 GetLinkRegisterState(),
4228 kSaveFPRegs, 4208 kSaveFPRegs,
4229 EMIT_REMEMBERED_SET, 4209 EMIT_REMEMBERED_SET,
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after
5826 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5806 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5827 __ ldr(result, FieldMemOperand(scratch, 5807 __ ldr(result, FieldMemOperand(scratch,
5828 FixedArray::kHeaderSize - kPointerSize)); 5808 FixedArray::kHeaderSize - kPointerSize));
5829 __ bind(&done); 5809 __ bind(&done);
5830 } 5810 }
5831 5811
5832 5812
5833 #undef __ 5813 #undef __
5834 5814
5835 } } // namespace v8::internal 5815 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698