| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ASSERT(func_reg == EDX); | 93 ASSERT(func_reg == EDX); |
| 94 compiler->GenerateCall(0, // no token position. | 94 compiler->GenerateCall(0, // no token position. |
| 95 &StubCode::OptimizeFunctionLabel(), | 95 &StubCode::OptimizeFunctionLabel(), |
| 96 PcDescriptors::kOther, | 96 PcDescriptors::kOther, |
| 97 locs()); | 97 locs()); |
| 98 __ Bind(&done); | 98 __ Bind(&done); |
| 99 } | 99 } |
| 100 } else { | 100 } else { |
| 101 __ LoadObject(func_reg, function); | 101 __ LoadObject(func_reg, function); |
| 102 __ incl(FieldAddress(func_reg, Function::usage_counter_offset())); | 102 __ incl(FieldAddress(func_reg, Function::usage_counter_offset())); |
| 103 if (FlowGraphCompiler::CanOptimize() && | 103 if (compiler->CanOptimizeFunction() && |
| 104 compiler->parsed_function().function().is_optimizable()) { | 104 compiler->parsed_function().function().is_optimizable()) { |
| 105 // Do not optimize if usage count must be reported. | 105 // Do not optimize if usage count must be reported. |
| 106 __ cmpl(FieldAddress(func_reg, Function::usage_counter_offset()), | 106 __ cmpl(FieldAddress(func_reg, Function::usage_counter_offset()), |
| 107 Immediate(FLAG_optimization_counter_threshold)); | 107 Immediate(FLAG_optimization_counter_threshold)); |
| 108 Label not_yet_hot; | 108 Label not_yet_hot; |
| 109 __ j(LESS, ¬_yet_hot, Assembler::kNearJump); | 109 __ j(LESS, ¬_yet_hot, Assembler::kNearJump); |
| 110 // Equal (or greater), optimize. | 110 // Equal (or greater), optimize. |
| 111 // The stub call preserves result register (EAX). | 111 // The stub call preserves result register (EAX). |
| 112 ASSERT(func_reg == EDX); | 112 ASSERT(func_reg == EDX); |
| 113 compiler->GenerateCall(0, // no token position. | 113 compiler->GenerateCall(0, // no token position. |
| (...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2841 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. | 2841 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. |
| 2842 __ pxor(value, XMM0); | 2842 __ pxor(value, XMM0); |
| 2843 } | 2843 } |
| 2844 | 2844 |
| 2845 | 2845 |
| 2846 } // namespace dart | 2846 } // namespace dart |
| 2847 | 2847 |
| 2848 #undef __ | 2848 #undef __ |
| 2849 | 2849 |
| 2850 #endif // defined TARGET_ARCH_X64 | 2850 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |