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

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

Issue 313083008: Add LoadTaggedClassIdMayBeSmi to assembly and improve performance of inline cache stubs. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_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" // 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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 return LocationSummary::Make(isolate, 932 return LocationSummary::Make(isolate,
933 kNumInputs, 933 kNumInputs,
934 Location::RequiresRegister(), 934 Location::RequiresRegister(),
935 LocationSummary::kNoCall); 935 LocationSummary::kNoCall);
936 } 936 }
937 937
938 938
939 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 939 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
940 Register object = locs()->in(0).reg(); 940 Register object = locs()->in(0).reg();
941 Register result = locs()->out(0).reg(); 941 Register result = locs()->out(0).reg();
942 Label load, done; 942 __ LoadTaggedClassIdMayBeSmi(result, object);
943 __ testl(object, Immediate(kSmiTagMask));
944 __ j(NOT_ZERO, &load, Assembler::kNearJump);
945 __ movl(result, Immediate(Smi::RawValue(kSmiCid)));
946 __ jmp(&done);
947 __ Bind(&load);
948 __ LoadClassId(result, object);
949 __ SmiTag(result);
950 __ Bind(&done);
951 } 943 }
952 944
953 945
954 CompileType LoadIndexedInstr::ComputeType() const { 946 CompileType LoadIndexedInstr::ComputeType() const {
955 switch (class_id_) { 947 switch (class_id_) {
956 case kArrayCid: 948 case kArrayCid:
957 case kImmutableArrayCid: 949 case kImmutableArrayCid:
958 return CompileType::Dynamic(); 950 return CompileType::Dynamic();
959 951
960 case kTypedDataFloat32ArrayCid: 952 case kTypedDataFloat32ArrayCid:
(...skipping 5335 matching lines...) Expand 10 before | Expand all | Expand 10 after
6296 PcDescriptors::kOther, 6288 PcDescriptors::kOther,
6297 locs()); 6289 locs());
6298 __ Drop(ArgumentCount()); // Discard arguments. 6290 __ Drop(ArgumentCount()); // Discard arguments.
6299 } 6291 }
6300 6292
6301 } // namespace dart 6293 } // namespace dart
6302 6294
6303 #undef __ 6295 #undef __
6304 6296
6305 #endif // defined TARGET_ARCH_IA32 6297 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698