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

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

Issue 6410112: Implement crankshaft support for pixel array loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge with latest Created 9 years, 10 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/factory.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 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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 } 1315 }
1316 1316
1317 1317
1318 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { 1318 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
1319 Register result = ToRegister(instr->result()); 1319 Register result = ToRegister(instr->result());
1320 Register array = ToRegister(instr->InputAt(0)); 1320 Register array = ToRegister(instr->InputAt(0));
1321 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); 1321 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset));
1322 } 1322 }
1323 1323
1324 1324
1325 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) {
1326 Register result = ToRegister(instr->result());
1327 Register array = ToRegister(instr->InputAt(0));
1328 __ ldr(result, FieldMemOperand(array, PixelArray::kLengthOffset));
1329 }
1330
1331
1325 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { 1332 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
1326 Register result = ToRegister(instr->result()); 1333 Register result = ToRegister(instr->result());
1327 Register array = ToRegister(instr->InputAt(0)); 1334 Register array = ToRegister(instr->InputAt(0));
1328 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); 1335 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset));
1329 } 1336 }
1330 1337
1331 1338
1332 void LCodeGen::DoValueOf(LValueOf* instr) { 1339 void LCodeGen::DoValueOf(LValueOf* instr) {
1333 Register input = ToRegister(instr->InputAt(0)); 1340 Register input = ToRegister(instr->InputAt(0));
1334 Register result = ToRegister(instr->result()); 1341 Register result = ToRegister(instr->result());
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 // in initial map. 2354 // in initial map.
2348 __ bind(&non_instance); 2355 __ bind(&non_instance);
2349 __ ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); 2356 __ ldr(result, FieldMemOperand(result, Map::kConstructorOffset));
2350 2357
2351 // All done. 2358 // All done.
2352 __ bind(&done); 2359 __ bind(&done);
2353 } 2360 }
2354 2361
2355 2362
2356 void LCodeGen::DoLoadElements(LLoadElements* instr) { 2363 void LCodeGen::DoLoadElements(LLoadElements* instr) {
2357 ASSERT(instr->result()->Equals(instr->InputAt(0))); 2364 Register result = ToRegister(instr->result());
2358 Register reg = ToRegister(instr->InputAt(0)); 2365 Register input = ToRegister(instr->InputAt(0));
2359 Register scratch = scratch0(); 2366 Register scratch = scratch0();
2360 2367
2361 __ ldr(reg, FieldMemOperand(reg, JSObject::kElementsOffset)); 2368 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset));
2362 if (FLAG_debug_code) { 2369 if (FLAG_debug_code) {
2363 Label done; 2370 Label done;
2364 __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); 2371 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset));
2365 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); 2372 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
2366 __ cmp(scratch, ip); 2373 __ cmp(scratch, ip);
2367 __ b(eq, &done); 2374 __ b(eq, &done);
2375 __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex);
2376 __ cmp(scratch, ip);
2377 __ b(eq, &done);
2368 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); 2378 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
2369 __ cmp(scratch, ip); 2379 __ cmp(scratch, ip);
2370 __ Check(eq, "Check for fast elements failed."); 2380 __ Check(eq, "Check for fast elements failed.");
2371 __ bind(&done); 2381 __ bind(&done);
2372 } 2382 }
2373 } 2383 }
2374 2384
2375 2385
2386 void LCodeGen::DoLoadPixelArrayExternalPointer(
2387 LLoadPixelArrayExternalPointer* instr) {
2388 Register to_reg = ToRegister(instr->result());
2389 Register from_reg = ToRegister(instr->InputAt(0));
2390 __ ldr(to_reg, FieldMemOperand(from_reg, PixelArray::kExternalPointerOffset));
2391 }
2392
2393
2376 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2394 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2377 Register arguments = ToRegister(instr->arguments()); 2395 Register arguments = ToRegister(instr->arguments());
2378 Register length = ToRegister(instr->length()); 2396 Register length = ToRegister(instr->length());
2379 Register index = ToRegister(instr->index()); 2397 Register index = ToRegister(instr->index());
2380 Register result = ToRegister(instr->result()); 2398 Register result = ToRegister(instr->result());
2381 2399
2382 // Bailout index is not a valid argument index. Use unsigned check to get 2400 // Bailout index is not a valid argument index. Use unsigned check to get
2383 // negative check for free. 2401 // negative check for free.
2384 __ sub(length, length, index, SetCC); 2402 __ sub(length, length, index, SetCC);
2385 DeoptimizeIf(ls, instr->environment()); 2403 DeoptimizeIf(ls, instr->environment());
(...skipping 16 matching lines...) Expand all
2402 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); 2420 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2));
2403 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); 2421 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize));
2404 2422
2405 // Check for the hole value. 2423 // Check for the hole value.
2406 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); 2424 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
2407 __ cmp(result, scratch); 2425 __ cmp(result, scratch);
2408 DeoptimizeIf(eq, instr->environment()); 2426 DeoptimizeIf(eq, instr->environment());
2409 } 2427 }
2410 2428
2411 2429
2430 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) {
2431 Register external_elements = ToRegister(instr->external_pointer());
2432 Register key = ToRegister(instr->key());
2433 Register result = ToRegister(instr->result());
2434
2435 // Load the result.
2436 __ ldrb(result, MemOperand(external_elements, key));
2437 }
2438
2439
2412 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 2440 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2413 ASSERT(ToRegister(instr->object()).is(r1)); 2441 ASSERT(ToRegister(instr->object()).is(r1));
2414 ASSERT(ToRegister(instr->key()).is(r0)); 2442 ASSERT(ToRegister(instr->key()).is(r0));
2415 2443
2416 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); 2444 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
2417 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2445 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2418 } 2446 }
2419 2447
2420 2448
2421 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 2449 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
3879 3907
3880 3908
3881 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 3909 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
3882 Abort("DoOsrEntry unimplemented."); 3910 Abort("DoOsrEntry unimplemented.");
3883 } 3911 }
3884 3912
3885 3913
3886 #undef __ 3914 #undef __
3887 3915
3888 } } // namespace v8::internal 3916 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698