| 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_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/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" |
| 11 #include "vm/code_patcher.h" |
| 11 #include "vm/compiler.h" | 12 #include "vm/compiler.h" |
| 12 #include "vm/cpu.h" | 13 #include "vm/cpu.h" |
| 13 #include "vm/dart_entry.h" | 14 #include "vm/dart_entry.h" |
| 14 #include "vm/deopt_instructions.h" | 15 #include "vm/deopt_instructions.h" |
| 15 #include "vm/flow_graph_builder.h" | 16 #include "vm/flow_graph_builder.h" |
| 16 #include "vm/il_printer.h" | 17 #include "vm/il_printer.h" |
| 17 #include "vm/locations.h" | 18 #include "vm/locations.h" |
| 18 #include "vm/object_store.h" | 19 #include "vm/object_store.h" |
| 19 #include "vm/parser.h" | 20 #include "vm/parser.h" |
| 20 #include "vm/stack_frame.h" | 21 #include "vm/stack_frame.h" |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 void FlowGraphCompiler::EmitEdgeCounter() { | 1187 void FlowGraphCompiler::EmitEdgeCounter() { |
| 1187 // We do not check for overflow when incrementing the edge counter. The | 1188 // We do not check for overflow when incrementing the edge counter. The |
| 1188 // function should normally be optimized long before the counter can | 1189 // function should normally be optimized long before the counter can |
| 1189 // overflow; and though we do not reset the counters when we optimize or | 1190 // overflow; and though we do not reset the counters when we optimize or |
| 1190 // deoptimize, there is a bound on the number of | 1191 // deoptimize, there is a bound on the number of |
| 1191 // optimization/deoptimization cycles we will attempt. | 1192 // optimization/deoptimization cycles we will attempt. |
| 1192 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); | 1193 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
| 1193 counter.SetAt(0, Smi::Handle(Smi::New(0))); | 1194 counter.SetAt(0, Smi::Handle(Smi::New(0))); |
| 1194 __ Comment("Edge counter"); | 1195 __ Comment("Edge counter"); |
| 1195 __ LoadObject(EAX, counter); | 1196 __ LoadObject(EAX, counter); |
| 1196 __ addl(FieldAddress(EAX, Array::element_offset(0)), | 1197 #if defined(DEBUG) |
| 1197 Immediate(Smi::RawValue(1))); | 1198 intptr_t increment_start = assembler_->CodeSize(); |
| 1199 #endif // DEBUG |
| 1200 __ IncrementSmiField(FieldAddress(EAX, Array::element_offset(0)), 1); |
| 1201 DEBUG_ASSERT((assembler_->CodeSize() - increment_start) == |
| 1202 CodePatcher::EdgeCounterIncrementSizeInBytes()); |
| 1198 } | 1203 } |
| 1199 | 1204 |
| 1200 | 1205 |
| 1201 void FlowGraphCompiler::EmitOptimizedInstanceCall( | 1206 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
| 1202 ExternalLabel* target_label, | 1207 ExternalLabel* target_label, |
| 1203 const ICData& ic_data, | 1208 const ICData& ic_data, |
| 1204 intptr_t argument_count, | 1209 intptr_t argument_count, |
| 1205 intptr_t deopt_id, | 1210 intptr_t deopt_id, |
| 1206 intptr_t token_pos, | 1211 intptr_t token_pos, |
| 1207 LocationSummary* locs) { | 1212 LocationSummary* locs) { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 __ movups(reg, Address(ESP, 0)); | 1773 __ movups(reg, Address(ESP, 0)); |
| 1769 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1774 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1770 } | 1775 } |
| 1771 | 1776 |
| 1772 | 1777 |
| 1773 #undef __ | 1778 #undef __ |
| 1774 | 1779 |
| 1775 } // namespace dart | 1780 } // namespace dart |
| 1776 | 1781 |
| 1777 #endif // defined TARGET_ARCH_IA32 | 1782 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |