| 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 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1960 void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1961 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | 1961 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
| 1962 instance_call()->try_index(), | 1962 instance_call()->try_index(), |
| 1963 kDeoptPolymorphicInstanceCallTestFail); | 1963 kDeoptPolymorphicInstanceCallTestFail); |
| 1964 if (!HasICData() || (ic_data()->NumberOfChecks() == 0)) { | 1964 if (!HasICData() || (ic_data()->NumberOfChecks() == 0)) { |
| 1965 __ jmp(deopt); | 1965 __ jmp(deopt); |
| 1966 return; | 1966 return; |
| 1967 } | 1967 } |
| 1968 ASSERT(HasICData()); | 1968 ASSERT(HasICData()); |
| 1969 ASSERT(ic_data()->num_args_tested() == 1); | 1969 ASSERT(ic_data()->num_args_tested() == 1); |
| 1970 if (!with_checks()) { |
| 1971 const Function& target = Function::ZoneHandle(ic_data()->GetTargetAt(0)); |
| 1972 compiler->GenerateStaticCall(instance_call()->deopt_id(), |
| 1973 instance_call()->token_pos(), |
| 1974 instance_call()->try_index(), |
| 1975 target, |
| 1976 instance_call()->ArgumentCount(), |
| 1977 instance_call()->argument_names(), |
| 1978 locs()); |
| 1979 return; |
| 1980 } |
| 1970 Label handle_smi; | 1981 Label handle_smi; |
| 1971 Label* is_smi_label = | 1982 Label* is_smi_label = |
| 1972 ic_data()->GetReceiverClassIdAt(0) == kSmiCid ? &handle_smi : deopt; | 1983 ic_data()->GetReceiverClassIdAt(0) == kSmiCid ? &handle_smi : deopt; |
| 1973 | 1984 |
| 1974 // Load receiver into RAX. | 1985 // Load receiver into RAX. |
| 1975 __ movq(RAX, | 1986 __ movq(RAX, |
| 1976 Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize)); | 1987 Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize)); |
| 1977 __ testq(RAX, Immediate(kSmiTagMask)); | 1988 __ testq(RAX, Immediate(kSmiTagMask)); |
| 1978 __ j(ZERO, is_smi_label); | 1989 __ j(ZERO, is_smi_label); |
| 1979 Label done; | 1990 Label done; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 __ testq(value, Immediate(kSmiTagMask)); | 2214 __ testq(value, Immediate(kSmiTagMask)); |
| 2204 __ j(NOT_ZERO, deopt); | 2215 __ j(NOT_ZERO, deopt); |
| 2205 } | 2216 } |
| 2206 | 2217 |
| 2207 | 2218 |
| 2208 } // namespace dart | 2219 } // namespace dart |
| 2209 | 2220 |
| 2210 #undef __ | 2221 #undef __ |
| 2211 | 2222 |
| 2212 #endif // defined TARGET_ARCH_X64 | 2223 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |