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

Side by Side Diff: runtime/vm/flow_graph_builder.h

Issue 138523004: Inline recognized List factory in the flow graph optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | « no previous file | runtime/vm/flow_graph_builder.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 (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 #ifndef VM_FLOW_GRAPH_BUILDER_H_ 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_
6 #define VM_FLOW_GRAPH_BUILDER_H_ 6 #define VM_FLOW_GRAPH_BUILDER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 480982704) \ 42 V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 480982704) \
43 V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 1876611964) \ 43 V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 1876611964) \
44 V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 1811693442) \ 44 V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 1811693442) \
45 V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 958749261) \ 45 V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 958749261) \
46 V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 767338823) \ 46 V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 767338823) \
47 V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 1599078532) \ 47 V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 1599078532) \
48 V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 1721244151) \ 48 V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 1721244151) \
49 V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 879975401) \ 49 V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 879975401) \
50 50
51 51
52 // Class that recognizes factories and returns corresponding result cid.
53 class FactoryRecognizer : public AllStatic {
54 public:
55 // Return kDynamicCid if factory is not recognized.
56 static intptr_t ResultCid(const Function& factory) {
57 ASSERT(factory.IsFactory());
58 const Class& function_class = Class::Handle(factory.Owner());
59 const Library& lib = Library::Handle(function_class.library());
60 ASSERT((lib.raw() == Library::CoreLibrary()) ||
61 (lib.raw() == Library::TypedDataLibrary()));
62 const String& factory_name = String::Handle(factory.name());
63 #define RECOGNIZE_FACTORY(test_factory_symbol, cid, fp) \
64 if (String::EqualsIgnoringPrivateKey( \
65 factory_name, Symbols::test_factory_symbol())) { \
66 ASSERT(factory.CheckSourceFingerprint(fp)); \
67 return cid; \
68 } \
69
70 RECOGNIZED_LIST_FACTORY_LIST(RECOGNIZE_FACTORY);
71 #undef RECOGNIZE_FACTORY
72
73 return kDynamicCid;
74 }
75 };
76
77
52 // A class to collect the exits from an inlined function during graph 78 // A class to collect the exits from an inlined function during graph
53 // construction so they can be plugged into the caller's flow graph. 79 // construction so they can be plugged into the caller's flow graph.
54 class InlineExitCollector: public ZoneAllocated { 80 class InlineExitCollector: public ZoneAllocated {
55 public: 81 public:
56 InlineExitCollector(FlowGraph* caller_graph, Definition* call) 82 InlineExitCollector(FlowGraph* caller_graph, Definition* call)
57 : caller_graph_(caller_graph), call_(call), exits_(4) { } 83 : caller_graph_(caller_graph), call_(call), exits_(4) { }
58 84
59 void AddExit(ReturnInstr* exit); 85 void AddExit(ReturnInstr* exit);
60 86
61 void Union(const InlineExitCollector* other); 87 void Union(const InlineExitCollector* other);
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // Output parameters. 568 // Output parameters.
543 GrowableArray<TargetEntryInstr**> true_successor_addresses_; 569 GrowableArray<TargetEntryInstr**> true_successor_addresses_;
544 GrowableArray<TargetEntryInstr**> false_successor_addresses_; 570 GrowableArray<TargetEntryInstr**> false_successor_addresses_;
545 571
546 intptr_t condition_token_pos_; 572 intptr_t condition_token_pos_;
547 }; 573 };
548 574
549 } // namespace dart 575 } // namespace dart
550 576
551 #endif // VM_FLOW_GRAPH_BUILDER_H_ 577 #endif // VM_FLOW_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698