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

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

Issue 10700123: Remove the instruction pointer from computations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/intermediate_language.h ('k') | no next file » | 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #define KIND_TO_STRING(class_name, function_name, enum_name) \ 47 #define KIND_TO_STRING(class_name, function_name, enum_name) \
48 if (kind == k##enum_name) return #enum_name; 48 if (kind == k##enum_name) return #enum_name;
49 RECOGNIZED_LIST(KIND_TO_STRING) 49 RECOGNIZED_LIST(KIND_TO_STRING)
50 #undef KIND_TO_STRING 50 #undef KIND_TO_STRING
51 return "?"; 51 return "?";
52 } 52 }
53 53
54 54
55 // ==== Support for visiting flow graphs. 55 // ==== Support for visiting flow graphs.
56 #define DEFINE_ACCEPT(ShortName, ClassName) \ 56 #define DEFINE_ACCEPT(ShortName, ClassName) \
57 void ClassName::Accept(FlowGraphVisitor* visitor) { \ 57 void ClassName::Accept(FlowGraphVisitor* visitor, BindInstr* instr) { \
58 visitor->Visit##ShortName(this); \ 58 visitor->Visit##ShortName(this, instr); \
59 } 59 }
60 60
61 FOR_EACH_COMPUTATION(DEFINE_ACCEPT) 61 FOR_EACH_COMPUTATION(DEFINE_ACCEPT)
62 62
63 #undef DEFINE_ACCEPT 63 #undef DEFINE_ACCEPT
64 64
65 65
66 #define DEFINE_ACCEPT(ShortName) \ 66 #define DEFINE_ACCEPT(ShortName) \
67 Instruction* ShortName##Instr::Accept(FlowGraphVisitor* visitor) { \ 67 Instruction* ShortName##Instr::Accept(FlowGraphVisitor* visitor) { \
68 visitor->Visit##ShortName(this); \ 68 visitor->Visit##ShortName(this); \
(...skipping 17 matching lines...) Expand all
86 void FlowGraphVisitor::VisitBlocks() { 86 void FlowGraphVisitor::VisitBlocks() {
87 for (intptr_t i = 0; i < block_order_.length(); ++i) { 87 for (intptr_t i = 0; i < block_order_.length(); ++i) {
88 Instruction* current = block_order_[i]->Accept(this); 88 Instruction* current = block_order_[i]->Accept(this);
89 while ((current != NULL) && !current->IsBlockEntry()) { 89 while ((current != NULL) && !current->IsBlockEntry()) {
90 current = current->Accept(this); 90 current = current->Accept(this);
91 } 91 }
92 } 92 }
93 } 93 }
94 94
95 95
96 void Computation::ReplaceWith(Computation* other) {
97 ASSERT(other->instr() == NULL);
98 ASSERT(instr() != NULL);
99 other->set_instr(other->instr());
100 instr()->replace_computation(other);
101 set_instr(NULL);
102 }
103
104
105 intptr_t InstanceCallComp::InputCount() const { 96 intptr_t InstanceCallComp::InputCount() const {
106 return ArgumentCount(); 97 return ArgumentCount();
107 } 98 }
108 99
109 100
110 intptr_t StaticCallComp::InputCount() const { 101 intptr_t StaticCallComp::InputCount() const {
111 return ArgumentCount(); 102 return ArgumentCount();
112 } 103 }
113 104
114 105
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); 1323 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
1333 compiler->GenerateCall(token_pos(), try_index(), &label, 1324 compiler->GenerateCall(token_pos(), try_index(), &label,
1334 PcDescriptors::kOther); 1325 PcDescriptors::kOther);
1335 __ Drop(2); // Discard type arguments and receiver. 1326 __ Drop(2); // Discard type arguments and receiver.
1336 } 1327 }
1337 1328
1338 1329
1339 #undef __ 1330 #undef __
1340 1331
1341 } // namespace dart 1332 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698