Chromium Code Reviews| 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 DECLARE_FLAG(bool, reject_named_argument_as_positional); | 23 DECLARE_FLAG(bool, reject_named_argument_as_positional); |
| 24 DECLARE_FLAG(bool, trace_functions); | 24 DECLARE_FLAG(bool, trace_functions); |
| 25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); | 25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); |
| 26 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); | 26 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); |
| 27 | 27 |
| 28 | 28 |
| 29 FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid, | |
| 30 Register array, | |
| 31 Register index) { | |
| 32 // Note that index is Smi, i.e, times 2. | |
| 33 ASSERT(kSmiTagShift == 1); | |
| 34 switch (cid) { | |
| 35 case kArrayCid: | |
| 36 case kGrowableObjectArrayCid: | |
|
Florian Schneider
2012/10/15 09:40:25
I'd rather omit GrowableObjectArray here. This cas
srdjan
2012/10/15 16:53:13
Changed the generation of LoadIndexed to use the p
| |
| 37 case kImmutableArrayCid: | |
| 38 return FieldAddress(array, index, TIMES_2, sizeof(RawArray)); | |
| 39 case kFloat64ArrayCid: | |
| 40 return FieldAddress(array, index, TIMES_4, Float64Array::data_offset()); | |
| 41 default: | |
| 42 UNIMPLEMENTED(); | |
| 43 return FieldAddress(SPREG, 0); | |
| 44 } | |
| 45 } | |
| 46 | |
| 47 | |
| 29 bool FlowGraphCompiler::SupportsUnboxedMints() { | 48 bool FlowGraphCompiler::SupportsUnboxedMints() { |
| 30 // Support unboxed mints when SSE 4.1 is available. | 49 // Support unboxed mints when SSE 4.1 is available. |
| 31 return FLAG_unbox_mints && CPUFeatures::sse4_1_supported(); | 50 return FLAG_unbox_mints && CPUFeatures::sse4_1_supported(); |
| 32 } | 51 } |
| 33 | 52 |
| 34 | 53 |
| 35 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, | 54 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, |
| 36 intptr_t stub_ix) { | 55 intptr_t stub_ix) { |
| 37 // Calls do not need stubs, they share a deoptimization trampoline. | 56 // Calls do not need stubs, they share a deoptimization trampoline. |
| 38 ASSERT(reason() != kDeoptAtCall); | 57 ASSERT(reason() != kDeoptAtCall); |
| (...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1359 __ popl(ECX); | 1378 __ popl(ECX); |
| 1360 __ popl(EAX); | 1379 __ popl(EAX); |
| 1361 } | 1380 } |
| 1362 | 1381 |
| 1363 | 1382 |
| 1364 #undef __ | 1383 #undef __ |
| 1365 | 1384 |
| 1366 } // namespace dart | 1385 } // namespace dart |
| 1367 | 1386 |
| 1368 #endif // defined TARGET_ARCH_IA32 | 1387 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |