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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
11 #include "vm/flow_graph_compiler.h" | 11 #include "vm/flow_graph_compiler.h" |
12 #include "vm/locations.h" | 12 #include "vm/locations.h" |
13 #include "vm/object_store.h" | 13 #include "vm/object_store.h" |
14 #include "vm/parser.h" | 14 #include "vm/parser.h" |
15 #include "vm/stack_frame.h" | 15 #include "vm/stack_frame.h" |
16 #include "vm/stub_code.h" | 16 #include "vm/stub_code.h" |
17 #include "vm/symbols.h" | 17 #include "vm/symbols.h" |
18 | 18 |
19 #define __ compiler->assembler()-> | 19 #define __ compiler->assembler()-> |
20 | 20 |
21 namespace dart { | 21 namespace dart { |
22 | 22 |
| 23 DECLARE_FLAG(bool, emit_edge_counters); |
23 DECLARE_FLAG(int, optimization_counter_threshold); | 24 DECLARE_FLAG(int, optimization_counter_threshold); |
24 DECLARE_FLAG(bool, propagate_ic_data); | 25 DECLARE_FLAG(bool, propagate_ic_data); |
25 DECLARE_FLAG(bool, use_osr); | 26 DECLARE_FLAG(bool, use_osr); |
26 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 27 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
27 DECLARE_FLAG(bool, use_slow_path); | 28 DECLARE_FLAG(bool, use_slow_path); |
28 | 29 |
29 // Generic summary for call instructions that have all arguments pushed | 30 // Generic summary for call instructions that have all arguments pushed |
30 // on the stack and return the result in a fixed register EAX. | 31 // on the stack and return the result in a fixed register EAX. |
31 LocationSummary* Instruction::MakeCallSummary() { | 32 LocationSummary* Instruction::MakeCallSummary() { |
32 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); | 33 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); |
(...skipping 5920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5953 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5954 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5954 if (!compiler->CanFallThroughTo(normal_entry())) { | 5955 if (!compiler->CanFallThroughTo(normal_entry())) { |
5955 __ jmp(compiler->GetJumpLabel(normal_entry())); | 5956 __ jmp(compiler->GetJumpLabel(normal_entry())); |
5956 } | 5957 } |
5957 } | 5958 } |
5958 | 5959 |
5959 | 5960 |
5960 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5961 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5961 __ Bind(compiler->GetJumpLabel(this)); | 5962 __ Bind(compiler->GetJumpLabel(this)); |
5962 if (!compiler->is_optimizing()) { | 5963 if (!compiler->is_optimizing()) { |
5963 compiler->EmitEdgeCounter(); | 5964 if (FLAG_emit_edge_counters) { |
| 5965 compiler->EmitEdgeCounter(); |
| 5966 } |
5964 // The deoptimization descriptor points after the edge counter code for | 5967 // The deoptimization descriptor points after the edge counter code for |
5965 // uniformity with ARM and MIPS, where we can reuse pattern matching | 5968 // uniformity with ARM and MIPS, where we can reuse pattern matching |
5966 // code that matches backwards from the end of the pattern. | 5969 // code that matches backwards from the end of the pattern. |
5967 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 5970 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
5968 deopt_id_, | 5971 deopt_id_, |
5969 Scanner::kNoSourcePos); | 5972 Scanner::kNoSourcePos); |
5970 } | 5973 } |
5971 if (HasParallelMove()) { | 5974 if (HasParallelMove()) { |
5972 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 5975 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
5973 } | 5976 } |
5974 } | 5977 } |
5975 | 5978 |
5976 | 5979 |
5977 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { | 5980 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { |
5978 return new LocationSummary(0, 0, LocationSummary::kNoCall); | 5981 return new LocationSummary(0, 0, LocationSummary::kNoCall); |
5979 } | 5982 } |
5980 | 5983 |
5981 | 5984 |
5982 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5985 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5983 if (!compiler->is_optimizing()) { | 5986 if (!compiler->is_optimizing()) { |
5984 compiler->EmitEdgeCounter(); | 5987 if (FLAG_emit_edge_counters) { |
| 5988 compiler->EmitEdgeCounter(); |
| 5989 } |
5985 // Add a deoptimization descriptor for deoptimizing instructions that | 5990 // Add a deoptimization descriptor for deoptimizing instructions that |
5986 // may be inserted before this instruction. This descriptor points | 5991 // may be inserted before this instruction. This descriptor points |
5987 // after the edge counter for uniformity with ARM and MIPS, where we can | 5992 // after the edge counter for uniformity with ARM and MIPS, where we can |
5988 // reuse pattern matching that matches backwards from the end of the | 5993 // reuse pattern matching that matches backwards from the end of the |
5989 // pattern. | 5994 // pattern. |
5990 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 5995 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
5991 GetDeoptId(), | 5996 GetDeoptId(), |
5992 Scanner::kNoSourcePos); | 5997 Scanner::kNoSourcePos); |
5993 } | 5998 } |
5994 if (HasParallelMove()) { | 5999 if (HasParallelMove()) { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6241 PcDescriptors::kOther, | 6246 PcDescriptors::kOther, |
6242 locs()); | 6247 locs()); |
6243 __ Drop(ArgumentCount()); // Discard arguments. | 6248 __ Drop(ArgumentCount()); // Discard arguments. |
6244 } | 6249 } |
6245 | 6250 |
6246 } // namespace dart | 6251 } // namespace dart |
6247 | 6252 |
6248 #undef __ | 6253 #undef __ |
6249 | 6254 |
6250 #endif // defined TARGET_ARCH_IA32 | 6255 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |