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

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') | no next file with comments »
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 Register scratch1 = r5;
1391 Register scratch2 = r6;
1392
1393 Label slow;
1394
1395 // Verify that it's safe to access the receiver's elements.
1396 GenerateKeyedLoadReceiverCheck(
1397 masm, receiver, scratch1, scratch2,
1398 Map::kHasIndexedInterceptor, &slow);
1399
1400 // Verify that the receiver has pixel array elements.
1401 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset));
1402 __ LoadRoot(scratch1, Heap::kPixelArrayMapRootIndex);
1403 __ ldr(elements_map, FieldMemOperand(elements, JSObject::kMapOffset));
1404 __ cmp(elements_map, scratch1);
1405 __ b(ne, &slow);
1406
1407 // Key must be a smi that is in the range of the pixel array.
1408 __ BranchOnNotSmi(key, &slow);
Søren Thygesen Gjesse 2011/01/26 21:35:17 This has changed to JumpIfNotSmi.
danno 2011/01/28 10:32:08 Done.
1409 __ ldr(scratch1, FieldMemOperand(elements, PixelArray::kLengthOffset));
1410 __ mov(index, Operand(key, ASR, kSmiTagSize)); // Untag index
Søren Thygesen Gjesse 2011/01/26 21:35:17 There is a SmiUntag instruction in the macro assem
danno 2011/01/28 10:32:08 Done.
1411 __ cmp(index, scratch1);
1412 __ b(hs, &slow);
1413
1414 // Perform the indexed load and tag the result as a smi.
1415 __ ldr(scratch1,
1416 FieldMemOperand(elements, PixelArray::kExternalPointerOffset));
1417 __ ldrb(scratch2, MemOperand(scratch1, index));
1418 __ mov(r0, Operand(scratch2, LSL, kSmiTagSize)); // Tag result as smi.
Søren Thygesen Gjesse 2011/01/26 21:35:17 There is also a SmiTag which takes two registers,
danno 2011/01/28 10:32:08 Done.
1419 __ Ret();
1420
1421 __ bind(&slow);
1422 GenerateMiss(masm);
1423 }
1424
1425
1377 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1426 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
1378 // ---------- S t a t e -------------- 1427 // ---------- S t a t e --------------
1379 // -- r0 : value 1428 // -- r0 : value
1380 // -- r1 : key 1429 // -- r1 : key
1381 // -- r2 : receiver 1430 // -- r2 : receiver
1382 // -- lr : return address 1431 // -- lr : return address
1383 // ----------------------------------- 1432 // -----------------------------------
1384 1433
1385 // Push receiver, key and value for runtime call. 1434 // Push receiver, key and value for runtime call.
1386 __ Push(r2, r1, r0); 1435 __ Push(r2, r1, r0);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 1753
1705 1754
1706 void PatchInlinedSmiCode(Address address) { 1755 void PatchInlinedSmiCode(Address address) {
1707 UNIMPLEMENTED(); 1756 UNIMPLEMENTED();
1708 } 1757 }
1709 1758
1710 1759
1711 } } // namespace v8::internal 1760 } } // namespace v8::internal
1712 1761
1713 #endif // V8_TARGET_ARCH_ARM 1762 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698