| 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, trace_functions); | |
| 24 DECLARE_FLAG(bool, use_sse41); | 23 DECLARE_FLAG(bool, use_sse41); |
| 25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); | 24 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); |
| 26 | 25 |
| 27 | 26 |
| 28 FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid, | 27 FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid, |
| 29 Register array, | 28 Register array, |
| 30 Register index) { | 29 Register index) { |
| 31 // Note that index is Smi, i.e, times 2. | 30 // Note that index is Smi, i.e, times 2. |
| 32 ASSERT(kSmiTagShift == 1); | 31 ASSERT(kSmiTagShift == 1); |
| 33 switch (cid) { | 32 switch (cid) { |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 // RBX : ic-data. | 827 // RBX : ic-data. |
| 829 // R10 : arguments descriptor array. | 828 // R10 : arguments descriptor array. |
| 830 __ call(&StubCode::CallNoSuchMethodFunctionLabel()); | 829 __ call(&StubCode::CallNoSuchMethodFunctionLabel()); |
| 831 } | 830 } |
| 832 if (is_optimizing()) { | 831 if (is_optimizing()) { |
| 833 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), | 832 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), |
| 834 empty_stack_bitmap, | 833 empty_stack_bitmap, |
| 835 0); // No registers. | 834 0); // No registers. |
| 836 } | 835 } |
| 837 | 836 |
| 838 if (FLAG_trace_functions) { | |
| 839 __ pushq(RAX); // Preserve result. | |
| 840 __ PushObject(Function::ZoneHandle(function.raw())); | |
| 841 // We do not use GenerateCallRuntime because of the non-standard (empty) | |
| 842 // stackmap used here. | |
| 843 __ CallRuntime(kTraceFunctionExitRuntimeEntry); | |
| 844 AddCurrentDescriptor(PcDescriptors::kOther, | |
| 845 Isolate::kNoDeoptId, | |
| 846 0); // No token position. | |
| 847 if (is_optimizing()) { | |
| 848 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), | |
| 849 empty_stack_bitmap, | |
| 850 0); // No registers. | |
| 851 } | |
| 852 __ popq(RAX); // Remove argument. | |
| 853 __ popq(RAX); // Restore result. | |
| 854 } | |
| 855 __ LeaveFrame(); | 837 __ LeaveFrame(); |
| 856 __ ret(); | 838 __ ret(); |
| 857 | 839 |
| 858 __ Bind(&all_arguments_processed); | 840 __ Bind(&all_arguments_processed); |
| 859 // Nullify originally passed arguments only after they have been copied and | 841 // Nullify originally passed arguments only after they have been copied and |
| 860 // checked, otherwise noSuchMethod would not see their original values. | 842 // checked, otherwise noSuchMethod would not see their original values. |
| 861 // This step can be skipped in case we decide that formal parameters are | 843 // This step can be skipped in case we decide that formal parameters are |
| 862 // implicitly final, since garbage collecting the unmodified value is not | 844 // implicitly final, since garbage collecting the unmodified value is not |
| 863 // an issue anymore. | 845 // an issue anymore. |
| 864 | 846 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { | 1337 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { |
| 1356 __ Exchange(mem1, mem2); | 1338 __ Exchange(mem1, mem2); |
| 1357 } | 1339 } |
| 1358 | 1340 |
| 1359 | 1341 |
| 1360 #undef __ | 1342 #undef __ |
| 1361 | 1343 |
| 1362 } // namespace dart | 1344 } // namespace dart |
| 1363 | 1345 |
| 1364 #endif // defined TARGET_ARCH_X64 | 1346 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |