| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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.h" | 11 #include "vm/flow_graph.h" |
| 12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/flow_graph_range_analysis.h" | 13 #include "vm/flow_graph_range_analysis.h" |
| 14 #include "vm/locations.h" | 14 #include "vm/locations.h" |
| 15 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
| 16 #include "vm/parser.h" | 16 #include "vm/parser.h" |
| 17 #include "vm/simulator.h" | 17 #include "vm/simulator.h" |
| 18 #include "vm/stack_frame.h" | 18 #include "vm/stack_frame.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 #define __ compiler->assembler()-> | 22 #define __ compiler->assembler()-> |
| 23 | 23 |
| 24 namespace dart { | 24 namespace dart { |
| 25 | 25 |
| 26 DECLARE_FLAG(bool, emit_edge_counters); | 26 DECLARE_FLAG(bool, emit_edge_counters); |
| 27 DECLARE_FLAG(bool, enable_asserts); | |
| 28 DECLARE_FLAG(int, optimization_counter_threshold); | 27 DECLARE_FLAG(int, optimization_counter_threshold); |
| 29 DECLARE_FLAG(bool, use_osr); | 28 DECLARE_FLAG(bool, use_osr); |
| 30 | 29 |
| 31 // Generic summary for call instructions that have all arguments pushed | 30 // Generic summary for call instructions that have all arguments pushed |
| 32 // on the stack and return the result in a fixed register R0. | 31 // on the stack and return the result in a fixed register R0. |
| 33 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { | 32 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
| 34 LocationSummary* result = new(zone) LocationSummary( | 33 LocationSummary* result = new(zone) LocationSummary( |
| 35 zone, 0, 0, LocationSummary::kCall); | 34 zone, 0, 0, LocationSummary::kCall); |
| 36 result->set_out(0, Location::RegisterLocation(R0)); | 35 result->set_out(0, Location::RegisterLocation(R0)); |
| 37 return result; | 36 return result; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 static void EmitAssertBoolean(Register reg, | 354 static void EmitAssertBoolean(Register reg, |
| 356 intptr_t token_pos, | 355 intptr_t token_pos, |
| 357 intptr_t deopt_id, | 356 intptr_t deopt_id, |
| 358 LocationSummary* locs, | 357 LocationSummary* locs, |
| 359 FlowGraphCompiler* compiler) { | 358 FlowGraphCompiler* compiler) { |
| 360 // Check that the type of the value is allowed in conditional context. | 359 // Check that the type of the value is allowed in conditional context. |
| 361 // Call the runtime if the object is not bool::true or bool::false. | 360 // Call the runtime if the object is not bool::true or bool::false. |
| 362 ASSERT(locs->always_calls()); | 361 ASSERT(locs->always_calls()); |
| 363 Label done; | 362 Label done; |
| 364 | 363 |
| 365 if (Isolate::Current()->TypeChecksEnabled()) { | 364 if (Isolate::Current()->flags().type_checks()) { |
| 366 __ CompareObject(reg, Bool::True(), PP); | 365 __ CompareObject(reg, Bool::True(), PP); |
| 367 __ b(&done, EQ); | 366 __ b(&done, EQ); |
| 368 __ CompareObject(reg, Bool::False(), PP); | 367 __ CompareObject(reg, Bool::False(), PP); |
| 369 __ b(&done, EQ); | 368 __ b(&done, EQ); |
| 370 } else { | 369 } else { |
| 371 ASSERT(FLAG_enable_asserts); | 370 ASSERT(Isolate::Current()->flags().asserts()); |
| 372 __ CompareObject(reg, Object::null_instance(), PP); | 371 __ CompareObject(reg, Object::null_instance(), PP); |
| 373 __ b(&done, NE); | 372 __ b(&done, NE); |
| 374 } | 373 } |
| 375 | 374 |
| 376 __ Push(reg); // Push the source object. | 375 __ Push(reg); // Push the source object. |
| 377 compiler->GenerateRuntimeCall(token_pos, | 376 compiler->GenerateRuntimeCall(token_pos, |
| 378 deopt_id, | 377 deopt_id, |
| 379 kNonBoolTypeErrorRuntimeEntry, | 378 kNonBoolTypeErrorRuntimeEntry, |
| 380 1, | 379 1, |
| 381 locs); | 380 locs); |
| (...skipping 5272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5654 1, | 5653 1, |
| 5655 locs()); | 5654 locs()); |
| 5656 __ Drop(1); | 5655 __ Drop(1); |
| 5657 __ Pop(result); | 5656 __ Pop(result); |
| 5658 } | 5657 } |
| 5659 | 5658 |
| 5660 | 5659 |
| 5661 } // namespace dart | 5660 } // namespace dart |
| 5662 | 5661 |
| 5663 #endif // defined TARGET_ARCH_ARM64 | 5662 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |