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

Side by Side Diff: runtime/vm/intrinsifier_ia32.cc

Issue 13093005: Revert 12534006 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « runtime/vm/intrinsifier.h ('k') | runtime/vm/intrinsifier_x64.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 /* EDI: requested array length argument. */ \ 475 /* EDI: requested array length argument. */ \
476 __ testl(EDI, Immediate(kSmiTagSize)); \ 476 __ testl(EDI, Immediate(kSmiTagSize)); \
477 __ j(NOT_ZERO, &fall_through); \ 477 __ j(NOT_ZERO, &fall_through); \
478 __ cmpl(EDI, Immediate(0)); \ 478 __ cmpl(EDI, Immediate(0)); \
479 __ j(LESS, &fall_through); \ 479 __ j(LESS, &fall_through); \
480 __ SmiUntag(EDI); \ 480 __ SmiUntag(EDI); \
481 /* Check for maximum allowed length. */ \ 481 /* Check for maximum allowed length. */ \
482 /* EDI: untagged array length. */ \ 482 /* EDI: untagged array length. */ \
483 __ cmpl(EDI, Immediate(max_len)); \ 483 __ cmpl(EDI, Immediate(max_len)); \
484 __ j(GREATER, &fall_through); \ 484 __ j(GREATER, &fall_through); \
485 /* Special case for scaling by 16. */ \
486 if (scale_factor == TIMES_16) { \
487 /* double length of array. */ \
488 __ addl(EDI, EDI); \
489 /* only scale by 8. */ \
490 scale_factor = TIMES_8; \
491 } \
492 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \ 485 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \
493 __ leal(EDI, Address(EDI, scale_factor, fixed_size)); \ 486 __ leal(EDI, Address(EDI, scale_factor, fixed_size)); \
494 __ andl(EDI, Immediate(-kObjectAlignment)); \ 487 __ andl(EDI, Immediate(-kObjectAlignment)); \
495 Heap* heap = Isolate::Current()->heap(); \ 488 Heap* heap = Isolate::Current()->heap(); \
496 \ 489 \
497 __ movl(EAX, Address::Absolute(heap->TopAddress())); \ 490 __ movl(EAX, Address::Absolute(heap->TopAddress())); \
498 __ movl(EBX, EAX); \ 491 __ movl(EBX, EAX); \
499 \ 492 \
500 /* EDI: allocation size. */ \ 493 /* EDI: allocation size. */ \
501 __ addl(EBX, EDI); \ 494 __ addl(EBX, EDI); \
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); \ 546 __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); \
554 __ movl(Address(EDI, 0), ECX); \ 547 __ movl(Address(EDI, 0), ECX); \
555 __ addl(EDI, Immediate(kWordSize)); \ 548 __ addl(EDI, Immediate(kWordSize)); \
556 __ jmp(&init_loop, Assembler::kNearJump); \ 549 __ jmp(&init_loop, Assembler::kNearJump); \
557 __ Bind(&done); \ 550 __ Bind(&done); \
558 \ 551 \
559 __ ret(); \ 552 __ ret(); \
560 __ Bind(&fall_through); \ 553 __ Bind(&fall_through); \
561 554
562 555
563 #define SCALARLIST_ALLOCATOR(clazz, scale_) \ 556 #define SCALARLIST_ALLOCATOR(clazz, scale) \
564 bool Intrinsifier::clazz##_new(Assembler* assembler) { \ 557 bool Intrinsifier::clazz##_new(Assembler* assembler) { \
565 ScaleFactor scale = scale_; \
566 TYPED_ARRAY_ALLOCATION(clazz, k##clazz##Cid, clazz::kMaxElements, scale); \ 558 TYPED_ARRAY_ALLOCATION(clazz, k##clazz##Cid, clazz::kMaxElements, scale); \
567 return false; \ 559 return false; \
568 } \ 560 } \
569 bool Intrinsifier::clazz##_factory(Assembler* assembler) { \ 561 bool Intrinsifier::clazz##_factory(Assembler* assembler) { \
570 ScaleFactor scale = scale_; \
571 TYPED_ARRAY_ALLOCATION(clazz, k##clazz##Cid, clazz::kMaxElements, scale); \ 562 TYPED_ARRAY_ALLOCATION(clazz, k##clazz##Cid, clazz::kMaxElements, scale); \
572 return false; \ 563 return false; \
573 } 564 }
574 565
575 566
576 SCALARLIST_ALLOCATOR(Int8Array, TIMES_1) 567 SCALARLIST_ALLOCATOR(Int8Array, TIMES_1)
577 SCALARLIST_ALLOCATOR(Uint8Array, TIMES_1) 568 SCALARLIST_ALLOCATOR(Uint8Array, TIMES_1)
578 SCALARLIST_ALLOCATOR(Uint8ClampedArray, TIMES_1) 569 SCALARLIST_ALLOCATOR(Uint8ClampedArray, TIMES_1)
579 SCALARLIST_ALLOCATOR(Int16Array, TIMES_2) 570 SCALARLIST_ALLOCATOR(Int16Array, TIMES_2)
580 SCALARLIST_ALLOCATOR(Uint16Array, TIMES_2) 571 SCALARLIST_ALLOCATOR(Uint16Array, TIMES_2)
(...skipping 23 matching lines...) Expand all
604 return true; 595 return true;
605 } 596 }
606 597
607 598
608 static ScaleFactor GetScaleFactor(intptr_t size) { 599 static ScaleFactor GetScaleFactor(intptr_t size) {
609 switch (size) { 600 switch (size) {
610 case 1: return TIMES_1; 601 case 1: return TIMES_1;
611 case 2: return TIMES_2; 602 case 2: return TIMES_2;
612 case 4: return TIMES_4; 603 case 4: return TIMES_4;
613 case 8: return TIMES_8; 604 case 8: return TIMES_8;
614 case 16: return TIMES_16;
615 } 605 }
616 UNREACHABLE(); 606 UNREACHABLE();
617 return static_cast<ScaleFactor>(0); 607 return static_cast<ScaleFactor>(0);
618 }; 608 };
619 609
620 610
621 #define TYPEDDATA_ALLOCATOR(clazz) \ 611 #define TYPEDDATA_ALLOCATOR(clazz) \
622 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) { \ 612 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) { \
623 intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid); \ 613 intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid); \
624 intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid); \ 614 intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid); \
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 __ SmiTag(EAX); 1529 __ SmiTag(EAX);
1540 __ movl(FieldAddress(EBX, String::hash_offset()), EAX); 1530 __ movl(FieldAddress(EBX, String::hash_offset()), EAX);
1541 __ ret(); 1531 __ ret();
1542 return true; 1532 return true;
1543 } 1533 }
1544 1534
1545 #undef __ 1535 #undef __
1546 } // namespace dart 1536 } // namespace dart
1547 1537
1548 #endif // defined TARGET_ARCH_IA32 1538 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698