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

Side by Side Diff: src/compiler/js-builtin-reducer.h

Issue 2484003002: [builtins] implement JSBuiltinReducer for ArrayIteratorNext() (Closed)
Patch Set: Remove whitespace change that snuck in Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_JS_BUILTIN_REDUCER_H_ 5 #ifndef V8_COMPILER_JS_BUILTIN_REDUCER_H_
6 #define V8_COMPILER_JS_BUILTIN_REDUCER_H_ 6 #define V8_COMPILER_JS_BUILTIN_REDUCER_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/compiler/graph-reducer.h" 10 #include "src/compiler/graph-reducer.h"
11 #include "src/globals.h" 11 #include "src/globals.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 // Forward declarations. 16 // Forward declarations.
17 class CompilationDependencies; 17 class CompilationDependencies;
18 class Factory; 18 class Factory;
19 19
20 namespace compiler { 20 namespace compiler {
21 21
22 // Forward declarations. 22 // Forward declarations.
23 class CommonOperatorBuilder; 23 class CommonOperatorBuilder;
24 struct FieldAccess; 24 struct FieldAccess;
25 class JSGraph; 25 class JSGraph;
26 class JSOperatorBuilder; 26 class JSOperatorBuilder;
27 class MachineOperatorBuilder;
Benedikt Meurer 2016/11/08 05:29:49 Remove this unused forward declaration.
27 class SimplifiedOperatorBuilder; 28 class SimplifiedOperatorBuilder;
28 class TypeCache; 29 class TypeCache;
29 30
30 class V8_EXPORT_PRIVATE JSBuiltinReducer final 31 class V8_EXPORT_PRIVATE JSBuiltinReducer final
31 : public NON_EXPORTED_BASE(AdvancedReducer) { 32 : public NON_EXPORTED_BASE(AdvancedReducer) {
32 public: 33 public:
33 // Flags that control the mode of operation. 34 // Flags that control the mode of operation.
34 enum Flag { 35 enum Flag {
35 kNoFlags = 0u, 36 kNoFlags = 0u,
36 kDeoptimizationEnabled = 1u << 0, 37 kDeoptimizationEnabled = 1u << 0,
37 }; 38 };
38 typedef base::Flags<Flag> Flags; 39 typedef base::Flags<Flag> Flags;
39 40
40 JSBuiltinReducer(Editor* editor, JSGraph* jsgraph, Flags flags, 41 JSBuiltinReducer(Editor* editor, JSGraph* jsgraph, Flags flags,
41 CompilationDependencies* dependencies, 42 CompilationDependencies* dependencies,
42 Handle<Context> native_context); 43 Handle<Context> native_context);
43 ~JSBuiltinReducer() final {} 44 ~JSBuiltinReducer() final {}
44 45
45 Reduction Reduce(Node* node) final; 46 Reduction Reduce(Node* node) final;
46 47
47 private: 48 private:
49 Reduction ReduceArrayIterator(Node* node, IterationKind kind);
50 Reduction ReduceArrayIteratorNext(Node* node);
51 Reduction ReduceFastArrayIteratorNext(Handle<Map> iterator_map, Node* node,
52 IterationKind kind);
53 Reduction ReduceTypedArrayIteratorNext(Handle<Map> iterator_map, Node* node,
54 IterationKind kind);
48 Reduction ReduceArrayPop(Node* node); 55 Reduction ReduceArrayPop(Node* node);
49 Reduction ReduceArrayPush(Node* node); 56 Reduction ReduceArrayPush(Node* node);
50 Reduction ReduceDateGetTime(Node* node); 57 Reduction ReduceDateGetTime(Node* node);
51 Reduction ReduceGlobalIsFinite(Node* node); 58 Reduction ReduceGlobalIsFinite(Node* node);
52 Reduction ReduceGlobalIsNaN(Node* node); 59 Reduction ReduceGlobalIsNaN(Node* node);
53 Reduction ReduceMathAbs(Node* node); 60 Reduction ReduceMathAbs(Node* node);
54 Reduction ReduceMathAcos(Node* node); 61 Reduction ReduceMathAcos(Node* node);
55 Reduction ReduceMathAcosh(Node* node); 62 Reduction ReduceMathAcosh(Node* node);
56 Reduction ReduceMathAsin(Node* node); 63 Reduction ReduceMathAsin(Node* node);
57 Reduction ReduceMathAsinh(Node* node); 64 Reduction ReduceMathAsinh(Node* node);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 Reduction ReduceStringFromCharCode(Node* node); 100 Reduction ReduceStringFromCharCode(Node* node);
94 Reduction ReduceStringIterator(Node* node); 101 Reduction ReduceStringIterator(Node* node);
95 Reduction ReduceStringIteratorNext(Node* node); 102 Reduction ReduceStringIteratorNext(Node* node);
96 Reduction ReduceArrayBufferViewAccessor(Node* node, 103 Reduction ReduceArrayBufferViewAccessor(Node* node,
97 InstanceType instance_type, 104 InstanceType instance_type,
98 FieldAccess const& access); 105 FieldAccess const& access);
99 106
100 Node* ToNumber(Node* value); 107 Node* ToNumber(Node* value);
101 Node* ToUint32(Node* value); 108 Node* ToUint32(Node* value);
102 109
110 bool CanTreatHoleAsUndefined(Handle<Map> receiver_map);
Benedikt Meurer 2016/11/08 05:29:49 These helpers are unnecessary, see comments in .cc
111 bool CanTreatHoleAsUndefined(std::vector<Handle<Map>> const& receiver_maps);
112
103 Flags flags() const { return flags_; } 113 Flags flags() const { return flags_; }
104 Graph* graph() const; 114 Graph* graph() const;
105 Factory* factory() const; 115 Factory* factory() const;
106 JSGraph* jsgraph() const { return jsgraph_; } 116 JSGraph* jsgraph() const { return jsgraph_; }
107 Isolate* isolate() const; 117 Isolate* isolate() const;
108 Handle<Context> native_context() const { return native_context_; } 118 Handle<Context> native_context() const { return native_context_; }
109 CommonOperatorBuilder* common() const; 119 CommonOperatorBuilder* common() const;
110 SimplifiedOperatorBuilder* simplified() const; 120 SimplifiedOperatorBuilder* simplified() const;
111 JSOperatorBuilder* javascript() const; 121 JSOperatorBuilder* javascript() const;
112 CompilationDependencies* dependencies() const { return dependencies_; } 122 CompilationDependencies* dependencies() const { return dependencies_; }
113 123
114 CompilationDependencies* const dependencies_; 124 CompilationDependencies* const dependencies_;
115 Flags const flags_; 125 Flags const flags_;
116 JSGraph* const jsgraph_; 126 JSGraph* const jsgraph_;
117 Handle<Context> const native_context_; 127 Handle<Context> const native_context_;
118 TypeCache const& type_cache_; 128 TypeCache const& type_cache_;
119 }; 129 };
120 130
121 DEFINE_OPERATORS_FOR_FLAGS(JSBuiltinReducer::Flags) 131 DEFINE_OPERATORS_FOR_FLAGS(JSBuiltinReducer::Flags)
122 132
123 } // namespace compiler 133 } // namespace compiler
124 } // namespace internal 134 } // namespace internal
125 } // namespace v8 135 } // namespace v8
126 136
127 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ 137 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698