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 DECLARE_FLAG(bool, use_sse41); | |
| 26 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); | |
| 27 DEFINE_FLAG(bool, unbox_integers, true, "Optimize 64-bit integer arithmetic."); | |
|
srdjan
2012/09/28 16:50:26
Should this be 'unbox_mints' since it does not do
Florian Schneider
2012/10/02 11:10:31
Done.
| |
| 28 | |
| 29 | |
| 30 bool FlowGraphCompiler::SupportsUnboxedMints() { | |
| 31 // Support unboxed mints when SSE 4.1 is available. | |
| 32 return FLAG_unbox_integers | |
| 33 && CPUFeatures::sse4_1_supported() | |
| 34 && FLAG_use_sse41; | |
| 35 } | |
| 25 | 36 |
| 26 | 37 |
| 27 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, | 38 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, |
| 28 intptr_t stub_ix) { | 39 intptr_t stub_ix) { |
| 29 // Calls do not need stubs, they share a deoptimization trampoline. | 40 // Calls do not need stubs, they share a deoptimization trampoline. |
| 30 ASSERT(reason() != kDeoptAtCall); | 41 ASSERT(reason() != kDeoptAtCall); |
| 31 Assembler* assem = compiler->assembler(); | 42 Assembler* assem = compiler->assembler(); |
| 32 #define __ assem-> | 43 #define __ assem-> |
| 33 __ Comment("Deopt stub for id %"Pd"", deopt_id()); | 44 __ Comment("Deopt stub for id %"Pd"", deopt_id()); |
| 34 __ Bind(entry_label()); | 45 __ Bind(entry_label()); |
| 46 if (FLAG_trap_on_deoptimization) __ int3(); | |
| 35 | 47 |
| 36 ASSERT(deoptimization_env() != NULL); | 48 ASSERT(deoptimization_env() != NULL); |
| 37 | 49 |
| 38 if (compiler->IsLeaf()) { | 50 if (compiler->IsLeaf()) { |
| 39 Label L; | 51 Label L; |
| 40 __ pushl(EAX); // Preserve EAX. | 52 __ pushl(EAX); // Preserve EAX. |
| 41 __ call(&L); | 53 __ call(&L); |
| 42 const intptr_t offset = assem->CodeSize(); | 54 const intptr_t offset = assem->CodeSize(); |
| 43 __ Bind(&L); | 55 __ Bind(&L); |
| 44 __ popl(EAX); | 56 __ popl(EAX); |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1367 __ popl(ECX); | 1379 __ popl(ECX); |
| 1368 __ popl(EAX); | 1380 __ popl(EAX); |
| 1369 } | 1381 } |
| 1370 | 1382 |
| 1371 | 1383 |
| 1372 #undef __ | 1384 #undef __ |
| 1373 | 1385 |
| 1374 } // namespace dart | 1386 } // namespace dart |
| 1375 | 1387 |
| 1376 #endif // defined TARGET_ARCH_IA32 | 1388 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |