blob: 070e71efacff77c5eeb5e1ffeed8329159895eb7 [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:
353 CreateLiteralParameters(Handle<HeapObject> constant, int flags, int index)
354 : constant_(constant), flags_(flags), index_(index) {}
355
356 Handle<HeapObject> constant() const { return constant_; }
357 int flags() const { return flags_; }
358 int index() const { return index_; }
359
360 private:
361 Handle<HeapObject> const constant_;
362 int const flags_;
363 int const index_;
364};
365
366bool operator==(CreateLiteralParameters const&, CreateLiteralParameters const&);
367bool operator!=(CreateLiteralParameters const&, CreateLiteralParameters const&);
368
369size_t hash_value(CreateLiteralParameters const&);
370
371std::ostream& operator<<(std::ostream&, CreateLiteralParameters const&);
372
373const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400374
375
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000376// Interface for building JavaScript-level operators, e.g. directly from the
377// AST. Most operators have no parameters, thus can be globally shared for all
378// graphs.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000379class JSOperatorBuilder final : public ZoneObject {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000380 public:
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400381 explicit JSOperatorBuilder(Zone* zone);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000382
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400383 const Operator* Equal();
384 const Operator* NotEqual();
385 const Operator* StrictEqual();
386 const Operator* StrictNotEqual();
Ben Murdoch097c5b22016-05-18 11:27:45 +0100387 const Operator* LessThan();
388 const Operator* GreaterThan();
389 const Operator* LessThanOrEqual();
390 const Operator* GreaterThanOrEqual();
391 const Operator* BitwiseOr(BinaryOperationHints hints);
392 const Operator* BitwiseXor(BinaryOperationHints hints);
393 const Operator* BitwiseAnd(BinaryOperationHints hints);
394 const Operator* ShiftLeft(BinaryOperationHints hints);
395 const Operator* ShiftRight(BinaryOperationHints hints);
396 const Operator* ShiftRightLogical(BinaryOperationHints hints);
397 const Operator* Add(BinaryOperationHints hints);
398 const Operator* Subtract(BinaryOperationHints hints);
399 const Operator* Multiply(BinaryOperationHints hints);
400 const Operator* Divide(BinaryOperationHints hints);
401 const Operator* Modulus(BinaryOperationHints hints);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000402
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000403 const Operator* ToBoolean(ToBooleanHints hints);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400404 const Operator* ToNumber();
405 const Operator* ToString();
406 const Operator* ToName();
407 const Operator* ToObject();
408 const Operator* Yield();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000409
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400410 const Operator* Create();
Ben Murdoch097c5b22016-05-18 11:27:45 +0100411 const Operator* CreateArguments(CreateArgumentsType type);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000412 const Operator* CreateArray(size_t arity, Handle<AllocationSite> site);
413 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info,
414 PretenureFlag pretenure);
415 const Operator* CreateIterResultObject();
416 const Operator* CreateLiteralArray(Handle<FixedArray> constant_elements,
417 int literal_flags, int literal_index);
418 const Operator* CreateLiteralObject(Handle<FixedArray> constant_properties,
419 int literal_flags, int literal_index);
420 const Operator* CreateLiteralRegExp(Handle<String> constant_pattern,
421 int literal_flags, int literal_index);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000422
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000423 const Operator* CallFunction(
Ben Murdoch097c5b22016-05-18 11:27:45 +0100424 size_t arity, VectorSlotPair const& feedback = VectorSlotPair(),
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000425 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
426 TailCallMode tail_call_mode = TailCallMode::kDisallow);
Ben Murdoch097c5b22016-05-18 11:27:45 +0100427 const Operator* CallRuntime(Runtime::FunctionId id);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400428 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
Ben Murdoch097c5b22016-05-18 11:27:45 +0100429 const Operator* CallRuntime(const Runtime::Function* function, size_t arity);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000430 const Operator* CallConstruct(size_t arity, VectorSlotPair const& feedback);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000431
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000432 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000433
Ben Murdoch097c5b22016-05-18 11:27:45 +0100434 const Operator* LoadProperty(VectorSlotPair const& feedback);
435 const Operator* LoadNamed(Handle<Name> name, VectorSlotPair const& feedback);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000436
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000437 const Operator* StoreProperty(LanguageMode language_mode,
438 VectorSlotPair const& feedback);
439 const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name,
440 VectorSlotPair const& feedback);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000441
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000442 const Operator* DeleteProperty(LanguageMode language_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000443
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400444 const Operator* HasProperty();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000445
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000446 const Operator* LoadGlobal(const Handle<Name>& name,
447 const VectorSlotPair& feedback,
448 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
449 const Operator* StoreGlobal(LanguageMode language_mode,
450 const Handle<Name>& name,
451 const VectorSlotPair& feedback);
452
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400453 const Operator* LoadContext(size_t depth, size_t index, bool immutable);
454 const Operator* StoreContext(size_t depth, size_t index);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000455
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400456 const Operator* TypeOf();
457 const Operator* InstanceOf();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000458
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000459 const Operator* ForInDone();
460 const Operator* ForInNext();
461 const Operator* ForInPrepare();
462 const Operator* ForInStep();
463
464 const Operator* LoadMessage();
465 const Operator* StoreMessage();
466
467 const Operator* StackCheck();
468
469 const Operator* CreateFunctionContext(int slot_count);
470 const Operator* CreateCatchContext(const Handle<String>& name);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400471 const Operator* CreateWithContext();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000472 const Operator* CreateBlockContext(const Handle<ScopeInfo>& scpope_info);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400473 const Operator* CreateModuleContext();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000474 const Operator* CreateScriptContext(const Handle<ScopeInfo>& scpope_info);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000475
476 private:
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400477 Zone* zone() const { return zone_; }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000478
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400479 const JSOperatorGlobalCache& cache_;
480 Zone* const zone_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000481
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400482 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000483};
484
485} // namespace compiler
486} // namespace internal
487} // namespace v8
488
489#endif // V8_COMPILER_JS_OPERATOR_H_