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: src/compiler/js-typed-lowering.h

Issue 2934893002: [builtins] Properly optimize Object.prototype.isPrototypeOf. (Closed)
Patch Set: Created 3 years, 6 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
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_TYPED_LOWERING_H_ 5 #ifndef V8_COMPILER_JS_TYPED_LOWERING_H_
6 #define V8_COMPILER_JS_TYPED_LOWERING_H_ 6 #define V8_COMPILER_JS_TYPED_LOWERING_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"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 Reduction Reduce(Node* node) final; 45 Reduction Reduce(Node* node) final;
46 46
47 private: 47 private:
48 friend class JSBinopReduction; 48 friend class JSBinopReduction;
49 49
50 Reduction ReduceJSAdd(Node* node); 50 Reduction ReduceJSAdd(Node* node);
51 Reduction ReduceJSComparison(Node* node); 51 Reduction ReduceJSComparison(Node* node);
52 Reduction ReduceJSLoadNamed(Node* node); 52 Reduction ReduceJSLoadNamed(Node* node);
53 Reduction ReduceJSLoadProperty(Node* node); 53 Reduction ReduceJSLoadProperty(Node* node);
54 Reduction ReduceJSStoreProperty(Node* node); 54 Reduction ReduceJSStoreProperty(Node* node);
55 Reduction ReduceJSHasInPrototypeChain(Node* node);
55 Reduction ReduceJSOrdinaryHasInstance(Node* node); 56 Reduction ReduceJSOrdinaryHasInstance(Node* node);
56 Reduction ReduceJSLoadContext(Node* node); 57 Reduction ReduceJSLoadContext(Node* node);
57 Reduction ReduceJSStoreContext(Node* node); 58 Reduction ReduceJSStoreContext(Node* node);
58 Reduction ReduceJSLoadModule(Node* node); 59 Reduction ReduceJSLoadModule(Node* node);
59 Reduction ReduceJSStoreModule(Node* node); 60 Reduction ReduceJSStoreModule(Node* node);
60 Reduction ReduceJSEqual(Node* node); 61 Reduction ReduceJSEqual(Node* node);
61 Reduction ReduceJSStrictEqual(Node* node); 62 Reduction ReduceJSStrictEqual(Node* node);
62 Reduction ReduceJSToBoolean(Node* node); 63 Reduction ReduceJSToBoolean(Node* node);
63 Reduction ReduceJSToInteger(Node* node); 64 Reduction ReduceJSToInteger(Node* node);
64 Reduction ReduceJSToLength(Node* node); 65 Reduction ReduceJSToLength(Node* node);
(...skipping 21 matching lines...) Expand all
86 Reduction ReduceUI32Shift(Node* node, Signedness signedness); 87 Reduction ReduceUI32Shift(Node* node, Signedness signedness);
87 Reduction ReduceCreateConsString(Node* node); 88 Reduction ReduceCreateConsString(Node* node);
88 Reduction ReduceSpeculativeNumberAdd(Node* node); 89 Reduction ReduceSpeculativeNumberAdd(Node* node);
89 Reduction ReduceSpeculativeNumberMultiply(Node* node); 90 Reduction ReduceSpeculativeNumberMultiply(Node* node);
90 Reduction ReduceSpeculativeNumberBinop(Node* node); 91 Reduction ReduceSpeculativeNumberBinop(Node* node);
91 Reduction ReduceSpeculativeNumberComparison(Node* node); 92 Reduction ReduceSpeculativeNumberComparison(Node* node);
92 93
93 // Helper for ReduceJSLoadModule and ReduceJSStoreModule. 94 // Helper for ReduceJSLoadModule and ReduceJSStoreModule.
94 Node* BuildGetModuleCell(Node* node); 95 Node* BuildGetModuleCell(Node* node);
95 96
97 // Checks if we know at compile time that the {receiver} either definitely
98 // has the {prototype} in it's prototype chain, or the {receiver} definitely
99 // doesn't have the {prototype} in it's prototype chain.
100 enum InferHasInPrototypeChainResult {
101 kIsInPrototypeChain,
102 kIsNotInPrototypeChain,
103 kMayBeInPrototypeChain
104 };
105 InferHasInPrototypeChainResult InferHasInPrototypeChain(
106 Node* receiver, Node* effect, Handle<HeapObject> prototype);
107
96 Factory* factory() const; 108 Factory* factory() const;
97 Graph* graph() const; 109 Graph* graph() const;
98 JSGraph* jsgraph() const { return jsgraph_; } 110 JSGraph* jsgraph() const { return jsgraph_; }
99 Isolate* isolate() const; 111 Isolate* isolate() const;
100 JSOperatorBuilder* javascript() const; 112 JSOperatorBuilder* javascript() const;
101 CommonOperatorBuilder* common() const; 113 CommonOperatorBuilder* common() const;
102 SimplifiedOperatorBuilder* simplified() const; 114 SimplifiedOperatorBuilder* simplified() const;
103 CompilationDependencies* dependencies() const; 115 CompilationDependencies* dependencies() const;
104 Flags flags() const { return flags_; } 116 Flags flags() const { return flags_; }
105 117
106 CompilationDependencies* dependencies_; 118 CompilationDependencies* dependencies_;
107 Flags flags_; 119 Flags flags_;
108 JSGraph* jsgraph_; 120 JSGraph* jsgraph_;
109 Type* shifted_int32_ranges_[4]; 121 Type* shifted_int32_ranges_[4];
110 Type* pointer_comparable_type_; 122 Type* pointer_comparable_type_;
111 TypeCache const& type_cache_; 123 TypeCache const& type_cache_;
112 }; 124 };
113 125
114 DEFINE_OPERATORS_FOR_FLAGS(JSTypedLowering::Flags) 126 DEFINE_OPERATORS_FOR_FLAGS(JSTypedLowering::Flags)
115 127
116 } // namespace compiler 128 } // namespace compiler
117 } // namespace internal 129 } // namespace internal
118 } // namespace v8 130 } // namespace v8
119 131
120 #endif // V8_COMPILER_JS_TYPED_LOWERING_H_ 132 #endif // V8_COMPILER_JS_TYPED_LOWERING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698