| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| 11 #include "vm/dart_entry.h" | 11 #include "vm/dart_entry.h" |
| 12 #include "vm/flow_graph.h" | 12 #include "vm/flow_graph.h" |
| 13 #include "vm/flow_graph_compiler.h" | 13 #include "vm/flow_graph_compiler.h" |
| 14 #include "vm/flow_graph_range_analysis.h" | 14 #include "vm/flow_graph_range_analysis.h" |
| 15 #include "vm/locations.h" | 15 #include "vm/locations.h" |
| 16 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 17 #include "vm/parser.h" | 17 #include "vm/parser.h" |
| 18 #include "vm/simulator.h" | 18 #include "vm/simulator.h" |
| 19 #include "vm/stack_frame.h" | 19 #include "vm/stack_frame.h" |
| 20 #include "vm/stub_code.h" | 20 #include "vm/stub_code.h" |
| 21 #include "vm/symbols.h" | 21 #include "vm/symbols.h" |
| 22 | 22 |
| 23 #define __ compiler->assembler()-> | 23 #define __ compiler->assembler()-> |
| 24 | 24 |
| 25 namespace dart { | 25 namespace dart { |
| 26 | 26 |
| 27 DECLARE_FLAG(bool, emit_edge_counters); | 27 DECLARE_FLAG(bool, emit_edge_counters); |
| 28 DECLARE_FLAG(bool, enable_asserts); | |
| 29 DECLARE_FLAG(int, optimization_counter_threshold); | 28 DECLARE_FLAG(int, optimization_counter_threshold); |
| 30 DECLARE_FLAG(bool, use_osr); | 29 DECLARE_FLAG(bool, use_osr); |
| 31 | 30 |
| 32 // Generic summary for call instructions that have all arguments pushed | 31 // Generic summary for call instructions that have all arguments pushed |
| 33 // on the stack and return the result in a fixed register R0. | 32 // on the stack and return the result in a fixed register R0. |
| 34 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { | 33 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
| 35 LocationSummary* result = new(zone) LocationSummary( | 34 LocationSummary* result = new(zone) LocationSummary( |
| 36 zone, 0, 0, LocationSummary::kCall); | 35 zone, 0, 0, LocationSummary::kCall); |
| 37 result->set_out(0, Location::RegisterLocation(R0)); | 36 result->set_out(0, Location::RegisterLocation(R0)); |
| 38 return result; | 37 return result; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 static void EmitAssertBoolean(Register reg, | 366 static void EmitAssertBoolean(Register reg, |
| 368 intptr_t token_pos, | 367 intptr_t token_pos, |
| 369 intptr_t deopt_id, | 368 intptr_t deopt_id, |
| 370 LocationSummary* locs, | 369 LocationSummary* locs, |
| 371 FlowGraphCompiler* compiler) { | 370 FlowGraphCompiler* compiler) { |
| 372 // Check that the type of the value is allowed in conditional context. | 371 // Check that the type of the value is allowed in conditional context. |
| 373 // Call the runtime if the object is not bool::true or bool::false. | 372 // Call the runtime if the object is not bool::true or bool::false. |
| 374 ASSERT(locs->always_calls()); | 373 ASSERT(locs->always_calls()); |
| 375 Label done; | 374 Label done; |
| 376 | 375 |
| 377 if (Isolate::Current()->TypeChecksEnabled()) { | 376 if (Isolate::Current()->flags().type_checks()) { |
| 378 __ CompareObject(reg, Bool::True()); | 377 __ CompareObject(reg, Bool::True()); |
| 379 __ b(&done, EQ); | 378 __ b(&done, EQ); |
| 380 __ CompareObject(reg, Bool::False()); | 379 __ CompareObject(reg, Bool::False()); |
| 381 __ b(&done, EQ); | 380 __ b(&done, EQ); |
| 382 } else { | 381 } else { |
| 383 ASSERT(FLAG_enable_asserts); | 382 ASSERT(Isolate::Current()->flags().asserts()); |
| 384 __ CompareObject(reg, Object::null_instance()); | 383 __ CompareObject(reg, Object::null_instance()); |
| 385 __ b(&done, NE); | 384 __ b(&done, NE); |
| 386 } | 385 } |
| 387 | 386 |
| 388 __ Push(reg); // Push the source object. | 387 __ Push(reg); // Push the source object. |
| 389 compiler->GenerateRuntimeCall(token_pos, | 388 compiler->GenerateRuntimeCall(token_pos, |
| 390 deopt_id, | 389 deopt_id, |
| 391 kNonBoolTypeErrorRuntimeEntry, | 390 kNonBoolTypeErrorRuntimeEntry, |
| 392 1, | 391 1, |
| 393 locs); | 392 locs); |
| (...skipping 6486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6880 1, | 6879 1, |
| 6881 locs()); | 6880 locs()); |
| 6882 __ Drop(1); | 6881 __ Drop(1); |
| 6883 __ Pop(result); | 6882 __ Pop(result); |
| 6884 } | 6883 } |
| 6885 | 6884 |
| 6886 | 6885 |
| 6887 } // namespace dart | 6886 } // namespace dart |
| 6888 | 6887 |
| 6889 #endif // defined TARGET_ARCH_ARM | 6888 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |