| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| 11 #include "vm/ast_printer.h" | 11 #include "vm/ast_printer.h" |
| 12 #include "vm/il_printer.h" | 12 #include "vm/il_printer.h" |
| 13 #include "vm/locations.h" | 13 #include "vm/locations.h" |
| 14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
| 15 #include "vm/parser.h" | 15 #include "vm/parser.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 namespace dart { | 19 namespace dart { |
| 20 | 20 |
| 21 DECLARE_FLAG(bool, print_ast); | 21 DECLARE_FLAG(bool, print_ast); |
| 22 DECLARE_FLAG(bool, print_scopes); | 22 DECLARE_FLAG(bool, print_scopes); |
| 23 DECLARE_FLAG(bool, use_sse41); | 23 DECLARE_FLAG(bool, use_sse41); |
| 24 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); | 24 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); |
| 25 | 25 |
| 26 | 26 |
| 27 FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid, | |
| 28 Register array, | |
| 29 Register index) { | |
| 30 // Note that index is Smi, i.e, times 2. | |
| 31 ASSERT(kSmiTagShift == 1); | |
| 32 switch (cid) { | |
| 33 case kArrayCid: | |
| 34 case kImmutableArrayCid: | |
| 35 return FieldAddress(array, index, TIMES_4, sizeof(RawArray)); | |
| 36 case kFloat32ArrayCid: | |
| 37 return FieldAddress(array, index, TIMES_2, Float32Array::data_offset()); | |
| 38 case kFloat64ArrayCid: | |
| 39 return FieldAddress(array, index, TIMES_4, Float64Array::data_offset()); | |
| 40 default: | |
| 41 UNIMPLEMENTED(); | |
| 42 return FieldAddress(SPREG, 0); | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 | |
| 47 bool FlowGraphCompiler::SupportsUnboxedMints() { | 27 bool FlowGraphCompiler::SupportsUnboxedMints() { |
| 48 return false; | 28 return false; |
| 49 } | 29 } |
| 50 | 30 |
| 51 | 31 |
| 52 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, | 32 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, |
| 53 intptr_t stub_ix) { | 33 intptr_t stub_ix) { |
| 54 // Calls do not need stubs, they share a deoptimization trampoline. | 34 // Calls do not need stubs, they share a deoptimization trampoline. |
| 55 ASSERT(reason() != kDeoptAtCall); | 35 ASSERT(reason() != kDeoptAtCall); |
| 56 Assembler* assem = compiler->assembler(); | 36 Assembler* assem = compiler->assembler(); |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { | 1343 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { |
| 1364 __ Exchange(mem1, mem2); | 1344 __ Exchange(mem1, mem2); |
| 1365 } | 1345 } |
| 1366 | 1346 |
| 1367 | 1347 |
| 1368 #undef __ | 1348 #undef __ |
| 1369 | 1349 |
| 1370 } // namespace dart | 1350 } // namespace dart |
| 1371 | 1351 |
| 1372 #endif // defined TARGET_ARCH_X64 | 1352 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |