blob: eb323c9c129aa3bd6bcd2d4907eb5732b4e9455e [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2013 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_JS_OPERATOR_H_
6#define V8_COMPILER_JS_OPERATOR_H_
7
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00008#include "src/compiler/type-hints.h"
Emily Bernierd0a1eb72015-03-24 16:35:39 -04009#include "src/runtime/runtime.h"
Ben Murdochb8a8cc12014-11-26 15:28:44 +000010
11namespace v8 {
12namespace internal {
13namespace compiler {
14
Emily Bernierd0a1eb72015-03-24 16:35:39 -040015// Forward declarations.
16class Operator;
17struct JSOperatorGlobalCache;
18
19
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000020// Defines a pair of {TypeFeedbackVector} and {TypeFeedbackVectorSlot}, which
21// is used to access the type feedback for a certain {Node}.
22class VectorSlotPair {
Emily Bernierd0a1eb72015-03-24 16:35:39 -040023 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000024 VectorSlotPair();
25 VectorSlotPair(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
26 : vector_(vector), slot_(slot) {}
Emily Bernierd0a1eb72015-03-24 16:35:39 -040027
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000028 bool IsValid() const { return !vector_.is_null() && !slot_.IsInvalid(); }
29
30 Handle<TypeFeedbackVector> vector() const { return vector_; }
31 FeedbackVectorSlot slot() const { return slot_; }
32
33 int index() const;
Emily Bernierd0a1eb72015-03-24 16:35:39 -040034
35 private:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000036 const Handle<TypeFeedbackVector> vector_;
37 const FeedbackVectorSlot slot_;
Emily Bernierd0a1eb72015-03-24 16:35:39 -040038};
39
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000040bool operator==(VectorSlotPair const&, VectorSlotPair const&);
41bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
42
43size_t hash_value(VectorSlotPair const&);
44
45
46// The ConvertReceiverMode is used as parameter by JSConvertReceiver operators.
47ConvertReceiverMode ConvertReceiverModeOf(Operator const* op);
48
49
50// The ToBooleanHints are used as parameter by JSToBoolean operators.
51ToBooleanHints ToBooleanHintsOf(Operator const* op);
52
53
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000054// Defines the arity and the feedback for a JavaScript constructor call. This is
55// used as a parameter by JSCallConstruct operators.
56class CallConstructParameters final {
57 public:
58 CallConstructParameters(size_t arity, VectorSlotPair const& feedback)
59 : arity_(arity), feedback_(feedback) {}
60
61 size_t arity() const { return arity_; }
62 VectorSlotPair const& feedback() const { return feedback_; }
63
64 private:
65 size_t const arity_;
66 VectorSlotPair const feedback_;
67};
68
69bool operator==(CallConstructParameters const&, CallConstructParameters const&);
70bool operator!=(CallConstructParameters const&, CallConstructParameters const&);
71
72size_t hash_value(CallConstructParameters const&);
73
74std::ostream& operator<<(std::ostream&, CallConstructParameters const&);
75
76CallConstructParameters const& CallConstructParametersOf(Operator const*);
77
78
79// Defines the arity and the call flags for a JavaScript function call. This is
80// used as a parameter by JSCallFunction operators.
81class CallFunctionParameters final {
82 public:
Ben Murdoch097c5b22016-05-18 11:27:45 +010083 CallFunctionParameters(size_t arity, VectorSlotPair const& feedback,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000084 TailCallMode tail_call_mode,
85 ConvertReceiverMode convert_mode)
86 : bit_field_(ArityField::encode(arity) |
87 ConvertReceiverModeField::encode(convert_mode) |
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000088 TailCallModeField::encode(tail_call_mode)),
89 feedback_(feedback) {}
90
91 size_t arity() const { return ArityField::decode(bit_field_); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000092 ConvertReceiverMode convert_mode() const {
93 return ConvertReceiverModeField::decode(bit_field_);
94 }
95 TailCallMode tail_call_mode() const {
96 return TailCallModeField::decode(bit_field_);
97 }
98 VectorSlotPair const& feedback() const { return feedback_; }
99
100 bool operator==(CallFunctionParameters const& that) const {
101 return this->bit_field_ == that.bit_field_ &&
102 this->feedback_ == that.feedback_;
103 }
104 bool operator!=(CallFunctionParameters const& that) const {
105 return !(*this == that);
106 }
107
108 private:
109 friend size_t hash_value(CallFunctionParameters const& p) {
110 return base::hash_combine(p.bit_field_, p.feedback_);
111 }
112
Ben Murdoch097c5b22016-05-18 11:27:45 +0100113 typedef BitField<size_t, 0, 29> ArityField;
114 typedef BitField<ConvertReceiverMode, 29, 2> ConvertReceiverModeField;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000115 typedef BitField<TailCallMode, 31, 1> TailCallModeField;
116
117 const uint32_t bit_field_;
118 const VectorSlotPair feedback_;
119};
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400120
121size_t hash_value(CallFunctionParameters const&);
122
123std::ostream& operator<<(std::ostream&, CallFunctionParameters const&);
124
125const CallFunctionParameters& CallFunctionParametersOf(const Operator* op);
126
127
128// Defines the arity and the ID for a runtime function call. This is used as a
129// parameter by JSCallRuntime operators.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000130class CallRuntimeParameters final {
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400131 public:
132 CallRuntimeParameters(Runtime::FunctionId id, size_t arity)
133 : id_(id), arity_(arity) {}
134
135 Runtime::FunctionId id() const { return id_; }
136 size_t arity() const { return arity_; }
137
138 private:
139 const Runtime::FunctionId id_;
140 const size_t arity_;
141};
142
143bool operator==(CallRuntimeParameters const&, CallRuntimeParameters const&);
144bool operator!=(CallRuntimeParameters const&, CallRuntimeParameters const&);
145
146size_t hash_value(CallRuntimeParameters const&);
147
148std::ostream& operator<<(std::ostream&, CallRuntimeParameters const&);
149
150const CallRuntimeParameters& CallRuntimeParametersOf(const Operator* op);
151
152
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000153// Defines the location of a context slot relative to a specific scope. This is
154// used as a parameter by JSLoadContext and JSStoreContext operators and allows
155// accessing a context-allocated variable without keeping track of the scope.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000156class ContextAccess final {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000157 public:
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400158 ContextAccess(size_t depth, size_t index, bool immutable);
159
160 size_t depth() const { return depth_; }
161 size_t index() const { return index_; }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000162 bool immutable() const { return immutable_; }
163
164 private:
165 // For space reasons, we keep this tightly packed, otherwise we could just use
166 // a simple int/int/bool POD.
167 const bool immutable_;
168 const uint16_t depth_;
169 const uint32_t index_;
170};
171
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400172bool operator==(ContextAccess const&, ContextAccess const&);
173bool operator!=(ContextAccess const&, ContextAccess const&);
174
175size_t hash_value(ContextAccess const&);
176
177std::ostream& operator<<(std::ostream&, ContextAccess const&);
178
179ContextAccess const& ContextAccessOf(Operator const*);
180
181
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000182// Defines the property of an object for a named access. This is
183// used as a parameter by the JSLoadNamed and JSStoreNamed operators.
184class NamedAccess final {
185 public:
186 NamedAccess(LanguageMode language_mode, Handle<Name> name,
187 VectorSlotPair const& feedback)
188 : name_(name), feedback_(feedback), language_mode_(language_mode) {}
189
190 Handle<Name> name() const { return name_; }
191 LanguageMode language_mode() const { return language_mode_; }
192 VectorSlotPair const& feedback() const { return feedback_; }
193
194 private:
195 Handle<Name> const name_;
196 VectorSlotPair const feedback_;
197 LanguageMode const language_mode_;
198};
199
200bool operator==(NamedAccess const&, NamedAccess const&);
201bool operator!=(NamedAccess const&, NamedAccess const&);
202
203size_t hash_value(NamedAccess const&);
204
205std::ostream& operator<<(std::ostream&, NamedAccess const&);
206
207const NamedAccess& NamedAccessOf(const Operator* op);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400208
209
210// Defines the property being loaded from an object by a named load. This is
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000211// used as a parameter by JSLoadGlobal operator.
212class LoadGlobalParameters final {
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400213 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000214 LoadGlobalParameters(const Handle<Name>& name, const VectorSlotPair& feedback,
215 TypeofMode typeof_mode)
216 : name_(name), feedback_(feedback), typeof_mode_(typeof_mode) {}
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400217
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000218 const Handle<Name>& name() const { return name_; }
219 TypeofMode typeof_mode() const { return typeof_mode_; }
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400220
221 const VectorSlotPair& feedback() const { return feedback_; }
222
223 private:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000224 const Handle<Name> name_;
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400225 const VectorSlotPair feedback_;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000226 const TypeofMode typeof_mode_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000227};
228
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000229bool operator==(LoadGlobalParameters const&, LoadGlobalParameters const&);
230bool operator!=(LoadGlobalParameters const&, LoadGlobalParameters const&);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400231
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000232size_t hash_value(LoadGlobalParameters const&);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400233
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000234std::ostream& operator<<(std::ostream&, LoadGlobalParameters const&);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400235
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000236const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400237
238
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000239// Defines the property being stored to an object by a named store. This is
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000240// used as a parameter by JSStoreGlobal operator.
241class StoreGlobalParameters final {
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400242 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000243 StoreGlobalParameters(LanguageMode language_mode,
244 const VectorSlotPair& feedback,
245 const Handle<Name>& name)
246 : language_mode_(language_mode), name_(name), feedback_(feedback) {}
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400247
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000248 LanguageMode language_mode() const { return language_mode_; }
249 const VectorSlotPair& feedback() const { return feedback_; }
250 const Handle<Name>& name() const { return name_; }
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400251
252 private:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000253 const LanguageMode language_mode_;
254 const Handle<Name> name_;
255 const VectorSlotPair feedback_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000256};
257
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000258bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&);
259bool operator!=(StoreGlobalParameters const&, StoreGlobalParameters const&);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400260
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000261size_t hash_value(StoreGlobalParameters const&);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400262
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000263std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400264
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000265const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op);
266
267
268// Defines the property of an object for a keyed access. This is used
269// as a parameter by the JSLoadProperty and JSStoreProperty operators.
270class PropertyAccess final {
271 public:
272 PropertyAccess(LanguageMode language_mode, VectorSlotPair const& feedback)
273 : feedback_(feedback), language_mode_(language_mode) {}
274
275 LanguageMode language_mode() const { return language_mode_; }
276 VectorSlotPair const& feedback() const { return feedback_; }
277
278 private:
279 VectorSlotPair const feedback_;
280 LanguageMode const language_mode_;
281};
282
283bool operator==(PropertyAccess const&, PropertyAccess const&);
284bool operator!=(PropertyAccess const&, PropertyAccess const&);
285
286size_t hash_value(PropertyAccess const&);
287
288std::ostream& operator<<(std::ostream&, PropertyAccess const&);
289
290PropertyAccess const& PropertyAccessOf(const Operator* op);
291
292
Ben Murdoch097c5b22016-05-18 11:27:45 +0100293// CreateArgumentsType is used as parameter to JSCreateArguments nodes.
294CreateArgumentsType const& CreateArgumentsTypeOf(const Operator* op);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000295
296
297// Defines shared information for the array that should be created. This is
298// used as parameter by JSCreateArray operators.
299class CreateArrayParameters final {
300 public:
301 explicit CreateArrayParameters(size_t arity, Handle<AllocationSite> site)
302 : arity_(arity), site_(site) {}
303
304 size_t arity() const { return arity_; }
305 Handle<AllocationSite> site() const { return site_; }
306
307 private:
308 size_t const arity_;
309 Handle<AllocationSite> const site_;
310};
311
312bool operator==(CreateArrayParameters const&, CreateArrayParameters const&);
313bool operator!=(CreateArrayParameters const&, CreateArrayParameters const&);
314
315size_t hash_value(CreateArrayParameters const&);
316
317std::ostream& operator<<(std::ostream&, CreateArrayParameters const&);
318
319const CreateArrayParameters& CreateArrayParametersOf(const Operator* op);
320
321
322// Defines shared information for the closure that should be created. This is
323// used as a parameter by JSCreateClosure operators.
324class CreateClosureParameters final {
325 public:
326 CreateClosureParameters(Handle<SharedFunctionInfo> shared_info,
327 PretenureFlag pretenure)
328 : shared_info_(shared_info), pretenure_(pretenure) {}
329
330 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
331 PretenureFlag pretenure() const { return pretenure_; }
332
333 private:
334 const Handle<SharedFunctionInfo> shared_info_;
335 const PretenureFlag pretenure_;
336};
337
338bool operator==(CreateClosureParameters const&, CreateClosureParameters const&);
339bool operator!=(CreateClosureParameters const&, CreateClosureParameters const&);
340
341size_t hash_value(CreateClosureParameters const&);
342
343std::ostream& operator<<(std::ostream&, CreateClosureParameters const&);
344
345const CreateClosureParameters& CreateClosureParametersOf(const Operator* op);
346
347
348// Defines shared information for the literal that should be created. This is
349// used as parameter by JSCreateLiteralArray, JSCreateLiteralObject and
350// JSCreateLiteralRegExp operators.
351class CreateLiteralParameters final {
352 public:
Ben Murdochda12d292016-06-02 14:46:10 +0100353 CreateLiteralParameters(Handle<HeapObject> constant, int length, int flags,
354 int index)
355 : constant_(constant), length_(length), flags_(flags), index_(index) {}
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000356
357 Handle<HeapObject> constant() const { return constant_; }
Ben Murdochda12d292016-06-02 14:46:10 +0100358 int length() const { return length_; }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000359 int flags() const { return flags_; }
360 int index() const { return index_; }
361
362 private:
363 Handle<HeapObject> const constant_;
Ben Murdochda12d292016-06-02 14:46:10 +0100364 int const length_;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000365 int const flags_;
366 int const index_;
367};
368
369bool operator==(CreateLiteralParameters const&, CreateLiteralParameters const&);
370bool operator!=(CreateLiteralParameters const&, CreateLiteralParameters const&);
371
372size_t hash_value(CreateLiteralParameters const&);
373
374std::ostream& operator<<(std::ostream&, CreateLiteralParameters const&);
375
376const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400377
378
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000379// Interface for building JavaScript-level operators, e.g. directly from the
380// AST. Most operators have no parameters, thus can be globally shared for all
381// graphs.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000382class JSOperatorBuilder final : public ZoneObject {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000383 public:
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400384 explicit JSOperatorBuilder(Zone* zone);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000385
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400386 const Operator* Equal();
387 const Operator* NotEqual();
388 const Operator* StrictEqual();
389 const Operator* StrictNotEqual();
Ben Murdoch097c5b22016-05-18 11:27:45 +0100390 const Operator* LessThan();
391 const Operator* GreaterThan();
392 const Operator* LessThanOrEqual();
393 const Operator* GreaterThanOrEqual();
394 const Operator* BitwiseOr(BinaryOperationHints hints);
395 const Operator* BitwiseXor(BinaryOperationHints hints);
396 const Operator* BitwiseAnd(BinaryOperationHints hints);
397 const Operator* ShiftLeft(BinaryOperationHints hints);
398 const Operator* ShiftRight(BinaryOperationHints hints);
399 const Operator* ShiftRightLogical(BinaryOperationHints hints);
400 const Operator* Add(BinaryOperationHints hints);
401 const Operator* Subtract(BinaryOperationHints hints);
402 const Operator* Multiply(BinaryOperationHints hints);
403 const Operator* Divide(BinaryOperationHints hints);
404 const Operator* Modulus(BinaryOperationHints hints);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000405
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000406 const Operator* ToBoolean(ToBooleanHints hints);
Ben Murdochda12d292016-06-02 14:46:10 +0100407 const Operator* ToInteger();
408 const Operator* ToLength();
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400409 const Operator* ToName();
Ben Murdochda12d292016-06-02 14:46:10 +0100410 const Operator* ToNumber();
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400411 const Operator* ToObject();
Ben Murdochda12d292016-06-02 14:46:10 +0100412 const Operator* ToString();
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400413 const Operator* Yield();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000414
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400415 const Operator* Create();
Ben Murdoch097c5b22016-05-18 11:27:45 +0100416 const Operator* CreateArguments(CreateArgumentsType type);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000417 const Operator* CreateArray(size_t arity, Handle<AllocationSite> site);
418 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info,
419 PretenureFlag pretenure);
420 const Operator* CreateIterResultObject();
421 const Operator* CreateLiteralArray(Handle<FixedArray> constant_elements,
Ben Murdochda12d292016-06-02 14:46:10 +0100422 int literal_flags, int literal_index,
423 int number_of_elements);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000424 const Operator* CreateLiteralObject(Handle<FixedArray> constant_properties,
Ben Murdochda12d292016-06-02 14:46:10 +0100425 int literal_flags, int literal_index,
426 int number_of_properties);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000427 const Operator* CreateLiteralRegExp(Handle<String> constant_pattern,
428 int literal_flags, int literal_index);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000429
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000430 const Operator* CallFunction(
Ben Murdoch097c5b22016-05-18 11:27:45 +0100431 size_t arity, VectorSlotPair const& feedback = VectorSlotPair(),
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000432 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
433 TailCallMode tail_call_mode = TailCallMode::kDisallow);
Ben Murdoch097c5b22016-05-18 11:27:45 +0100434 const Operator* CallRuntime(Runtime::FunctionId id);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400435 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
Ben Murdoch097c5b22016-05-18 11:27:45 +0100436 const Operator* CallRuntime(const Runtime::Function* function, size_t arity);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000437 const Operator* CallConstruct(size_t arity, VectorSlotPair const& feedback);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000438
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000439 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000440
Ben Murdoch097c5b22016-05-18 11:27:45 +0100441 const Operator* LoadProperty(VectorSlotPair const& feedback);
442 const Operator* LoadNamed(Handle<Name> name, VectorSlotPair const& feedback);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000443
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000444 const Operator* StoreProperty(LanguageMode language_mode,
445 VectorSlotPair const& feedback);
446 const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name,
447 VectorSlotPair const& feedback);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000448
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000449 const Operator* DeleteProperty(LanguageMode language_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000450
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400451 const Operator* HasProperty();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000452
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000453 const Operator* LoadGlobal(const Handle<Name>& name,
454 const VectorSlotPair& feedback,
455 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
456 const Operator* StoreGlobal(LanguageMode language_mode,
457 const Handle<Name>& name,
458 const VectorSlotPair& feedback);
459
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400460 const Operator* LoadContext(size_t depth, size_t index, bool immutable);
461 const Operator* StoreContext(size_t depth, size_t index);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000462
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400463 const Operator* TypeOf();
464 const Operator* InstanceOf();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000465
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000466 const Operator* ForInDone();
467 const Operator* ForInNext();
468 const Operator* ForInPrepare();
469 const Operator* ForInStep();
470
471 const Operator* LoadMessage();
472 const Operator* StoreMessage();
473
474 const Operator* StackCheck();
475
476 const Operator* CreateFunctionContext(int slot_count);
477 const Operator* CreateCatchContext(const Handle<String>& name);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400478 const Operator* CreateWithContext();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000479 const Operator* CreateBlockContext(const Handle<ScopeInfo>& scpope_info);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400480 const Operator* CreateModuleContext();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000481 const Operator* CreateScriptContext(const Handle<ScopeInfo>& scpope_info);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000482
483 private:
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400484 Zone* zone() const { return zone_; }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000485
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400486 const JSOperatorGlobalCache& cache_;
487 Zone* const zone_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000488
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400489 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000490};
491
492} // namespace compiler
493} // namespace internal
494} // namespace v8
495
496#endif // V8_COMPILER_JS_OPERATOR_H_