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

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

Issue 6546036: Combine typed and pixel arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final version Created 9 years, 9 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/arm/lithium-arm.cc ('k') | src/arm/stub-cache-arm.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 } 1126 }
1127 1127
1128 1128
1129 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { 1129 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
1130 Register result = ToRegister(instr->result()); 1130 Register result = ToRegister(instr->result());
1131 Register array = ToRegister(instr->InputAt(0)); 1131 Register array = ToRegister(instr->InputAt(0));
1132 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); 1132 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset));
1133 } 1133 }
1134 1134
1135 1135
1136 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { 1136 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) {
1137 Register result = ToRegister(instr->result()); 1137 Register result = ToRegister(instr->result());
1138 Register array = ToRegister(instr->InputAt(0)); 1138 Register array = ToRegister(instr->InputAt(0));
1139 __ ldr(result, FieldMemOperand(array, PixelArray::kLengthOffset)); 1139 __ ldr(result, FieldMemOperand(array, ExternalArray::kLengthOffset));
1140 } 1140 }
1141 1141
1142 1142
1143 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { 1143 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
1144 Register result = ToRegister(instr->result()); 1144 Register result = ToRegister(instr->result());
1145 Register array = ToRegister(instr->InputAt(0)); 1145 Register array = ToRegister(instr->InputAt(0));
1146 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); 1146 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset));
1147 } 1147 }
1148 1148
1149 1149
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 Register input = ToRegister(instr->InputAt(0)); 2196 Register input = ToRegister(instr->InputAt(0));
2197 Register scratch = scratch0(); 2197 Register scratch = scratch0();
2198 2198
2199 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset)); 2199 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset));
2200 if (FLAG_debug_code) { 2200 if (FLAG_debug_code) {
2201 Label done; 2201 Label done;
2202 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); 2202 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset));
2203 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); 2203 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
2204 __ cmp(scratch, ip); 2204 __ cmp(scratch, ip);
2205 __ b(eq, &done); 2205 __ b(eq, &done);
2206 __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex); 2206 __ LoadRoot(ip, Heap::kExternalPixelArrayMapRootIndex);
2207 __ cmp(scratch, ip); 2207 __ cmp(scratch, ip);
2208 __ b(eq, &done); 2208 __ b(eq, &done);
2209 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); 2209 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
2210 __ cmp(scratch, ip); 2210 __ cmp(scratch, ip);
2211 __ Check(eq, "Check for fast elements failed."); 2211 __ Check(eq, "Check for fast elements failed.");
2212 __ bind(&done); 2212 __ bind(&done);
2213 } 2213 }
2214 } 2214 }
2215 2215
2216 2216
2217 void LCodeGen::DoLoadPixelArrayExternalPointer( 2217 void LCodeGen::DoLoadExternalArrayPointer(
2218 LLoadPixelArrayExternalPointer* instr) { 2218 LLoadExternalArrayPointer* instr) {
2219 Register to_reg = ToRegister(instr->result()); 2219 Register to_reg = ToRegister(instr->result());
2220 Register from_reg = ToRegister(instr->InputAt(0)); 2220 Register from_reg = ToRegister(instr->InputAt(0));
2221 __ ldr(to_reg, FieldMemOperand(from_reg, PixelArray::kExternalPointerOffset)); 2221 __ ldr(to_reg, FieldMemOperand(from_reg,
2222 ExternalArray::kExternalPointerOffset));
2222 } 2223 }
2223 2224
2224 2225
2225 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2226 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2226 Register arguments = ToRegister(instr->arguments()); 2227 Register arguments = ToRegister(instr->arguments());
2227 Register length = ToRegister(instr->length()); 2228 Register length = ToRegister(instr->length());
2228 Register index = ToRegister(instr->index()); 2229 Register index = ToRegister(instr->index());
2229 Register result = ToRegister(instr->result()); 2230 Register result = ToRegister(instr->result());
2230 2231
2231 // Bailout index is not a valid argument index. Use unsigned check to get 2232 // Bailout index is not a valid argument index. Use unsigned check to get
(...skipping 20 matching lines...) Expand all
2252 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); 2253 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize));
2253 2254
2254 // Check for the hole value. 2255 // Check for the hole value.
2255 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); 2256 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
2256 __ cmp(result, scratch); 2257 __ cmp(result, scratch);
2257 DeoptimizeIf(eq, instr->environment()); 2258 DeoptimizeIf(eq, instr->environment());
2258 } 2259 }
2259 2260
2260 2261
2261 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) { 2262 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) {
2262 Register external_elements = ToRegister(instr->external_pointer()); 2263 Register external_pointer = ToRegister(instr->external_pointer());
2263 Register key = ToRegister(instr->key()); 2264 Register key = ToRegister(instr->key());
2264 Register result = ToRegister(instr->result()); 2265 Register result = ToRegister(instr->result());
2265 2266
2266 // Load the result. 2267 // Load the result.
2267 __ ldrb(result, MemOperand(external_elements, key)); 2268 __ ldrb(result, MemOperand(external_pointer, key));
2268 } 2269 }
2269 2270
2270 2271
2271 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 2272 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2272 ASSERT(ToRegister(instr->object()).is(r1)); 2273 ASSERT(ToRegister(instr->object()).is(r1));
2273 ASSERT(ToRegister(instr->key()).is(r0)); 2274 ASSERT(ToRegister(instr->key()).is(r0));
2274 2275
2275 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); 2276 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
2276 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2277 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2277 } 2278 }
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2909 } 2910 }
2910 2911
2911 if (instr->hydrogen()->NeedsWriteBarrier()) { 2912 if (instr->hydrogen()->NeedsWriteBarrier()) {
2912 // Compute address of modified element and store it into key register. 2913 // Compute address of modified element and store it into key register.
2913 __ add(key, scratch, Operand(FixedArray::kHeaderSize)); 2914 __ add(key, scratch, Operand(FixedArray::kHeaderSize));
2914 __ RecordWrite(elements, key, value); 2915 __ RecordWrite(elements, key, value);
2915 } 2916 }
2916 } 2917 }
2917 2918
2918 2919
2920 void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) {
2921 Register external_pointer = ToRegister(instr->external_pointer());
2922 Register key = ToRegister(instr->key());
2923 Register value = ToRegister(instr->value());
2924
2925 // Clamp the value to [0..255].
2926 __ Usat(value, 8, Operand(value));
2927 __ strb(value, MemOperand(external_pointer, key, LSL, 0));
2928 }
2929
2930
2919 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 2931 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
2920 ASSERT(ToRegister(instr->object()).is(r2)); 2932 ASSERT(ToRegister(instr->object()).is(r2));
2921 ASSERT(ToRegister(instr->key()).is(r1)); 2933 ASSERT(ToRegister(instr->key()).is(r1));
2922 ASSERT(ToRegister(instr->value()).is(r0)); 2934 ASSERT(ToRegister(instr->value()).is(r0));
2923 2935
2924 Handle<Code> ic(Builtins::builtin( 2936 Handle<Code> ic(Builtins::builtin(
2925 info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict 2937 info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict
2926 : Builtins::KeyedStoreIC_Initialize)); 2938 : Builtins::KeyedStoreIC_Initialize));
2927 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2939 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2928 } 2940 }
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
3848 ASSERT(!environment->HasBeenRegistered()); 3860 ASSERT(!environment->HasBeenRegistered());
3849 RegisterEnvironmentForDeoptimization(environment); 3861 RegisterEnvironmentForDeoptimization(environment);
3850 ASSERT(osr_pc_offset_ == -1); 3862 ASSERT(osr_pc_offset_ == -1);
3851 osr_pc_offset_ = masm()->pc_offset(); 3863 osr_pc_offset_ = masm()->pc_offset();
3852 } 3864 }
3853 3865
3854 3866
3855 #undef __ 3867 #undef __
3856 3868
3857 } } // namespace v8::internal 3869 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698