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

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

Issue 259393002: Enums cleanup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/stub_code_mips.cc ('k') | no next file » | 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 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 // RAX: new object start as a tagged pointer. 628 // RAX: new object start as a tagged pointer.
629 // R12: new object end address. 629 // R12: new object end address.
630 // R10: Array length as Smi. 630 // R10: Array length as Smi.
631 { 631 {
632 Label size_tag_overflow, done; 632 Label size_tag_overflow, done;
633 __ leaq(RBX, Address(R10, TIMES_4, fixed_size)); // R10 is Smi. 633 __ leaq(RBX, Address(R10, TIMES_4, fixed_size)); // R10 is Smi.
634 ASSERT(kSmiTagShift == 1); 634 ASSERT(kSmiTagShift == 1);
635 __ andq(RBX, Immediate(-kObjectAlignment)); 635 __ andq(RBX, Immediate(-kObjectAlignment));
636 __ cmpq(RBX, Immediate(RawObject::SizeTag::kMaxSizeTag)); 636 __ cmpq(RBX, Immediate(RawObject::SizeTag::kMaxSizeTag));
637 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); 637 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
638 __ shlq(RBX, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); 638 __ shlq(RBX, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2));
639 __ jmp(&done); 639 __ jmp(&done);
640 640
641 __ Bind(&size_tag_overflow); 641 __ Bind(&size_tag_overflow);
642 __ movq(RBX, Immediate(0)); 642 __ movq(RBX, Immediate(0));
643 __ Bind(&done); 643 __ Bind(&done);
644 644
645 // Get the class index and insert it into the tags. 645 // Get the class index and insert it into the tags.
646 __ orq(RBX, Immediate(RawObject::ClassIdTag::encode(kArrayCid))); 646 __ orq(RBX, Immediate(RawObject::ClassIdTag::encode(kArrayCid)));
647 __ movq(FieldAddress(RAX, Array::tags_offset()), RBX); 647 __ movq(FieldAddress(RAX, Array::tags_offset()), RBX);
648 } 648 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
890 // Calculate the size tag. 890 // Calculate the size tag.
891 // RAX: new object. 891 // RAX: new object.
892 // R10: number of context variables. 892 // R10: number of context variables.
893 { 893 {
894 Label size_tag_overflow, done; 894 Label size_tag_overflow, done;
895 __ leaq(R13, Address(R10, TIMES_8, fixed_size)); 895 __ leaq(R13, Address(R10, TIMES_8, fixed_size));
896 __ andq(R13, Immediate(-kObjectAlignment)); 896 __ andq(R13, Immediate(-kObjectAlignment));
897 __ cmpq(R13, Immediate(RawObject::SizeTag::kMaxSizeTag)); 897 __ cmpq(R13, Immediate(RawObject::SizeTag::kMaxSizeTag));
898 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); 898 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
899 __ shlq(R13, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); 899 __ shlq(R13, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2));
900 __ jmp(&done); 900 __ jmp(&done);
901 901
902 __ Bind(&size_tag_overflow); 902 __ Bind(&size_tag_overflow);
903 // Set overflow size tag value. 903 // Set overflow size tag value.
904 __ movq(R13, Immediate(0)); 904 __ movq(R13, Immediate(0));
905 905
906 __ Bind(&done); 906 __ Bind(&done);
907 // RAX: new object. 907 // RAX: new object.
908 // R10: number of context variables. 908 // R10: number of context variables.
909 // R13: size and bit tags. 909 // R13: size and bit tags.
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 1845
1846 __ movq(left, Address(RSP, 2 * kWordSize)); 1846 __ movq(left, Address(RSP, 2 * kWordSize));
1847 __ movq(right, Address(RSP, 1 * kWordSize)); 1847 __ movq(right, Address(RSP, 1 * kWordSize));
1848 GenerateIdenticalWithNumberCheckStub(assembler, left, right); 1848 GenerateIdenticalWithNumberCheckStub(assembler, left, right);
1849 __ ret(); 1849 __ ret();
1850 } 1850 }
1851 1851
1852 } // namespace dart 1852 } // namespace dart
1853 1853
1854 #endif // defined TARGET_ARCH_X64 1854 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698