| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 locs()); | 97 locs()); |
| 98 __ Bind(&done); | 98 __ Bind(&done); |
| 99 } | 99 } |
| 100 } else { | 100 } else { |
| 101 __ Comment("Check function counter"); | 101 __ Comment("Check function counter"); |
| 102 // Count only in unoptimized code. | 102 // Count only in unoptimized code. |
| 103 // TODO(srdjan): Replace the counting code with a type feedback | 103 // TODO(srdjan): Replace the counting code with a type feedback |
| 104 // collection and counting stub. | 104 // collection and counting stub. |
| 105 __ LoadObject(func_reg, function); | 105 __ LoadObject(func_reg, function); |
| 106 __ incq(FieldAddress(func_reg, Function::usage_counter_offset())); | 106 __ incq(FieldAddress(func_reg, Function::usage_counter_offset())); |
| 107 if (FlowGraphCompiler::CanOptimize() && | 107 if (compiler->CanOptimizeFunction() && |
| 108 compiler->parsed_function().function().is_optimizable()) { | 108 compiler->parsed_function().function().is_optimizable()) { |
| 109 // Do not optimize if usage count must be reported. | 109 // Do not optimize if usage count must be reported. |
| 110 __ cmpq(FieldAddress(func_reg, Function::usage_counter_offset()), | 110 __ cmpq(FieldAddress(func_reg, Function::usage_counter_offset()), |
| 111 Immediate(FLAG_optimization_counter_threshold)); | 111 Immediate(FLAG_optimization_counter_threshold)); |
| 112 Label not_yet_hot; | 112 Label not_yet_hot; |
| 113 __ j(LESS, ¬_yet_hot, Assembler::kNearJump); | 113 __ j(LESS, ¬_yet_hot, Assembler::kNearJump); |
| 114 // Equal (or greater), optimize. | 114 // Equal (or greater), optimize. |
| 115 // The stub call preserves result register(RAX) | 115 // The stub call preserves result register(RAX) |
| 116 ASSERT(func_reg == RDX); | 116 ASSERT(func_reg == RDX); |
| 117 compiler->GenerateCall(0, // no token position. | 117 compiler->GenerateCall(0, // no token position. |
| (...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2488 | 2488 |
| 2489 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2489 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2490 UNIMPLEMENTED(); | 2490 UNIMPLEMENTED(); |
| 2491 } | 2491 } |
| 2492 | 2492 |
| 2493 } // namespace dart | 2493 } // namespace dart |
| 2494 | 2494 |
| 2495 #undef __ | 2495 #undef __ |
| 2496 | 2496 |
| 2497 #endif // defined TARGET_ARCH_X64 | 2497 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |