| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 | 998 |
| 999 // Load function object using the callee's pool pointer. | 999 // Load function object using the callee's pool pointer. |
| 1000 __ LoadObject(function_reg, function, new_pp); | 1000 __ LoadObject(function_reg, function, new_pp); |
| 1001 | 1001 |
| 1002 // Patch point is after the eventually inlined function object. | 1002 // Patch point is after the eventually inlined function object. |
| 1003 entry_patch_pc_offset_ = assembler()->CodeSize(); | 1003 entry_patch_pc_offset_ = assembler()->CodeSize(); |
| 1004 | 1004 |
| 1005 if (is_optimizing()) { | 1005 if (is_optimizing()) { |
| 1006 // Reoptimization of an optimized function is triggered by counting in | 1006 // Reoptimization of an optimized function is triggered by counting in |
| 1007 // IC stubs, but not at the entry of the function. | 1007 // IC stubs, but not at the entry of the function. |
| 1008 __ CompareImmediate( | 1008 __ cmpl( |
| 1009 FieldAddress(function_reg, Function::usage_counter_offset()), | 1009 FieldAddress(function_reg, Function::usage_counter_offset()), |
| 1010 Immediate(FLAG_reoptimization_counter_threshold), | 1010 Immediate(FLAG_reoptimization_counter_threshold)); |
| 1011 new_pp); | |
| 1012 } else { | 1011 } else { |
| 1013 __ incq(FieldAddress(function_reg, Function::usage_counter_offset())); | 1012 __ incl(FieldAddress(function_reg, Function::usage_counter_offset())); |
| 1014 __ CompareImmediate( | 1013 __ cmpl( |
| 1015 FieldAddress(function_reg, Function::usage_counter_offset()), | 1014 FieldAddress(function_reg, Function::usage_counter_offset()), |
| 1016 Immediate(FLAG_optimization_counter_threshold), | 1015 Immediate(FLAG_optimization_counter_threshold)); |
| 1017 new_pp); | |
| 1018 } | 1016 } |
| 1019 ASSERT(function_reg == RDI); | 1017 ASSERT(function_reg == RDI); |
| 1020 __ J(GREATER_EQUAL, &StubCode::OptimizeFunctionLabel(), R13); | 1018 __ J(GREATER_EQUAL, &StubCode::OptimizeFunctionLabel(), R13); |
| 1021 } else if (!flow_graph().IsCompiledForOsr()) { | 1019 } else if (!flow_graph().IsCompiledForOsr()) { |
| 1022 // We have to load the PP here too because a load of an external label | 1020 // We have to load the PP here too because a load of an external label |
| 1023 // may be patched at the AddCurrentDescriptor below. | 1021 // may be patched at the AddCurrentDescriptor below. |
| 1024 new_pp = R13; | 1022 new_pp = R13; |
| 1025 new_pc = R12; | 1023 new_pc = R12; |
| 1026 | 1024 |
| 1027 Label next; | 1025 Label next; |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1702 __ movups(reg, Address(RSP, 0)); | 1700 __ movups(reg, Address(RSP, 0)); |
| 1703 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1701 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1704 } | 1702 } |
| 1705 | 1703 |
| 1706 | 1704 |
| 1707 #undef __ | 1705 #undef __ |
| 1708 | 1706 |
| 1709 } // namespace dart | 1707 } // namespace dart |
| 1710 | 1708 |
| 1711 #endif // defined TARGET_ARCH_X64 | 1709 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |