| OLD | NEW |
| 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 Loading... |
| 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 ASSERT(result != object); |
| 955 __ movl(result, Immediate(kSmiCid << 1)); |
| 954 __ testl(object, Immediate(kSmiTagMask)); | 956 __ testl(object, Immediate(kSmiTagMask)); |
| 955 __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); | 957 __ j(EQUAL, &done, Assembler::kNearJump); |
| 956 __ movl(result, Immediate(Smi::RawValue(kSmiCid))); | |
| 957 __ jmp(&done, Assembler::kNearJump); | |
| 958 __ Bind(¬_smi); | |
| 959 __ LoadClassId(result, object); | 958 __ LoadClassId(result, object); |
| 960 __ SmiTag(result); | 959 __ SmiTag(result); |
| 961 __ Bind(&done); | 960 __ Bind(&done); |
| 962 } | 961 } |
| 963 | 962 |
| 964 | 963 |
| 965 CompileType LoadIndexedInstr::ComputeType() const { | 964 CompileType LoadIndexedInstr::ComputeType() const { |
| 966 switch (class_id_) { | 965 switch (class_id_) { |
| 967 case kArrayCid: | 966 case kArrayCid: |
| 968 case kImmutableArrayCid: | 967 case kImmutableArrayCid: |
| (...skipping 5551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6520 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6519 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6521 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6520 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6522 #endif | 6521 #endif |
| 6523 } | 6522 } |
| 6524 | 6523 |
| 6525 } // namespace dart | 6524 } // namespace dart |
| 6526 | 6525 |
| 6527 #undef __ | 6526 #undef __ |
| 6528 | 6527 |
| 6529 #endif // defined TARGET_ARCH_IA32 | 6528 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |