| 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_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| 11 #include "vm/deopt_instructions.h" | 11 #include "vm/deopt_instructions.h" |
| 12 #include "vm/flow_graph_allocator.h" | 12 #include "vm/flow_graph_allocator.h" |
| 13 #include "vm/il_printer.h" | 13 #include "vm/il_printer.h" |
| 14 #include "vm/intrinsifier.h" | 14 #include "vm/intrinsifier.h" |
| 15 #include "vm/locations.h" | 15 #include "vm/locations.h" |
| 16 #include "vm/longjump.h" | 16 #include "vm/longjump.h" |
| 17 #include "vm/object_store.h" | 17 #include "vm/object_store.h" |
| 18 #include "vm/parser.h" | 18 #include "vm/parser.h" |
| 19 #include "vm/stub_code.h" | 19 #include "vm/stub_code.h" |
| 20 #include "vm/symbols.h" | 20 #include "vm/symbols.h" |
| 21 | 21 |
| 22 namespace dart { | 22 namespace dart { |
| 23 | 23 |
| 24 DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables."); | 24 DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables."); |
| 25 DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function."); | 25 DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function."); |
| 26 DECLARE_FLAG(bool, code_comments); | 26 DECLARE_FLAG(bool, code_comments); |
| 27 DECLARE_FLAG(bool, enable_type_checks); | 27 DECLARE_FLAG(bool, enable_type_checks); |
| 28 DECLARE_FLAG(bool, intrinsify); | 28 DECLARE_FLAG(bool, intrinsify); |
| 29 DECLARE_FLAG(bool, propagate_ic_data); |
| 29 DECLARE_FLAG(bool, report_usage_count); | 30 DECLARE_FLAG(bool, report_usage_count); |
| 30 DECLARE_FLAG(bool, trace_functions); | 31 DECLARE_FLAG(bool, trace_functions); |
| 31 DECLARE_FLAG(int, optimization_counter_threshold); | 32 DECLARE_FLAG(int, optimization_counter_threshold); |
| 32 | 33 |
| 33 | |
| 34 void CompilerDeoptInfo::BuildReturnAddress(DeoptInfoBuilder* builder, | 34 void CompilerDeoptInfo::BuildReturnAddress(DeoptInfoBuilder* builder, |
| 35 const Function& function, | 35 const Function& function, |
| 36 intptr_t slot_ix) { | 36 intptr_t slot_ix) { |
| 37 builder->AddReturnAddressAfter(function, deopt_id(), slot_ix); | 37 builder->AddReturnAddressAfter(function, deopt_id(), slot_ix); |
| 38 } | 38 } |
| 39 | 39 |
| 40 | 40 |
| 41 void CompilerDeoptInfoWithStub::BuildReturnAddress(DeoptInfoBuilder* builder, | 41 void CompilerDeoptInfoWithStub::BuildReturnAddress(DeoptInfoBuilder* builder, |
| 42 const Function& function, | 42 const Function& function, |
| 43 intptr_t slot_ix) { | 43 intptr_t slot_ix) { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 469 |
| 470 | 470 |
| 471 void FlowGraphCompiler::GenerateInstanceCall( | 471 void FlowGraphCompiler::GenerateInstanceCall( |
| 472 intptr_t deopt_id, | 472 intptr_t deopt_id, |
| 473 intptr_t token_pos, | 473 intptr_t token_pos, |
| 474 intptr_t argument_count, | 474 intptr_t argument_count, |
| 475 const Array& argument_names, | 475 const Array& argument_names, |
| 476 LocationSummary* locs, | 476 LocationSummary* locs, |
| 477 const ICData& ic_data) { | 477 const ICData& ic_data) { |
| 478 ASSERT(!ic_data.IsNull()); | 478 ASSERT(!ic_data.IsNull()); |
| 479 ASSERT(FLAG_propagate_ic_data || (ic_data.NumberOfChecks() == 0)); |
| 479 // Because optimized code should not waste time. | 480 // Because optimized code should not waste time. |
| 480 ASSERT(!is_optimizing() || ic_data.num_args_tested() == 1); | 481 ASSERT(!is_optimizing() || ic_data.num_args_tested() == 1); |
| 481 const Array& arguments_descriptor = | 482 const Array& arguments_descriptor = |
| 482 DartEntry::ArgumentsDescriptor(argument_count, argument_names); | 483 DartEntry::ArgumentsDescriptor(argument_count, argument_names); |
| 483 uword label_address = 0; | 484 uword label_address = 0; |
| 484 switch (ic_data.num_args_tested()) { | 485 switch (ic_data.num_args_tested()) { |
| 485 case 1: | 486 case 1: |
| 486 label_address = StubCode::OneArgCheckInlineCacheEntryPoint(); | 487 label_address = StubCode::OneArgCheckInlineCacheEntryPoint(); |
| 487 break; | 488 break; |
| 488 case 2: | 489 case 2: |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 ASSERT(Utils::IsInt(31, disp)); | 917 ASSERT(Utils::IsInt(31, disp)); |
| 917 return FieldAddress(array, disp); | 918 return FieldAddress(array, disp); |
| 918 } | 919 } |
| 919 default: | 920 default: |
| 920 UNIMPLEMENTED(); | 921 UNIMPLEMENTED(); |
| 921 return FieldAddress(SPREG, 0); | 922 return FieldAddress(SPREG, 0); |
| 922 } | 923 } |
| 923 } | 924 } |
| 924 | 925 |
| 925 } // namespace dart | 926 } // namespace dart |
| OLD | NEW |