| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); | 23 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); |
| 24 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); | 24 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); |
| 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_2, 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 // Support unboxed mints when SSE 4.1 is available. | 28 // Support unboxed mints when SSE 4.1 is available. |
| 49 return FLAG_unbox_mints && CPUFeatures::sse4_1_supported(); | 29 return FLAG_unbox_mints && CPUFeatures::sse4_1_supported(); |
| 50 } | 30 } |
| 51 | 31 |
| 52 | 32 |
| 53 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, | 33 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, |
| 54 intptr_t stub_ix) { | 34 intptr_t stub_ix) { |
| 55 // Calls do not need stubs, they share a deoptimization trampoline. | 35 // Calls do not need stubs, they share a deoptimization trampoline. |
| 56 ASSERT(reason() != kDeoptAtCall); | 36 ASSERT(reason() != kDeoptAtCall); |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 __ popl(ECX); | 1365 __ popl(ECX); |
| 1386 __ popl(EAX); | 1366 __ popl(EAX); |
| 1387 } | 1367 } |
| 1388 | 1368 |
| 1389 | 1369 |
| 1390 #undef __ | 1370 #undef __ |
| 1391 | 1371 |
| 1392 } // namespace dart | 1372 } // namespace dart |
| 1393 | 1373 |
| 1394 #endif // defined TARGET_ARCH_IA32 | 1374 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |