| 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 void FlowGraphCompiler::EmitClassChecksNoSmi( | 987 void FlowGraphCompiler::EmitClassChecksNoSmi( |
| 988 const ZoneGrowableArray<intptr_t>& class_ids, | 988 const ZoneGrowableArray<intptr_t>& class_ids, |
| 989 Register instance_reg, | 989 Register instance_reg, |
| 990 Register temp_reg, | 990 Register temp_reg, |
| 991 Label* deopt) { | 991 Label* deopt) { |
| 992 Label ok; | 992 Label ok; |
| 993 ASSERT(class_ids[0] != kSmi); | 993 ASSERT(class_ids[0] != kSmi); |
| 994 __ testq(instance_reg, Immediate(kSmiTagMask)); | 994 __ testq(instance_reg, Immediate(kSmiTagMask)); |
| 995 __ j(ZERO, deopt); | 995 __ j(ZERO, deopt); |
| 996 Label is_ok; | 996 Label is_ok; |
| 997 bool jump_style = (class_ids.length() < 5) ? |
| 998 Assembler::kNearJump : Assembler::kFarJump; |
| 997 __ LoadClassId(temp_reg, instance_reg); | 999 __ LoadClassId(temp_reg, instance_reg); |
| 998 for (intptr_t i = 0; i < class_ids.length(); i++) { | 1000 for (intptr_t i = 0; i < class_ids.length(); i++) { |
| 999 __ cmpl(temp_reg, Immediate(class_ids[i])); | 1001 __ cmpl(temp_reg, Immediate(class_ids[i])); |
| 1000 if (i == (class_ids.length() - 1)) { | 1002 if (i == (class_ids.length() - 1)) { |
| 1001 __ j(NOT_EQUAL, deopt); | 1003 __ j(NOT_EQUAL, deopt); |
| 1002 } else { | 1004 } else { |
| 1003 __ j(EQUAL, &is_ok, Assembler::kNearJump); | 1005 __ j(EQUAL, &is_ok, jump_style); |
| 1004 } | 1006 } |
| 1005 } | 1007 } |
| 1006 __ Bind(&is_ok); | 1008 __ Bind(&is_ok); |
| 1007 } | 1009 } |
| 1008 | 1010 |
| 1009 | 1011 |
| 1010 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, | 1012 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, |
| 1011 Register reg, | 1013 Register reg, |
| 1012 Register temp, | 1014 Register temp, |
| 1013 Label* not_double_or_smi) { | 1015 Label* not_double_or_smi) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1024 __ cvtsi2sd(result, temp); | 1026 __ cvtsi2sd(result, temp); |
| 1025 __ Bind(&done); | 1027 __ Bind(&done); |
| 1026 } | 1028 } |
| 1027 | 1029 |
| 1028 | 1030 |
| 1029 #undef __ | 1031 #undef __ |
| 1030 | 1032 |
| 1031 } // namespace dart | 1033 } // namespace dart |
| 1032 | 1034 |
| 1033 #endif // defined TARGET_ARCH_X64 | 1035 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |