Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10832411: Remove support for non-ssa optimizing code generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: disable optimizations on bailout Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 13 matching lines...) Expand all
24 DECLARE_FLAG(bool, trace_functions); 24 DECLARE_FLAG(bool, trace_functions);
25 25
26 26
27 void DeoptimizationStub::GenerateCode(FlowGraphCompiler* compiler, 27 void DeoptimizationStub::GenerateCode(FlowGraphCompiler* compiler,
28 intptr_t stub_ix) { 28 intptr_t stub_ix) {
29 Assembler* assem = compiler->assembler(); 29 Assembler* assem = compiler->assembler();
30 #define __ assem-> 30 #define __ assem->
31 __ Comment("Deopt stub for id %d", deopt_id_); 31 __ Comment("Deopt stub for id %d", deopt_id_);
32 __ Bind(entry_label()); 32 __ Bind(entry_label());
33 33
34 if (deoptimization_env_ == NULL) { 34 ASSERT(deoptimization_env_ != NULL);
35 // TODO(srdjan): Deprecate once non-SSA optimizing compiler is removed.
36 for (intptr_t i = 0; i < registers_.length(); i++) {
37 if (registers_[i] != kNoRegister) {
38 __ pushq(registers_[i]);
39 }
40 }
41 }
42 35
43 if (compiler->IsLeaf()) { 36 if (compiler->IsLeaf()) {
44 __ Comment("Leaf method, lazy PC marker setup"); 37 __ Comment("Leaf method, lazy PC marker setup");
45 // TODO(srdjan): Can we use TMP instead of RAX? We must guarantee that 38 // TODO(srdjan): Can we use TMP instead of RAX? We must guarantee that
46 // TMP is never part of deoptimization environment. 39 // TMP is never part of deoptimization environment.
47 __ pushq(RAX); // Preserve RAX. 40 __ pushq(RAX); // Preserve RAX.
48 Label L; 41 Label L;
49 __ call(&L); 42 __ call(&L);
50 const intptr_t offset = assem->CodeSize(); 43 const intptr_t offset = assem->CodeSize();
51 __ Bind(&L); 44 __ Bind(&L);
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 __ Drop(6); 604 __ Drop(6);
612 __ popq(RAX); 605 __ popq(RAX);
613 606
614 __ Bind(&is_assignable); 607 __ Bind(&is_assignable);
615 __ popq(RDX); // Remove pushed instantiator type arguments. 608 __ popq(RDX); // Remove pushed instantiator type arguments.
616 __ popq(RCX); // Remove pushed instantiator. 609 __ popq(RCX); // Remove pushed instantiator.
617 } 610 }
618 611
619 612
620 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { 613 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) {
621 LocationSummary* locs = instr->locs(); 614 if (!is_optimizing()) {
622 ASSERT(locs != NULL); 615 AllocateRegistersLocally(instr);
623 616 }
624 frame_register_allocator()->AllocateRegisters(instr);
625
626 // TODO(vegorov): adjust assertion when we start removing comparison from the
627 // graph when it is merged with a branch.
628 ASSERT(locs->always_calls() ||
629 (locs->input_count() == instr->InputCount()));
630 } 617 }
631 618
632 619
633 void FlowGraphCompiler::CopyParameters() { 620 void FlowGraphCompiler::CopyParameters() {
634 __ Comment("Copy parameters"); 621 __ Comment("Copy parameters");
635 const Function& function = parsed_function().function(); 622 const Function& function = parsed_function().function();
636 const bool is_native_instance_closure = 623 const bool is_native_instance_closure =
637 function.is_native() && function.IsImplicitInstanceClosureFunction(); 624 function.is_native() && function.IsImplicitInstanceClosureFunction();
638 LocalScope* scope = parsed_function().node_sequence()->scope(); 625 LocalScope* scope = parsed_function().node_sequence()->scope();
639 const int num_fixed_params = function.num_fixed_parameters(); 626 const int num_fixed_params = function.num_fixed_parameters();
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 } 936 }
950 } else { 937 } else {
951 CopyParameters(); 938 CopyParameters();
952 } 939 }
953 940
954 // Initialize (non-argument) stack allocated slots to null. 941 // Initialize (non-argument) stack allocated slots to null.
955 // 942 //
956 // TODO(vegorov): introduce stack maps and stop initializing all spill slots 943 // TODO(vegorov): introduce stack maps and stop initializing all spill slots
957 // with null. 944 // with null.
958 intptr_t uninitialized_slot_count; 945 intptr_t uninitialized_slot_count;
959 if (is_ssa_) { 946 if (is_optimizing()) {
960 GraphEntryInstr* entry = block_order_[0]->AsGraphEntry(); 947 GraphEntryInstr* entry = block_order_[0]->AsGraphEntry();
961 uninitialized_slot_count = 948 uninitialized_slot_count =
962 entry->spill_slot_count() - copied_parameter_count; 949 entry->spill_slot_count() - copied_parameter_count;
963 } else { 950 } else {
964 uninitialized_slot_count = local_count; 951 uninitialized_slot_count = local_count;
965 } 952 }
966 const intptr_t slot_base = parsed_function().first_stack_local_index(); 953 const intptr_t slot_base = parsed_function().first_stack_local_index();
967 954
968 if (uninitialized_slot_count > 0) { 955 if (uninitialized_slot_count > 0) {
969 __ Comment("Initialize spill slots"); 956 __ Comment("Initialize spill slots");
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 __ jmp(&StubCode::FixCallersTargetLabel()); 988 __ jmp(&StubCode::FixCallersTargetLabel());
1002 } 989 }
1003 990
1004 991
1005 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, 992 void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
1006 intptr_t try_index, 993 intptr_t try_index,
1007 const ExternalLabel* label, 994 const ExternalLabel* label,
1008 PcDescriptors::Kind kind, 995 PcDescriptors::Kind kind,
1009 BitmapBuilder* stack_bitmap) { 996 BitmapBuilder* stack_bitmap) {
1010 ASSERT(!IsLeaf()); 997 ASSERT(!IsLeaf());
1011 ASSERT(frame_register_allocator()->IsSpilled());
1012 __ call(label); 998 __ call(label);
1013 if (is_ssa() && (stack_bitmap != NULL)) { 999 if (is_optimizing() && (stack_bitmap != NULL)) {
1014 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), stack_bitmap); 1000 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), stack_bitmap);
1015 } 1001 }
1016 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos, try_index); 1002 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos, try_index);
1017 } 1003 }
1018 1004
1019 1005
1020 void FlowGraphCompiler::GenerateCallRuntime(intptr_t deopt_id, 1006 void FlowGraphCompiler::GenerateCallRuntime(intptr_t deopt_id,
1021 intptr_t token_pos, 1007 intptr_t token_pos,
1022 intptr_t try_index, 1008 intptr_t try_index,
1023 const RuntimeEntry& entry, 1009 const RuntimeEntry& entry,
1024 BitmapBuilder* stack_bitmap) { 1010 BitmapBuilder* stack_bitmap) {
1025 ASSERT(!IsLeaf()); 1011 ASSERT(!IsLeaf());
1026 ASSERT(frame_register_allocator()->IsSpilled());
1027 __ CallRuntime(entry); 1012 __ CallRuntime(entry);
1028 if (is_ssa() && (stack_bitmap != NULL)) { 1013 if (is_optimizing() && (stack_bitmap != NULL)) {
1029 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), stack_bitmap); 1014 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), stack_bitmap);
1030 } 1015 }
1031 AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos, try_index); 1016 AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos, try_index);
1032 } 1017 }
1033 1018
1034 1019
1035 intptr_t FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, 1020 intptr_t FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
1036 const ICData& ic_data, 1021 const ICData& ic_data,
1037 const Array& arguments_descriptor, 1022 const Array& arguments_descriptor,
1038 intptr_t argument_count) { 1023 intptr_t argument_count) {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { 1200 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
1216 __ Exchange(mem1, mem2); 1201 __ Exchange(mem1, mem2);
1217 } 1202 }
1218 1203
1219 1204
1220 #undef __ 1205 #undef __
1221 1206
1222 } // namespace dart 1207 } // namespace dart
1223 1208
1224 #endif // defined TARGET_ARCH_X64 1209 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698