Chromium Code Reviews| 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_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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1947 void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1947 void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1948 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | 1948 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
| 1949 instance_call()->try_index(), | 1949 instance_call()->try_index(), |
| 1950 kDeoptPolymorphicInstanceCallTestFail); | 1950 kDeoptPolymorphicInstanceCallTestFail); |
| 1951 if (!HasICData() || (ic_data()->NumberOfChecks() == 0)) { | 1951 if (!HasICData() || (ic_data()->NumberOfChecks() == 0)) { |
| 1952 __ jmp(deopt); | 1952 __ jmp(deopt); |
| 1953 return; | 1953 return; |
| 1954 } | 1954 } |
| 1955 ASSERT(HasICData()); | 1955 ASSERT(HasICData()); |
| 1956 ASSERT(ic_data()->num_args_tested() == 1); | 1956 ASSERT(ic_data()->num_args_tested() == 1); |
| 1957 if (!with_checks()) { | |
| 1958 const Function& target = Function::ZoneHandle(ic_data()->GetTargetAt(0)); | |
| 1959 compiler->GenerateStaticCall(instance_call()->deopt_id(), | |
| 1960 instance_call()->token_pos(), | |
| 1961 instance_call()->try_index(), | |
| 1962 target, | |
| 1963 instance_call()->ArgumentCount(), | |
| 1964 instance_call()->argument_names(), | |
| 1965 locs()); | |
| 1966 return; | |
| 1967 } | |
|
regis
2012/08/23 21:08:09
You could factorize this code that is repeated bel
| |
| 1957 Label handle_smi; | 1968 Label handle_smi; |
| 1958 Label* is_smi_label = | 1969 Label* is_smi_label = |
| 1959 ic_data()->GetReceiverClassIdAt(0) == kSmiCid ? &handle_smi : deopt; | 1970 ic_data()->GetReceiverClassIdAt(0) == kSmiCid ? &handle_smi : deopt; |
| 1960 | 1971 |
| 1961 // Load receiver into EAX. | 1972 // Load receiver into EAX. |
| 1962 __ movl(EAX, | 1973 __ movl(EAX, |
| 1963 Address(ESP, (instance_call()->ArgumentCount() - 1) * kWordSize)); | 1974 Address(ESP, (instance_call()->ArgumentCount() - 1) * kWordSize)); |
| 1964 __ testl(EAX, Immediate(kSmiTagMask)); | 1975 __ testl(EAX, Immediate(kSmiTagMask)); |
| 1965 __ j(ZERO, is_smi_label); | 1976 __ j(ZERO, is_smi_label); |
| 1966 Label done; | 1977 Label done; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2191 __ testl(value, Immediate(kSmiTagMask)); | 2202 __ testl(value, Immediate(kSmiTagMask)); |
| 2192 __ j(NOT_ZERO, deopt); | 2203 __ j(NOT_ZERO, deopt); |
| 2193 } | 2204 } |
| 2194 | 2205 |
| 2195 | 2206 |
| 2196 } // namespace dart | 2207 } // namespace dart |
| 2197 | 2208 |
| 2198 #undef __ | 2209 #undef __ |
| 2199 | 2210 |
| 2200 #endif // defined TARGET_ARCH_X64 | 2211 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |