OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 Label is_ok; | 2054 Label is_ok; |
2055 intptr_t cix = 0; | 2055 intptr_t cix = 0; |
2056 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { | 2056 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { |
2057 __ testq(value, Immediate(kSmiTagMask)); | 2057 __ testq(value, Immediate(kSmiTagMask)); |
2058 __ j(ZERO, &is_ok); | 2058 __ j(ZERO, &is_ok); |
2059 cix++; // Skip first check. | 2059 cix++; // Skip first check. |
2060 } else { | 2060 } else { |
2061 __ testq(value, Immediate(kSmiTagMask)); | 2061 __ testq(value, Immediate(kSmiTagMask)); |
2062 __ j(ZERO, deopt); | 2062 __ j(ZERO, deopt); |
2063 } | 2063 } |
| 2064 __ LoadClassId(temp, value); |
2064 const intptr_t num_checks = unary_checks().NumberOfChecks(); | 2065 const intptr_t num_checks = unary_checks().NumberOfChecks(); |
2065 const bool use_near_jump = num_checks < 5; | 2066 const bool use_near_jump = num_checks < 5; |
2066 for (intptr_t i = cix; i < num_checks; i++) { | 2067 for (intptr_t i = cix; i < num_checks; i++) { |
2067 ASSERT(unary_checks().GetReceiverClassIdAt(i) != kSmiCid); | 2068 ASSERT(unary_checks().GetReceiverClassIdAt(i) != kSmiCid); |
2068 __ cmpl(temp, Immediate(unary_checks().GetReceiverClassIdAt(i))); | 2069 __ cmpl(temp, Immediate(unary_checks().GetReceiverClassIdAt(i))); |
2069 if (i == (num_checks - 1)) { | 2070 if (i == (num_checks - 1)) { |
2070 __ j(NOT_EQUAL, deopt); | 2071 __ j(NOT_EQUAL, deopt); |
2071 } else { | 2072 } else { |
2072 if (use_near_jump) { | 2073 if (use_near_jump) { |
2073 __ j(EQUAL, &is_ok, Assembler::kNearJump); | 2074 __ j(EQUAL, &is_ok, Assembler::kNearJump); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2196 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2196 UNIMPLEMENTED(); | 2197 UNIMPLEMENTED(); |
2197 } | 2198 } |
2198 | 2199 |
2199 | 2200 |
2200 } // namespace dart | 2201 } // namespace dart |
2201 | 2202 |
2202 #undef __ | 2203 #undef __ |
2203 | 2204 |
2204 #endif // defined TARGET_ARCH_X64 | 2205 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |