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

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

Issue 388863002: Better sequences for class id loading on ia32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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/assembler_ia32_test.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" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 return LocationSummary::Make(isolate, 938 return LocationSummary::Make(isolate,
939 kNumInputs, 939 kNumInputs,
940 Location::RequiresRegister(), 940 Location::RequiresRegister(),
941 LocationSummary::kNoCall); 941 LocationSummary::kNoCall);
942 } 942 }
943 943
944 944
945 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 945 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
946 const Register object = locs()->in(0).reg(); 946 const Register object = locs()->in(0).reg();
947 const Register result = locs()->out(0).reg(); 947 const Register result = locs()->out(0).reg();
948 Label not_smi, done; 948 Label done;
949 949
950 // We don't use Assembler::LoadTaggedClassIdMayBeSmi() here---which uses 950 // We don't use Assembler::LoadTaggedClassIdMayBeSmi() here---which uses
951 // a conditional move instead, and requires an additional register---because 951 // a conditional move instead, and requires an additional register---because
952 // it is slower, probably due to branch prediction usually working just fine 952 // it is slower, probably due to branch prediction usually working just fine
953 // in this case. 953 // in this case.
954 __ movl(result, Immediate(kSmiCid << 1));
srdjan 2014/07/11 18:23:30 ASSERT result != object
zra 2014/07/11 18:28:41 Done.
954 __ testl(object, Immediate(kSmiTagMask)); 955 __ testl(object, Immediate(kSmiTagMask));
955 __ j(NOT_ZERO, &not_smi, Assembler::kNearJump); 956 __ j(EQUAL, &done, Assembler::kNearJump);
956 __ movl(result, Immediate(Smi::RawValue(kSmiCid)));
957 __ jmp(&done, Assembler::kNearJump);
958 __ Bind(&not_smi);
959 __ LoadClassId(result, object); 957 __ LoadClassId(result, object);
960 __ SmiTag(result); 958 __ SmiTag(result);
961 __ Bind(&done); 959 __ Bind(&done);
962 } 960 }
963 961
964 962
965 CompileType LoadIndexedInstr::ComputeType() const { 963 CompileType LoadIndexedInstr::ComputeType() const {
966 switch (class_id_) { 964 switch (class_id_) {
967 case kArrayCid: 965 case kArrayCid:
968 case kImmutableArrayCid: 966 case kImmutableArrayCid:
(...skipping 5551 matching lines...) Expand 10 before | Expand all | Expand 10 after
6520 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6518 __ movl(EDX, Immediate(kInvalidObjectPointer));
6521 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6519 __ movl(EDX, Immediate(kInvalidObjectPointer));
6522 #endif 6520 #endif
6523 } 6521 }
6524 6522
6525 } // namespace dart 6523 } // namespace dart
6526 6524
6527 #undef __ 6525 #undef __
6528 6526
6529 #endif // defined TARGET_ARCH_IA32 6527 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698