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

Side by Side Diff: runtime/vm/stub_code_ia32.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_arm64.cc ('k') | runtime/vm/stub_code_mips.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 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 // EAX: new object start as a tagged pointer. 679 // EAX: new object start as a tagged pointer.
680 // EBX: new object end address. 680 // EBX: new object end address.
681 // EDX: Array length as Smi. 681 // EDX: Array length as Smi.
682 { 682 {
683 Label size_tag_overflow, done; 683 Label size_tag_overflow, done;
684 __ leal(ECX, Address(EDX, TIMES_2, fixed_size)); // EDX is Smi. 684 __ leal(ECX, Address(EDX, TIMES_2, fixed_size)); // EDX is Smi.
685 ASSERT(kSmiTagShift == 1); 685 ASSERT(kSmiTagShift == 1);
686 __ andl(ECX, Immediate(-kObjectAlignment)); 686 __ andl(ECX, Immediate(-kObjectAlignment));
687 __ cmpl(ECX, Immediate(RawObject::SizeTag::kMaxSizeTag)); 687 __ cmpl(ECX, Immediate(RawObject::SizeTag::kMaxSizeTag));
688 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); 688 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
689 __ shll(ECX, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); 689 __ shll(ECX, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2));
690 __ jmp(&done); 690 __ jmp(&done);
691 691
692 __ Bind(&size_tag_overflow); 692 __ Bind(&size_tag_overflow);
693 __ movl(ECX, Immediate(0)); 693 __ movl(ECX, Immediate(0));
694 __ Bind(&done); 694 __ Bind(&done);
695 695
696 // Get the class index and insert it into the tags. 696 // Get the class index and insert it into the tags.
697 __ orl(ECX, Immediate(RawObject::ClassIdTag::encode(kArrayCid))); 697 __ orl(ECX, Immediate(RawObject::ClassIdTag::encode(kArrayCid)));
698 __ movl(FieldAddress(EAX, Array::tags_offset()), ECX); 698 __ movl(FieldAddress(EAX, Array::tags_offset()), ECX);
699 } 699 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 935
936 // Calculate the size tag. 936 // Calculate the size tag.
937 // EAX: new object. 937 // EAX: new object.
938 // EDX: number of context variables. 938 // EDX: number of context variables.
939 { 939 {
940 Label size_tag_overflow, done; 940 Label size_tag_overflow, done;
941 __ leal(EBX, Address(EDX, TIMES_4, fixed_size)); 941 __ leal(EBX, Address(EDX, TIMES_4, fixed_size));
942 __ andl(EBX, Immediate(-kObjectAlignment)); 942 __ andl(EBX, Immediate(-kObjectAlignment));
943 __ cmpl(EBX, Immediate(RawObject::SizeTag::kMaxSizeTag)); 943 __ cmpl(EBX, Immediate(RawObject::SizeTag::kMaxSizeTag));
944 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); 944 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
945 __ shll(EBX, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); 945 __ shll(EBX, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2));
946 __ jmp(&done); 946 __ jmp(&done);
947 947
948 __ Bind(&size_tag_overflow); 948 __ Bind(&size_tag_overflow);
949 // Set overflow size tag value. 949 // Set overflow size tag value.
950 __ movl(EBX, Immediate(0)); 950 __ movl(EBX, Immediate(0));
951 951
952 __ Bind(&done); 952 __ Bind(&done);
953 // EAX: new object. 953 // EAX: new object.
954 // EDX: number of context variables. 954 // EDX: number of context variables.
955 // EBX: size and bit tags. 955 // EBX: size and bit tags.
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 const Register temp = ECX; 1920 const Register temp = ECX;
1921 __ movl(left, Address(ESP, 2 * kWordSize)); 1921 __ movl(left, Address(ESP, 2 * kWordSize));
1922 __ movl(right, Address(ESP, 1 * kWordSize)); 1922 __ movl(right, Address(ESP, 1 * kWordSize));
1923 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1923 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1924 __ ret(); 1924 __ ret();
1925 } 1925 }
1926 1926
1927 } // namespace dart 1927 } // namespace dart
1928 1928
1929 #endif // defined TARGET_ARCH_IA32 1929 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698