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

Side by Side Diff: src/data-flow.h

Issue 1132005: Add iterative primitive type analysis.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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 | « src/compiler.cc ('k') | src/data-flow.cc » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 static BlockNode* cast(Node* node) { 299 static BlockNode* cast(Node* node) {
300 ASSERT(node->IsBlockNode()); 300 ASSERT(node->IsBlockNode());
301 return reinterpret_cast<BlockNode*>(node); 301 return reinterpret_cast<BlockNode*>(node);
302 } 302 }
303 303
304 bool IsBlockNode() { return true; } 304 bool IsBlockNode() { return true; }
305 305
306 bool is_empty() { return instructions_.is_empty(); } 306 bool is_empty() { return instructions_.is_empty(); }
307 307
308 ZoneList<AstNode*>* instructions() { return &instructions_; }
309
308 void AddPredecessor(Node* predecessor) { 310 void AddPredecessor(Node* predecessor) {
309 ASSERT(predecessor_ == NULL && predecessor != NULL); 311 ASSERT(predecessor_ == NULL && predecessor != NULL);
310 predecessor_ = predecessor; 312 predecessor_ = predecessor;
311 } 313 }
312 314
313 void AddSuccessor(Node* successor) { 315 void AddSuccessor(Node* successor) {
314 ASSERT(successor_ == NULL && successor != NULL); 316 ASSERT(successor_ == NULL && successor != NULL);
315 successor_ = successor; 317 successor_ = successor;
316 } 318 }
317 319
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 615
614 // A list of all the definitions in the body. 616 // A list of all the definitions in the body.
615 ZoneList<Expression*>* body_definitions_; 617 ZoneList<Expression*>* body_definitions_;
616 618
617 int variable_count_; 619 int variable_count_;
618 620
619 DISALLOW_COPY_AND_ASSIGN(ReachingDefinitions); 621 DISALLOW_COPY_AND_ASSIGN(ReachingDefinitions);
620 }; 622 };
621 623
622 624
625
626 class TypeAnalyzer BASE_EMBEDDED {
627 public:
628 TypeAnalyzer(ZoneList<Node*>* postorder,
629 ZoneList<Expression*>* body_definitions,
630 int variable_count,
631 int param_count)
632 : postorder_(postorder),
633 body_definitions_(body_definitions),
634 variable_count_(variable_count),
635 param_count_(param_count) {}
636
637 void Compute();
638
639 private:
640 // Get the primitity of definition number i. Definitions are numbered
641 // by the flow graph builder.
642 bool IsPrimitiveDef(int def_num);
643
644 ZoneList<Node*>* postorder_;
645 ZoneList<Expression*>* body_definitions_;
646 int variable_count_;
647 int param_count_;
648 };
649
623 } } // namespace v8::internal 650 } } // namespace v8::internal
624 651
625 652
626 #endif // V8_DATAFLOW_H_ 653 #endif // V8_DATAFLOW_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/data-flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698