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

Side by Side Diff: src/arm/ic-arm.cc

Issue 6323002: Add custom typed ICs for pixel array loads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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/builtins.h » ('j') | src/ia32/ic-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 1367
1368 // Perform tail call to the entry. 1368 // Perform tail call to the entry.
1369 __ TailCallExternalReference(ExternalReference( 1369 __ TailCallExternalReference(ExternalReference(
1370 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); 1370 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
1371 1371
1372 __ bind(&slow); 1372 __ bind(&slow);
1373 GenerateMiss(masm); 1373 GenerateMiss(masm);
1374 } 1374 }
1375 1375
1376 1376
1377 void KeyedLoadIC::GeneratePixelArray(MacroAssembler* masm) {
1378 // ---------- S t a t e --------------
1379 // -- lr : return address
1380 // -- r0 : key
1381 // -- r1 : receiver
1382 // -----------------------------------
1383
1384 // Register usage.
1385 Register key = r0;
1386 Register receiver = r1;
1387 Register elements = r2;
1388 Register elements_map = r3;
1389 Register index = r4;
1390
1391 Label slow;
1392
1393 // Receiver must not be smi and its element map must be a pixel array.
1394 __ BranchOnSmi(receiver, &slow);
1395 __ ldr(elements, FieldMemOperand(r1, JSObject::kElementsOffset));
Mads Ager (chromium) 2011/01/25 14:49:17 We need to check that the receiver is a JSObject b
danno 2011/01/25 20:56:29 Done.
1396 __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex);
1397 __ ldr(elements_map, FieldMemOperand(elements, JSObject::kMapOffset));
1398 __ cmp(elements_map, ip);
1399 __ b(ne, &slow);
1400
1401 // Key must be a smi that is in range of the pixel array.
1402 __ BranchOnNotSmi(key, &slow);
1403 __ ldr(ip, FieldMemOperand(elements, PixelArray::kLengthOffset));
Mads Ager (chromium) 2011/01/25 14:49:17 Since we have enough register here, I would prefer
danno 2011/01/25 20:56:29 Done.
1404 __ mov(index, Operand(key, ASR, kSmiTagSize));
1405 __ cmp(index, ip);
1406 __ b(hs, &slow);
1407
1408 // Perform the indexed load and tag it as a smi.
1409 __ ldr(ip, FieldMemOperand(elements, PixelArray::kExternalPointerOffset));
Mads Ager (chromium) 2011/01/25 14:49:17 Ditto for using ip.
danno 2011/01/25 20:56:29 Done.
1410 __ ldrb(r2, MemOperand(ip, index));
1411 __ mov(r0, Operand(r2, LSL, kSmiTagSize)); // Tag result as smi.
1412 __ Ret();
1413
1414 __ bind(&slow);
1415 GenerateMiss(masm);
1416 }
1417
1418
1377 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1419 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
1378 // ---------- S t a t e -------------- 1420 // ---------- S t a t e --------------
1379 // -- r0 : value 1421 // -- r0 : value
1380 // -- r1 : key 1422 // -- r1 : key
1381 // -- r2 : receiver 1423 // -- r2 : receiver
1382 // -- lr : return address 1424 // -- lr : return address
1383 // ----------------------------------- 1425 // -----------------------------------
1384 1426
1385 // Push receiver, key and value for runtime call. 1427 // Push receiver, key and value for runtime call.
1386 __ Push(r2, r1, r0); 1428 __ Push(r2, r1, r0);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 1746
1705 1747
1706 void PatchInlinedSmiCode(Address address) { 1748 void PatchInlinedSmiCode(Address address) {
1707 UNIMPLEMENTED(); 1749 UNIMPLEMENTED();
1708 } 1750 }
1709 1751
1710 1752
1711 } } // namespace v8::internal 1753 } } // namespace v8::internal
1712 1754
1713 #endif // V8_TARGET_ARCH_ARM 1755 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | src/ia32/ic-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698