| 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(bool, enable_type_checks); | |
| 29 DECLARE_FLAG(int, optimization_counter_threshold); | 27 DECLARE_FLAG(int, optimization_counter_threshold); |
| 30 DECLARE_FLAG(bool, use_osr); | 28 DECLARE_FLAG(bool, use_osr); |
| 31 | 29 |
| 32 // Generic summary for call instructions that have all arguments pushed | 30 // Generic summary for call instructions that have all arguments pushed |
| 33 // 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. |
| 34 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { | 32 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { |
| 35 LocationSummary* result = new(isolate) LocationSummary( | 33 LocationSummary* result = new(isolate) LocationSummary( |
| 36 isolate, 0, 0, LocationSummary::kCall); | 34 isolate, 0, 0, LocationSummary::kCall); |
| 37 result->set_out(0, Location::RegisterLocation(R0)); | 35 result->set_out(0, Location::RegisterLocation(R0)); |
| 38 return result; | 36 return result; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 356 |
| 359 static void EmitAssertBoolean(Register reg, | 357 static void EmitAssertBoolean(Register reg, |
| 360 intptr_t token_pos, | 358 intptr_t token_pos, |
| 361 intptr_t deopt_id, | 359 intptr_t deopt_id, |
| 362 LocationSummary* locs, | 360 LocationSummary* locs, |
| 363 FlowGraphCompiler* compiler) { | 361 FlowGraphCompiler* compiler) { |
| 364 // Check that the type of the value is allowed in conditional context. | 362 // Check that the type of the value is allowed in conditional context. |
| 365 // Call the runtime if the object is not bool::true or bool::false. | 363 // Call the runtime if the object is not bool::true or bool::false. |
| 366 ASSERT(locs->always_calls()); | 364 ASSERT(locs->always_calls()); |
| 367 Label done; | 365 Label done; |
| 368 | 366 __ CompareObject(reg, Bool::True(), PP); |
| 369 if (FLAG_enable_type_checks) { | 367 __ b(&done, EQ); |
| 370 __ CompareObject(reg, Bool::True(), PP); | 368 __ CompareObject(reg, Bool::False(), PP); |
| 371 __ b(&done, EQ); | 369 __ b(&done, EQ); |
| 372 __ CompareObject(reg, Bool::False(), PP); | |
| 373 __ b(&done, EQ); | |
| 374 } else { | |
| 375 ASSERT(FLAG_enable_asserts); | |
| 376 __ CompareObject(reg, Object::null_instance(), PP); | |
| 377 __ b(&done, NE); | |
| 378 } | |
| 379 | 370 |
| 380 __ Push(reg); // Push the source object. | 371 __ Push(reg); // Push the source object. |
| 381 compiler->GenerateRuntimeCall(token_pos, | 372 compiler->GenerateRuntimeCall(token_pos, |
| 382 deopt_id, | 373 deopt_id, |
| 383 kNonBoolTypeErrorRuntimeEntry, | 374 kNonBoolTypeErrorRuntimeEntry, |
| 384 1, | 375 1, |
| 385 locs); | 376 locs); |
| 386 // We should never return here. | 377 // We should never return here. |
| 387 __ brk(0); | 378 __ brk(0); |
| 388 __ Bind(&done); | 379 __ Bind(&done); |
| (...skipping 5211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5600 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 5591 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 5601 #if defined(DEBUG) | 5592 #if defined(DEBUG) |
| 5602 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 5593 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
| 5603 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 5594 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
| 5604 #endif | 5595 #endif |
| 5605 } | 5596 } |
| 5606 | 5597 |
| 5607 } // namespace dart | 5598 } // namespace dart |
| 5608 | 5599 |
| 5609 #endif // defined TARGET_ARCH_ARM64 | 5600 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |