v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lithium-x64.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_X64_LITHIUM_X64_H_
29 #define V8_X64_LITHIUM_X64_H_
30 
31 #include "hydrogen.h"
32 #include "lithium-allocator.h"
33 #include "lithium.h"
34 #include "safepoint-table.h"
35 #include "utils.h"
36 
37 namespace v8 {
38 namespace internal {
39 
40 // Forward declarations.
41 class LCodeGen;
42 
43 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
44  V(ControlInstruction) \
45  V(Call) \
46  LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
47 
48 
49 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
50  V(AccessArgumentsAt) \
51  V(AddI) \
52  V(AllocateObject) \
53  V(ApplyArguments) \
54  V(ArgumentsElements) \
55  V(ArgumentsLength) \
56  V(ArithmeticD) \
57  V(ArithmeticT) \
58  V(ArrayLiteral) \
59  V(BitI) \
60  V(BitNotI) \
61  V(BoundsCheck) \
62  V(Branch) \
63  V(CallConstantFunction) \
64  V(CallFunction) \
65  V(CallGlobal) \
66  V(CallKeyed) \
67  V(CallKnownGlobal) \
68  V(CallNamed) \
69  V(CallNew) \
70  V(CallRuntime) \
71  V(CallStub) \
72  V(CheckFunction) \
73  V(CheckInstanceType) \
74  V(CheckMaps) \
75  V(CheckNonSmi) \
76  V(CheckPrototypeMaps) \
77  V(CheckSmi) \
78  V(ClampDToUint8) \
79  V(ClampIToUint8) \
80  V(ClampTToUint8) \
81  V(ClassOfTestAndBranch) \
82  V(CmpConstantEqAndBranch) \
83  V(CmpIDAndBranch) \
84  V(CmpObjectEqAndBranch) \
85  V(CmpMapAndBranch) \
86  V(CmpT) \
87  V(ConstantD) \
88  V(ConstantI) \
89  V(ConstantT) \
90  V(Context) \
91  V(DeclareGlobals) \
92  V(DeleteProperty) \
93  V(Deoptimize) \
94  V(DivI) \
95  V(DoubleToI) \
96  V(ElementsKind) \
97  V(FastLiteral) \
98  V(FixedArrayBaseLength) \
99  V(MapEnumLength) \
100  V(FunctionLiteral) \
101  V(GetCachedArrayIndex) \
102  V(GlobalObject) \
103  V(GlobalReceiver) \
104  V(Goto) \
105  V(HasCachedArrayIndexAndBranch) \
106  V(HasInstanceTypeAndBranch) \
107  V(In) \
108  V(InstanceOf) \
109  V(InstanceOfKnownGlobal) \
110  V(InstructionGap) \
111  V(Integer32ToDouble) \
112  V(Uint32ToDouble) \
113  V(InvokeFunction) \
114  V(IsConstructCallAndBranch) \
115  V(IsNilAndBranch) \
116  V(IsObjectAndBranch) \
117  V(IsStringAndBranch) \
118  V(IsSmiAndBranch) \
119  V(IsUndetectableAndBranch) \
120  V(JSArrayLength) \
121  V(Label) \
122  V(LazyBailout) \
123  V(LoadContextSlot) \
124  V(LoadElements) \
125  V(LoadExternalArrayPointer) \
126  V(LoadFunctionPrototype) \
127  V(LoadGlobalCell) \
128  V(LoadGlobalGeneric) \
129  V(LoadKeyedFastDoubleElement) \
130  V(LoadKeyedFastElement) \
131  V(LoadKeyedGeneric) \
132  V(LoadKeyedSpecializedArrayElement) \
133  V(LoadNamedField) \
134  V(LoadNamedFieldPolymorphic) \
135  V(LoadNamedGeneric) \
136  V(MathFloorOfDiv) \
137  V(MathMinMax) \
138  V(ModI) \
139  V(MulI) \
140  V(NumberTagD) \
141  V(NumberTagI) \
142  V(NumberTagU) \
143  V(NumberUntagD) \
144  V(ObjectLiteral) \
145  V(OsrEntry) \
146  V(OuterContext) \
147  V(Parameter) \
148  V(Power) \
149  V(PushArgument) \
150  V(Random) \
151  V(RegExpLiteral) \
152  V(Return) \
153  V(ShiftI) \
154  V(SmiTag) \
155  V(SmiUntag) \
156  V(StackCheck) \
157  V(StoreContextSlot) \
158  V(StoreGlobalCell) \
159  V(StoreGlobalGeneric) \
160  V(StoreKeyedFastDoubleElement) \
161  V(StoreKeyedFastElement) \
162  V(StoreKeyedGeneric) \
163  V(StoreKeyedSpecializedArrayElement) \
164  V(StoreNamedField) \
165  V(StoreNamedGeneric) \
166  V(StringAdd) \
167  V(StringCharCodeAt) \
168  V(StringCharFromCode) \
169  V(StringCompareAndBranch) \
170  V(StringLength) \
171  V(SubI) \
172  V(TaggedToI) \
173  V(ThisFunction) \
174  V(Throw) \
175  V(ToFastProperties) \
176  V(TransitionElementsKind) \
177  V(Typeof) \
178  V(TypeofIsAndBranch) \
179  V(UnaryMathOperation) \
180  V(UnknownOSRValue) \
181  V(ValueOf) \
182  V(ForInPrepareMap) \
183  V(ForInCacheArray) \
184  V(CheckMapValue) \
185  V(LoadFieldByIndex) \
186  V(DateField) \
187  V(WrapReceiver) \
188  V(Drop)
189 
190 
191 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
192  virtual Opcode opcode() const { return LInstruction::k##type; } \
193  virtual void CompileToNative(LCodeGen* generator); \
194  virtual const char* Mnemonic() const { return mnemonic; } \
195  static L##type* cast(LInstruction* instr) { \
196  ASSERT(instr->Is##type()); \
197  return reinterpret_cast<L##type*>(instr); \
198  }
199 
200 
201 #define DECLARE_HYDROGEN_ACCESSOR(type) \
202  H##type* hydrogen() const { \
203  return H##type::cast(hydrogen_value()); \
204  }
205 
206 
207 class LInstruction: public ZoneObject {
208  public:
210  : environment_(NULL),
211  hydrogen_value_(NULL),
212  is_call_(false) { }
213 
214  virtual ~LInstruction() { }
215 
216  virtual void CompileToNative(LCodeGen* generator) = 0;
217  virtual const char* Mnemonic() const = 0;
218  virtual void PrintTo(StringStream* stream);
219  virtual void PrintDataTo(StringStream* stream);
220  virtual void PrintOutputOperandTo(StringStream* stream);
221 
222  enum Opcode {
223  // Declare a unique enum value for each instruction.
224 #define DECLARE_OPCODE(type) k##type,
227 #undef DECLARE_OPCODE
228  };
229 
230  virtual Opcode opcode() const = 0;
231 
232  // Declare non-virtual type testers for all leaf IR classes.
233 #define DECLARE_PREDICATE(type) \
234  bool Is##type() const { return opcode() == k##type; }
236 #undef DECLARE_PREDICATE
237 
238  // Declare virtual predicates for instructions that don't have
239  // an opcode.
240  virtual bool IsGap() const { return false; }
241 
242  virtual bool IsControl() const { return false; }
243 
244  void set_environment(LEnvironment* env) { environment_ = env; }
245  LEnvironment* environment() const { return environment_; }
246  bool HasEnvironment() const { return environment_ != NULL; }
247 
248  void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
249  LPointerMap* pointer_map() const { return pointer_map_.get(); }
250  bool HasPointerMap() const { return pointer_map_.is_set(); }
251 
252  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
253  HValue* hydrogen_value() const { return hydrogen_value_; }
254 
255  void MarkAsCall() { is_call_ = true; }
256 
258 
259  // Interface to the register allocator and iterators.
260  bool IsMarkedAsCall() const { return is_call_; }
261 
262  virtual bool HasResult() const = 0;
263  virtual LOperand* result() = 0;
264 
265  LOperand* FirstInput() { return InputAt(0); }
266  LOperand* Output() { return HasResult() ? result() : NULL; }
267 
268 #ifdef DEBUG
269  void VerifyCall();
270 #endif
271 
272  private:
273  // Iterator support.
274  friend class InputIterator;
275  virtual int InputCount() = 0;
276  virtual LOperand* InputAt(int i) = 0;
277 
278  friend class TempIterator;
279  virtual int TempCount() = 0;
280  virtual LOperand* TempAt(int i) = 0;
281 
282  LEnvironment* environment_;
283  SetOncePointer<LPointerMap> pointer_map_;
284  HValue* hydrogen_value_;
285  bool is_call_;
286 };
287 
288 
289 // R = number of result operands (0 or 1).
290 // I = number of input operands.
291 // T = number of temporary operands.
292 template<int R, int I, int T>
293 class LTemplateInstruction: public LInstruction {
294  public:
295  // Allow 0 or 1 output operands.
296  STATIC_ASSERT(R == 0 || R == 1);
297  virtual bool HasResult() const { return R != 0; }
298  void set_result(LOperand* operand) { results_[0] = operand; }
299  LOperand* result() { return results_[0]; }
300 
301  protected:
305 
306  private:
307  // Iterator support.
308  virtual int InputCount() { return I; }
309  virtual LOperand* InputAt(int i) { return inputs_[i]; }
310 
311  virtual int TempCount() { return T; }
312  virtual LOperand* TempAt(int i) { return temps_[i]; }
313 };
314 
315 
316 class LGap: public LTemplateInstruction<0, 0, 0> {
317  public:
318  explicit LGap(HBasicBlock* block)
319  : block_(block) {
320  parallel_moves_[BEFORE] = NULL;
321  parallel_moves_[START] = NULL;
322  parallel_moves_[END] = NULL;
323  parallel_moves_[AFTER] = NULL;
324  }
325 
326  // Can't use the DECLARE-macro here because of sub-classes.
327  virtual bool IsGap() const { return true; }
328  virtual void PrintDataTo(StringStream* stream);
329  static LGap* cast(LInstruction* instr) {
330  ASSERT(instr->IsGap());
331  return reinterpret_cast<LGap*>(instr);
332  }
333 
334  bool IsRedundant() const;
335 
336  HBasicBlock* block() const { return block_; }
337 
339  BEFORE,
340  START,
341  END,
342  AFTER,
344  LAST_INNER_POSITION = AFTER
345  };
346 
348  Zone* zone) {
349  if (parallel_moves_[pos] == NULL) {
350  parallel_moves_[pos] = new(zone) LParallelMove(zone);
351  }
352  return parallel_moves_[pos];
353  }
354 
356  return parallel_moves_[pos];
357  }
358 
359  private:
360  LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
361  HBasicBlock* block_;
362 };
363 
364 
365 class LInstructionGap: public LGap {
366  public:
367  explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
368 
369  DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
370 };
371 
372 
373 class LGoto: public LTemplateInstruction<0, 0, 0> {
374  public:
375  explicit LGoto(int block_id) : block_id_(block_id) { }
376 
377  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
378  virtual void PrintDataTo(StringStream* stream);
379  virtual bool IsControl() const { return true; }
380 
381  int block_id() const { return block_id_; }
382 
383  private:
384  int block_id_;
385 };
386 
387 
388 class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
389  public:
390  LLazyBailout() : gap_instructions_size_(0) { }
391 
392  DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
393 
395  gap_instructions_size_ = gap_instructions_size;
396  }
397  int gap_instructions_size() { return gap_instructions_size_; }
398 
399  private:
400  int gap_instructions_size_;
401 };
402 
403 
404 class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
405  public:
406  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
407 };
408 
409 
410 class LLabel: public LGap {
411  public:
413  : LGap(block), replacement_(NULL) { }
414 
415  DECLARE_CONCRETE_INSTRUCTION(Label, "label")
416 
417  virtual void PrintDataTo(StringStream* stream);
418 
419  int block_id() const { return block()->block_id(); }
420  bool is_loop_header() const { return block()->IsLoopHeader(); }
421  Label* label() { return &label_; }
422  LLabel* replacement() const { return replacement_; }
423  void set_replacement(LLabel* label) { replacement_ = label; }
424  bool HasReplacement() const { return replacement_ != NULL; }
425 
426  private:
427  Label label_;
428  LLabel* replacement_;
429 };
430 
431 
432 class LParameter: public LTemplateInstruction<1, 0, 0> {
433  public:
434  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
435 };
436 
437 
438 class LCallStub: public LTemplateInstruction<1, 0, 0> {
439  public:
440  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
441  DECLARE_HYDROGEN_ACCESSOR(CallStub)
442 
444  return hydrogen()->transcendental_type();
445  }
446 };
447 
448 
449 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
450  public:
451  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
452 };
453 
454 
455 template<int I, int T>
456 class LControlInstruction: public LTemplateInstruction<0, I, T> {
457  public:
458  virtual bool IsControl() const { return true; }
459 
460  int SuccessorCount() { return hydrogen()->SuccessorCount(); }
461  HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
462  int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); }
463  int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); }
464 
465  private:
466  HControlInstruction* hydrogen() {
468  }
469 };
470 
471 
472 class LWrapReceiver: public LTemplateInstruction<1, 2, 0> {
473  public:
475  inputs_[0] = receiver;
476  inputs_[1] = function;
477  }
478 
479  LOperand* receiver() { return inputs_[0]; }
480  LOperand* function() { return inputs_[1]; }
481 
482  DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
483 };
484 
485 
486 class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
487  public:
490  LOperand* length,
491  LOperand* elements) {
492  inputs_[0] = function;
493  inputs_[1] = receiver;
494  inputs_[2] = length;
495  inputs_[3] = elements;
496  }
497 
498  LOperand* function() { return inputs_[0]; }
499  LOperand* receiver() { return inputs_[1]; }
500  LOperand* length() { return inputs_[2]; }
501  LOperand* elements() { return inputs_[3]; }
502 
503  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
504 };
505 
506 
507 class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
508  public:
510  inputs_[0] = arguments;
511  inputs_[1] = length;
512  inputs_[2] = index;
513  }
514 
515  LOperand* arguments() { return inputs_[0]; }
516  LOperand* length() { return inputs_[1]; }
517  LOperand* index() { return inputs_[2]; }
518 
519  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
520 
521  virtual void PrintDataTo(StringStream* stream);
522 };
523 
524 
525 class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
526  public:
527  explicit LArgumentsLength(LOperand* elements) {
528  inputs_[0] = elements;
529  }
530 
531  LOperand* elements() { return inputs_[0]; }
532 
533  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
534 };
535 
536 
537 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
538  public:
539  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
540  DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
541 };
542 
543 
544 class LModI: public LTemplateInstruction<1, 2, 1> {
545  public:
546  LModI(LOperand* left, LOperand* right, LOperand* temp) {
547  inputs_[0] = left;
548  inputs_[1] = right;
549  temps_[0] = temp;
550  }
551 
552  LOperand* left() { return inputs_[0]; }
553  LOperand* right() { return inputs_[1]; }
554  LOperand* temp() { return temps_[0]; }
555 
556  DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
558 };
559 
560 
561 class LDivI: public LTemplateInstruction<1, 2, 1> {
562  public:
563  LDivI(LOperand* left, LOperand* right, LOperand* temp) {
564  inputs_[0] = left;
565  inputs_[1] = right;
566  temps_[0] = temp;
567  }
568 
569  LOperand* left() { return inputs_[0]; }
570  LOperand* right() { return inputs_[1]; }
571  LOperand* temp() { return temps_[0]; }
572 
573  DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
575 };
576 
577 
578 class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> {
579  public:
581  LOperand* right,
582  LOperand* temp = NULL) {
583  inputs_[0] = left;
584  inputs_[1] = right;
585  temps_[0] = temp;
586  }
587 
588  LOperand* left() { return inputs_[0]; }
589  LOperand* right() { return inputs_[1]; }
590  LOperand* temp() { return temps_[0]; }
591 
592  DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
593  DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
594 };
595 
596 
597 class LMulI: public LTemplateInstruction<1, 2, 0> {
598  public:
599  LMulI(LOperand* left, LOperand* right) {
600  inputs_[0] = left;
601  inputs_[1] = right;
602  }
603 
604  LOperand* left() { return inputs_[0]; }
605  LOperand* right() { return inputs_[1]; }
606 
607  DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
609 };
610 
611 
612 class LCmpIDAndBranch: public LControlInstruction<2, 0> {
613  public:
615  inputs_[0] = left;
616  inputs_[1] = right;
617  }
618 
619  LOperand* left() { return inputs_[0]; }
620  LOperand* right() { return inputs_[1]; }
621 
622  DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
623  DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
624 
625  Token::Value op() const { return hydrogen()->token(); }
626  bool is_double() const {
627  return hydrogen()->GetInputRepresentation().IsDouble();
628  }
629 
630  virtual void PrintDataTo(StringStream* stream);
631 };
632 
633 
634 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> {
635  public:
636  explicit LUnaryMathOperation(LOperand* value) {
637  inputs_[0] = value;
638  }
639 
640  LOperand* value() { return inputs_[0]; }
641 
642  DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
643  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
644 
645  virtual void PrintDataTo(StringStream* stream);
646  BuiltinFunctionId op() const { return hydrogen()->op(); }
647 };
648 
649 
650 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
651  public:
653  inputs_[0] = left;
654  inputs_[1] = right;
655  }
656 
657  LOperand* left() { return inputs_[0]; }
658  LOperand* right() { return inputs_[1]; }
659 
660  DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch,
661  "cmp-object-eq-and-branch")
662 };
663 
664 
665 class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> {
666  public:
668  inputs_[0] = left;
669  }
670 
671  LOperand* left() { return inputs_[0]; }
672 
673  DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch,
674  "cmp-constant-eq-and-branch")
675  DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch)
676 };
677 
678 
679 class LIsNilAndBranch: public LControlInstruction<1, 1> {
680  public:
682  inputs_[0] = value;
683  temps_[0] = temp;
684  }
685 
686  LOperand* value() { return inputs_[0]; }
687  LOperand* temp() { return temps_[0]; }
688 
689  DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch")
690  DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch)
691 
692  EqualityKind kind() const { return hydrogen()->kind(); }
693  NilValue nil() const { return hydrogen()->nil(); }
694 
695  virtual void PrintDataTo(StringStream* stream);
696 };
697 
698 
699 class LIsObjectAndBranch: public LControlInstruction<1, 0> {
700  public:
701  explicit LIsObjectAndBranch(LOperand* value) {
702  inputs_[0] = value;
703  }
704 
705  LOperand* value() { return inputs_[0]; }
706 
707  DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
708  DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
709 
710  virtual void PrintDataTo(StringStream* stream);
711 };
712 
713 
714 class LIsStringAndBranch: public LControlInstruction<1, 1> {
715  public:
716  explicit LIsStringAndBranch(LOperand* value, LOperand* temp) {
717  inputs_[0] = value;
718  temps_[0] = temp;
719  }
720 
721  LOperand* value() { return inputs_[0]; }
722  LOperand* temp() { return temps_[0]; }
723 
724  DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
725  DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
726 
727  virtual void PrintDataTo(StringStream* stream);
728 };
729 
730 
731 class LIsSmiAndBranch: public LControlInstruction<1, 0> {
732  public:
733  explicit LIsSmiAndBranch(LOperand* value) {
734  inputs_[0] = value;
735  }
736 
737  LOperand* value() { return inputs_[0]; }
738 
739  DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
740  DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
741 
742  virtual void PrintDataTo(StringStream* stream);
743 };
744 
745 
746 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
747  public:
748  explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
749  inputs_[0] = value;
750  temps_[0] = temp;
751  }
752 
753  LOperand* value() { return inputs_[0]; }
754  LOperand* temp() { return temps_[0]; }
755 
756  DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
757  "is-undetectable-and-branch")
758  DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
759 
760  virtual void PrintDataTo(StringStream* stream);
761 };
762 
763 
764 class LStringCompareAndBranch: public LControlInstruction<2, 0> {
765  public:
766  explicit LStringCompareAndBranch(LOperand* left, LOperand* right) {
767  inputs_[0] = left;
768  inputs_[1] = right;
769  }
770 
771  LOperand* left() { return inputs_[0]; }
772  LOperand* right() { return inputs_[1]; }
773 
774  DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
775  "string-compare-and-branch")
776  DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
777 
778  virtual void PrintDataTo(StringStream* stream);
779 
780  Token::Value op() const { return hydrogen()->token(); }
781 };
782 
783 
784 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
785  public:
787  inputs_[0] = value;
788  }
789 
790  LOperand* value() { return inputs_[0]; }
791 
792  DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
793  "has-instance-type-and-branch")
794  DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
795 
796  virtual void PrintDataTo(StringStream* stream);
797 };
798 
799 
800 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
801  public:
802  explicit LGetCachedArrayIndex(LOperand* value) {
803  inputs_[0] = value;
804  }
805 
806  LOperand* value() { return inputs_[0]; }
807 
808  DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
809  DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
810 };
811 
812 
813 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
814  public:
816  inputs_[0] = value;
817  }
818 
819  LOperand* value() { return inputs_[0]; }
820 
821  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
822  "has-cached-array-index-and-branch")
823  DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
824 
825  virtual void PrintDataTo(StringStream* stream);
826 };
827 
828 
829 class LClassOfTestAndBranch: public LControlInstruction<1, 2> {
830  public:
832  inputs_[0] = value;
833  temps_[0] = temp;
834  temps_[1] = temp2;
835  }
836 
837  LOperand* value() { return inputs_[0]; }
838  LOperand* temp() { return temps_[0]; }
839  LOperand* temp2() { return temps_[1]; }
840 
841  DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
842  "class-of-test-and-branch")
843  DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
844 
845  virtual void PrintDataTo(StringStream* stream);
846 };
847 
848 
849 class LCmpT: public LTemplateInstruction<1, 2, 0> {
850  public:
851  LCmpT(LOperand* left, LOperand* right) {
852  inputs_[0] = left;
853  inputs_[1] = right;
854  }
855 
856  LOperand* left() { return inputs_[0]; }
857  LOperand* right() { return inputs_[1]; }
858 
859  DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
860  DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
861 
862  Token::Value op() const { return hydrogen()->token(); }
863 };
864 
865 
866 class LIn: public LTemplateInstruction<1, 2, 0> {
867  public:
868  LIn(LOperand* key, LOperand* object) {
869  inputs_[0] = key;
870  inputs_[1] = object;
871  }
872 
873  LOperand* key() { return inputs_[0]; }
874  LOperand* object() { return inputs_[1]; }
875 
877 };
878 
879 
880 class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
881  public:
882  LInstanceOf(LOperand* left, LOperand* right) {
883  inputs_[0] = left;
884  inputs_[1] = right;
885  }
886 
887  LOperand* left() { return inputs_[0]; }
888  LOperand* right() { return inputs_[1]; }
889 
890  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
891 };
892 
893 
894 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
895  public:
897  inputs_[0] = value;
898  temps_[0] = temp;
899  }
900 
901  LOperand* value() { return inputs_[0]; }
902  LOperand* temp() { return temps_[0]; }
903 
904  DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
905  "instance-of-known-global")
906  DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
907 
908  Handle<JSFunction> function() const { return hydrogen()->function(); }
910  return lazy_deopt_env_;
911  }
913  lazy_deopt_env_ = env;
914  }
915 
916  private:
917  LEnvironment* lazy_deopt_env_;
918 };
919 
920 
921 class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
922  public:
924  inputs_[0] = index;
925  inputs_[1] = length;
926  }
927 
928  LOperand* index() { return inputs_[0]; }
929  LOperand* length() { return inputs_[1]; }
930 
931  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
932  DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
933 };
934 
935 
936 class LBitI: public LTemplateInstruction<1, 2, 0> {
937  public:
938  LBitI(LOperand* left, LOperand* right) {
939  inputs_[0] = left;
940  inputs_[1] = right;
941  }
942 
943  LOperand* left() { return inputs_[0]; }
944  LOperand* right() { return inputs_[1]; }
945 
946  Token::Value op() const { return hydrogen()->op(); }
947 
948  DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
950 };
951 
952 
953 class LShiftI: public LTemplateInstruction<1, 2, 0> {
954  public:
955  LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
956  : op_(op), can_deopt_(can_deopt) {
957  inputs_[0] = left;
958  inputs_[1] = right;
959  }
960 
961  Token::Value op() const { return op_; }
962  LOperand* left() { return inputs_[0]; }
963  LOperand* right() { return inputs_[1]; }
964  bool can_deopt() const { return can_deopt_; }
965 
966  DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
967 
968  private:
969  Token::Value op_;
970  bool can_deopt_;
971 };
972 
973 
974 class LSubI: public LTemplateInstruction<1, 2, 0> {
975  public:
976  LSubI(LOperand* left, LOperand* right) {
977  inputs_[0] = left;
978  inputs_[1] = right;
979  }
980 
981  LOperand* left() { return inputs_[0]; }
982  LOperand* right() { return inputs_[1]; }
983 
984  DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
986 };
987 
988 
989 class LConstantI: public LTemplateInstruction<1, 0, 0> {
990  public:
991  DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
992  DECLARE_HYDROGEN_ACCESSOR(Constant)
993 
994  int32_t value() const { return hydrogen()->Integer32Value(); }
995 };
996 
997 
998 class LConstantD: public LTemplateInstruction<1, 0, 1> {
999  public:
1000  explicit LConstantD(LOperand* temp) {
1001  temps_[0] = temp;
1002  }
1003 
1004  LOperand* temp() { return temps_[0]; }
1005 
1006  DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1007  DECLARE_HYDROGEN_ACCESSOR(Constant)
1008 
1009  double value() const { return hydrogen()->DoubleValue(); }
1010 };
1011 
1012 
1013 class LConstantT: public LTemplateInstruction<1, 0, 0> {
1014  public:
1015  DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1016  DECLARE_HYDROGEN_ACCESSOR(Constant)
1017 
1018  Handle<Object> value() const { return hydrogen()->handle(); }
1019 };
1020 
1021 
1022 class LBranch: public LControlInstruction<1, 0> {
1023  public:
1024  explicit LBranch(LOperand* value) {
1025  inputs_[0] = value;
1026  }
1027 
1028  LOperand* value() { return inputs_[0]; }
1029 
1030  DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1032 
1033  virtual void PrintDataTo(StringStream* stream);
1034 };
1035 
1036 
1037 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> {
1038  public:
1039  explicit LCmpMapAndBranch(LOperand* value) {
1040  inputs_[0] = value;
1041  }
1042 
1043  LOperand* value() { return inputs_[0]; }
1044 
1045  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1046  DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1047 
1048  virtual bool IsControl() const { return true; }
1049 
1050  Handle<Map> map() const { return hydrogen()->map(); }
1051  int true_block_id() const {
1052  return hydrogen()->FirstSuccessor()->block_id();
1053  }
1054  int false_block_id() const {
1055  return hydrogen()->SecondSuccessor()->block_id();
1056  }
1057 };
1058 
1059 
1060 class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
1061  public:
1062  explicit LJSArrayLength(LOperand* value) {
1063  inputs_[0] = value;
1064  }
1065 
1066  LOperand* value() { return inputs_[0]; }
1067 
1068  DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1069  DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1070 };
1071 
1072 
1073 class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
1074  public:
1075  explicit LFixedArrayBaseLength(LOperand* value) {
1076  inputs_[0] = value;
1077  }
1078 
1079  LOperand* value() { return inputs_[0]; }
1080 
1081  DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength,
1082  "fixed-array-base-length")
1083  DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength)
1084 };
1085 
1086 
1087 class LMapEnumLength: public LTemplateInstruction<1, 1, 0> {
1088  public:
1089  explicit LMapEnumLength(LOperand* value) {
1090  inputs_[0] = value;
1091  }
1092 
1093  LOperand* value() { return inputs_[0]; }
1094 
1095  DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
1096 };
1097 
1098 
1099 class LElementsKind: public LTemplateInstruction<1, 1, 0> {
1100  public:
1101  explicit LElementsKind(LOperand* value) {
1102  inputs_[0] = value;
1103  }
1104 
1105  LOperand* value() { return inputs_[0]; }
1106 
1107  DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind")
1109 };
1110 
1111 
1112 class LValueOf: public LTemplateInstruction<1, 1, 0> {
1113  public:
1114  explicit LValueOf(LOperand* value) {
1115  inputs_[0] = value;
1116  }
1117 
1118  LOperand* value() { return inputs_[0]; }
1119 
1120  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1121  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1122 };
1123 
1124 
1125 class LDateField: public LTemplateInstruction<1, 1, 0> {
1126  public:
1127  LDateField(LOperand* date, Smi* index) : index_(index) {
1128  inputs_[0] = date;
1129  }
1130 
1131  LOperand* date() { return inputs_[0]; }
1132  Smi* index() const { return index_; }
1133 
1134  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1135  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1136 
1137  private:
1138  Smi* index_;
1139 };
1140 
1141 
1142 class LThrow: public LTemplateInstruction<0, 1, 0> {
1143  public:
1144  explicit LThrow(LOperand* value) {
1145  inputs_[0] = value;
1146  }
1147 
1148  LOperand* value() { return inputs_[0]; }
1149 
1151 };
1152 
1153 
1154 class LBitNotI: public LTemplateInstruction<1, 1, 0> {
1155  public:
1156  explicit LBitNotI(LOperand* value) {
1157  inputs_[0] = value;
1158  }
1159 
1160  LOperand* value() { return inputs_[0]; }
1161 
1162  DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
1163 };
1164 
1165 
1166 class LAddI: public LTemplateInstruction<1, 2, 0> {
1167  public:
1168  LAddI(LOperand* left, LOperand* right) {
1169  inputs_[0] = left;
1170  inputs_[1] = right;
1171  }
1172 
1173  LOperand* left() { return inputs_[0]; }
1174  LOperand* right() { return inputs_[1]; }
1175 
1176  DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1178 };
1179 
1180 
1181 class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
1182  public:
1183  LMathMinMax(LOperand* left, LOperand* right) {
1184  inputs_[0] = left;
1185  inputs_[1] = right;
1186  }
1187 
1188  LOperand* left() { return inputs_[0]; }
1189  LOperand* right() { return inputs_[1]; }
1190 
1191  DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max")
1192  DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1193 };
1194 
1195 
1196 class LPower: public LTemplateInstruction<1, 2, 0> {
1197  public:
1198  LPower(LOperand* left, LOperand* right) {
1199  inputs_[0] = left;
1200  inputs_[1] = right;
1201  }
1202 
1203  LOperand* left() { return inputs_[0]; }
1204  LOperand* right() { return inputs_[1]; }
1205 
1206  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1208 };
1209 
1210 
1211 class LRandom: public LTemplateInstruction<1, 1, 0> {
1212  public:
1213  explicit LRandom(LOperand* global_object) {
1214  inputs_[0] = global_object;
1215  }
1216 
1217  LOperand* global_object() { return inputs_[0]; }
1218 
1219  DECLARE_CONCRETE_INSTRUCTION(Random, "random")
1221 };
1222 
1223 
1224 class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
1225  public:
1227  : op_(op) {
1228  inputs_[0] = left;
1229  inputs_[1] = right;
1230  }
1231 
1232  Token::Value op() const { return op_; }
1233  LOperand* left() { return inputs_[0]; }
1234  LOperand* right() { return inputs_[1]; }
1235 
1236  virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
1237  virtual void CompileToNative(LCodeGen* generator);
1238  virtual const char* Mnemonic() const;
1239 
1240  private:
1241  Token::Value op_;
1242 };
1243 
1244 
1245 class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
1246  public:
1248  : op_(op) {
1249  inputs_[0] = left;
1250  inputs_[1] = right;
1251  }
1252 
1253  Token::Value op() const { return op_; }
1254  LOperand* left() { return inputs_[0]; }
1255  LOperand* right() { return inputs_[1]; }
1256 
1257  virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
1258  virtual void CompileToNative(LCodeGen* generator);
1259  virtual const char* Mnemonic() const;
1260 
1261  private:
1262  Token::Value op_;
1263 };
1264 
1265 
1266 class LReturn: public LTemplateInstruction<0, 1, 0> {
1267  public:
1268  explicit LReturn(LOperand* value) {
1269  inputs_[0] = value;
1270  }
1271 
1272  LOperand* value() { return inputs_[0]; }
1273 
1274  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1275 };
1276 
1277 
1278 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
1279  public:
1280  explicit LLoadNamedField(LOperand* object) {
1281  inputs_[0] = object;
1282  }
1283 
1284  LOperand* object() { return inputs_[0]; }
1285 
1286  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1287  DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1288 };
1289 
1290 
1291 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
1292  public:
1294  inputs_[0] = object;
1295  }
1296 
1297  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
1298  DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
1299 
1300  LOperand* object() { return inputs_[0]; }
1301 };
1302 
1303 
1304 class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
1305  public:
1306  explicit LLoadNamedGeneric(LOperand* object) {
1307  inputs_[0] = object;
1308  }
1309 
1310  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1311  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1312 
1313  LOperand* object() { return inputs_[0]; }
1314  Handle<Object> name() const { return hydrogen()->name(); }
1315 };
1316 
1317 
1318 class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> {
1319  public:
1320  explicit LLoadFunctionPrototype(LOperand* function) {
1321  inputs_[0] = function;
1322  }
1323 
1324  DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1325  DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1326 
1327  LOperand* function() { return inputs_[0]; }
1328 };
1329 
1330 
1331 class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1332  public:
1333  explicit LLoadElements(LOperand* object) {
1334  inputs_[0] = object;
1335  }
1336 
1337  LOperand* object() { return inputs_[0]; }
1338 
1339  DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1340 };
1341 
1342 
1343 class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1344  public:
1346  inputs_[0] = object;
1347  }
1348 
1349  LOperand* object() { return inputs_[0]; }
1350 
1351  DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1352  "load-external-array-pointer")
1353 };
1354 
1355 
1356 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1357  public:
1359  inputs_[0] = elements;
1360  inputs_[1] = key;
1361  }
1362 
1363  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1364  DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1365 
1366  LOperand* elements() { return inputs_[0]; }
1367  LOperand* key() { return inputs_[1]; }
1368  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1369 };
1370 
1371 
1372 class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> {
1373  public:
1375  inputs_[0] = elements;
1376  inputs_[1] = key;
1377  }
1378 
1379  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement,
1380  "load-keyed-fast-double-element")
1381  DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement)
1382 
1383  LOperand* elements() { return inputs_[0]; }
1384  LOperand* key() { return inputs_[1]; }
1385  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1386 };
1387 
1388 
1389 class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
1390  public:
1392  inputs_[0] = external_pointer;
1393  inputs_[1] = key;
1394  }
1395 
1396  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
1397  "load-keyed-specialized-array-element")
1398  DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement)
1399 
1400  LOperand* external_pointer() { return inputs_[0]; }
1401  LOperand* key() { return inputs_[1]; }
1402  ElementsKind elements_kind() const {
1403  return hydrogen()->elements_kind();
1404  }
1405  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1406 };
1407 
1408 
1409 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
1410  public:
1412  inputs_[0] = obj;
1413  inputs_[1] = key;
1414  }
1415 
1416  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1417 
1418  LOperand* object() { return inputs_[0]; }
1419  LOperand* key() { return inputs_[1]; }
1420 };
1421 
1422 
1423 class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> {
1424  public:
1425  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1426  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1427 };
1428 
1429 
1430 class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> {
1431  public:
1432  explicit LLoadGlobalGeneric(LOperand* global_object) {
1433  inputs_[0] = global_object;
1434  }
1435 
1436  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1437  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1438 
1439  LOperand* global_object() { return inputs_[0]; }
1440  Handle<Object> name() const { return hydrogen()->name(); }
1441  bool for_typeof() const { return hydrogen()->for_typeof(); }
1442 };
1443 
1444 
1445 class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
1446  public:
1447  explicit LStoreGlobalCell(LOperand* value, LOperand* temp) {
1448  inputs_[0] = value;
1449  temps_[0] = temp;
1450  }
1451 
1452  LOperand* value() { return inputs_[0]; }
1453  LOperand* temp() { return temps_[0]; }
1454 
1455  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1456  DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
1457 };
1458 
1459 
1460 class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
1461  public:
1462  explicit LStoreGlobalGeneric(LOperand* global_object,
1463  LOperand* value) {
1464  inputs_[0] = global_object;
1465  inputs_[1] = value;
1466  }
1467 
1468  LOperand* global_object() { return inputs_[0]; }
1469  LOperand* value() { return inputs_[1]; }
1470 
1471  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1472  DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
1473 
1474  Handle<Object> name() const { return hydrogen()->name(); }
1475  StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1476 };
1477 
1478 
1479 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1480  public:
1481  explicit LLoadContextSlot(LOperand* context) {
1482  inputs_[0] = context;
1483  }
1484 
1485  LOperand* context() { return inputs_[0]; }
1486 
1487  DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1488  DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1489 
1490  int slot_index() { return hydrogen()->slot_index(); }
1491 
1492  virtual void PrintDataTo(StringStream* stream);
1493 };
1494 
1495 
1496 class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
1497  public:
1498  LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1499  inputs_[0] = context;
1500  inputs_[1] = value;
1501  temps_[0] = temp;
1502  }
1503 
1504  LOperand* context() { return inputs_[0]; }
1505  LOperand* value() { return inputs_[1]; }
1506  LOperand* temp() { return temps_[0]; }
1507 
1508  DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1509  DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1510 
1511  int slot_index() { return hydrogen()->slot_index(); }
1512 
1513  virtual void PrintDataTo(StringStream* stream);
1514 };
1515 
1516 
1517 class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1518  public:
1519  explicit LPushArgument(LOperand* value) {
1520  inputs_[0] = value;
1521  }
1522 
1523  LOperand* value() { return inputs_[0]; }
1524 
1525  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1526 };
1527 
1528 
1529 class LDrop: public LTemplateInstruction<0, 0, 0> {
1530  public:
1531  explicit LDrop(int count) : count_(count) { }
1532 
1533  int count() const { return count_; }
1534 
1535  DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
1536 
1537  private:
1538  int count_;
1539 };
1540 
1541 
1542 class LThisFunction: public LTemplateInstruction<1, 0, 0> {
1543  public:
1544  DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1546 };
1547 
1548 
1549 class LContext: public LTemplateInstruction<1, 0, 0> {
1550  public:
1552 };
1553 
1554 
1555 class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1556  public:
1557  explicit LOuterContext(LOperand* context) {
1558  inputs_[0] = context;
1559  }
1560 
1561  LOperand* context() { return inputs_[0]; }
1562 
1563  DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1564 };
1565 
1566 
1567 class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> {
1568  public:
1569  DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1570  DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1571 };
1572 
1573 
1574 class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
1575  public:
1576  DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1577 };
1578 
1579 
1580 class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1581  public:
1582  explicit LGlobalReceiver(LOperand* global_object) {
1583  inputs_[0] = global_object;
1584  }
1585 
1586  LOperand* global() { return inputs_[0]; }
1587 
1588  DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1589 };
1590 
1591 
1592 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1593  public:
1594  DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1595  DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1596 
1597  virtual void PrintDataTo(StringStream* stream);
1598 
1599  Handle<JSFunction> function() { return hydrogen()->function(); }
1600  int arity() const { return hydrogen()->argument_count() - 1; }
1601 };
1602 
1603 
1604 class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
1605  public:
1606  explicit LInvokeFunction(LOperand* function) {
1607  inputs_[0] = function;
1608  }
1609 
1610  LOperand* function() { return inputs_[0]; }
1611 
1612  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1613  DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1614 
1615  virtual void PrintDataTo(StringStream* stream);
1616 
1617  int arity() const { return hydrogen()->argument_count() - 1; }
1618  Handle<JSFunction> known_function() { return hydrogen()->known_function(); }
1619 };
1620 
1621 
1622 class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
1623  public:
1624  explicit LCallKeyed(LOperand* key) {
1625  inputs_[0] = key;
1626  }
1627 
1628  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1629  DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1630 
1631  LOperand* key() { return inputs_[0]; }
1632 
1633  virtual void PrintDataTo(StringStream* stream);
1634 
1635  int arity() const { return hydrogen()->argument_count() - 1; }
1636 };
1637 
1638 
1639 class LCallNamed: public LTemplateInstruction<1, 0, 0> {
1640  public:
1641  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1642  DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1643 
1644  virtual void PrintDataTo(StringStream* stream);
1645 
1646  Handle<String> name() const { return hydrogen()->name(); }
1647  int arity() const { return hydrogen()->argument_count() - 1; }
1648 };
1649 
1650 
1651 class LCallFunction: public LTemplateInstruction<1, 1, 0> {
1652  public:
1653  explicit LCallFunction(LOperand* function) {
1654  inputs_[0] = function;
1655  }
1656 
1657  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1658  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1659 
1660  LOperand* function() { return inputs_[0]; }
1661  int arity() const { return hydrogen()->argument_count() - 1; }
1662 };
1663 
1664 
1665 class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
1666  public:
1667  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1668  DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1669 
1670  virtual void PrintDataTo(StringStream* stream);
1671 
1672  Handle<String> name() const {return hydrogen()->name(); }
1673  int arity() const { return hydrogen()->argument_count() - 1; }
1674 };
1675 
1676 
1677 class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
1678  public:
1679  DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1680  DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1681 
1682  virtual void PrintDataTo(StringStream* stream);
1683 
1684  Handle<JSFunction> target() const { return hydrogen()->target(); }
1685  int arity() const { return hydrogen()->argument_count() - 1; }
1686 };
1687 
1688 
1689 class LCallNew: public LTemplateInstruction<1, 1, 0> {
1690  public:
1691  explicit LCallNew(LOperand* constructor) {
1692  inputs_[0] = constructor;
1693  }
1694 
1695  LOperand* constructor() { return inputs_[0]; }
1696 
1699 
1700  virtual void PrintDataTo(StringStream* stream);
1701 
1702  int arity() const { return hydrogen()->argument_count() - 1; }
1703 };
1704 
1705 
1706 class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1707  public:
1708  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1709  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1710 
1711  const Runtime::Function* function() const { return hydrogen()->function(); }
1712  int arity() const { return hydrogen()->argument_count(); }
1713 };
1714 
1715 
1716 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1717  public:
1718  explicit LInteger32ToDouble(LOperand* value) {
1719  inputs_[0] = value;
1720  }
1721 
1722  LOperand* value() { return inputs_[0]; }
1723 
1724  DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1725 };
1726 
1727 
1728 class LUint32ToDouble: public LTemplateInstruction<1, 1, 1> {
1729  public:
1730  explicit LUint32ToDouble(LOperand* value, LOperand* temp) {
1731  inputs_[0] = value;
1732  temps_[0] = temp;
1733  }
1734 
1735  LOperand* value() { return inputs_[0]; }
1736  LOperand* temp() { return temps_[0]; }
1737 
1738  DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
1739 };
1740 
1741 
1742 class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1743  public:
1744  explicit LNumberTagI(LOperand* value) {
1745  inputs_[0] = value;
1746  }
1747 
1748  LOperand* value() { return inputs_[0]; }
1749 
1750  DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1751 };
1752 
1753 
1754 class LNumberTagU: public LTemplateInstruction<1, 1, 1> {
1755  public:
1756  explicit LNumberTagU(LOperand* value, LOperand* temp) {
1757  inputs_[0] = value;
1758  temps_[0] = temp;
1759  }
1760 
1761  LOperand* value() { return inputs_[0]; }
1762  LOperand* temp() { return temps_[0]; }
1763 
1764  DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
1765 };
1766 
1767 
1768 class LNumberTagD: public LTemplateInstruction<1, 1, 1> {
1769  public:
1770  explicit LNumberTagD(LOperand* value, LOperand* temp) {
1771  inputs_[0] = value;
1772  temps_[0] = temp;
1773  }
1774 
1775  LOperand* value() { return inputs_[0]; }
1776  LOperand* temp() { return temps_[0]; }
1777 
1778  DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1779 };
1780 
1781 
1782 // Sometimes truncating conversion from a tagged value to an int32.
1783 class LDoubleToI: public LTemplateInstruction<1, 1, 0> {
1784  public:
1785  explicit LDoubleToI(LOperand* value) {
1786  inputs_[0] = value;
1787  }
1788 
1789  LOperand* value() { return inputs_[0]; }
1790 
1791  DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1793 
1794  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1795 };
1796 
1797 
1798 // Truncating conversion from a tagged value to an int32.
1799 class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
1800  public:
1801  LTaggedToI(LOperand* value, LOperand* temp) {
1802  inputs_[0] = value;
1803  temps_[0] = temp;
1804  }
1805 
1806  LOperand* value() { return inputs_[0]; }
1807  LOperand* temp() { return temps_[0]; }
1808 
1809  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1811 
1812  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1813 };
1814 
1815 
1816 class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1817  public:
1818  explicit LSmiTag(LOperand* value) {
1819  inputs_[0] = value;
1820  }
1821 
1822  LOperand* value() { return inputs_[0]; }
1823 
1824  DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1825 };
1826 
1827 
1828 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1829  public:
1830  explicit LNumberUntagD(LOperand* value) {
1831  inputs_[0] = value;
1832  }
1833 
1834  LOperand* value() { return inputs_[0]; }
1835 
1836  DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1837  DECLARE_HYDROGEN_ACCESSOR(Change);
1838 };
1839 
1840 
1841 class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1842  public:
1843  LSmiUntag(LOperand* value, bool needs_check)
1844  : needs_check_(needs_check) {
1845  inputs_[0] = value;
1846  }
1847 
1848  LOperand* value() { return inputs_[0]; }
1849  bool needs_check() const { return needs_check_; }
1850 
1851  DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1852 
1853  private:
1854  bool needs_check_;
1855 };
1856 
1857 
1858 class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
1859  public:
1860  LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
1861  inputs_[0] = object;
1862  inputs_[1] = value;
1863  temps_[0] = temp;
1864  }
1865 
1866  LOperand* object() { return inputs_[0]; }
1867  LOperand* value() { return inputs_[1]; }
1868  LOperand* temp() { return temps_[0]; }
1869 
1870  DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1871  DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1872 
1873  virtual void PrintDataTo(StringStream* stream);
1874 
1875  Handle<Object> name() const { return hydrogen()->name(); }
1876  bool is_in_object() { return hydrogen()->is_in_object(); }
1877  int offset() { return hydrogen()->offset(); }
1878  Handle<Map> transition() const { return hydrogen()->transition(); }
1879 };
1880 
1881 
1882 class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
1883  public:
1885  inputs_[0] = object;
1886  inputs_[1] = value;
1887  }
1888 
1889  LOperand* object() { return inputs_[0]; }
1890  LOperand* value() { return inputs_[1]; }
1891 
1892  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1893  DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1894 
1895  virtual void PrintDataTo(StringStream* stream);
1896 
1897  Handle<Object> name() const { return hydrogen()->name(); }
1898  StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1899 };
1900 
1901 
1902 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1903  public:
1905  inputs_[0] = object;
1906  inputs_[1] = key;
1907  inputs_[2] = value;
1908  }
1909 
1910  LOperand* object() { return inputs_[0]; }
1911  LOperand* key() { return inputs_[1]; }
1912  LOperand* value() { return inputs_[2]; }
1913 
1914  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1915  "store-keyed-fast-element")
1916  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1917 
1918  virtual void PrintDataTo(StringStream* stream);
1919 
1920  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1921 };
1922 
1923 
1924 class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
1925  public:
1927  LOperand* key,
1928  LOperand* value) {
1929  inputs_[0] = elements;
1930  inputs_[1] = key;
1931  inputs_[2] = value;
1932  }
1933 
1934  LOperand* elements() { return inputs_[0]; }
1935  LOperand* key() { return inputs_[1]; }
1936  LOperand* value() { return inputs_[2]; }
1937 
1938  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement,
1939  "store-keyed-fast-double-element")
1940  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement)
1941 
1942  virtual void PrintDataTo(StringStream* stream);
1943 
1944  bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
1945  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1946 };
1947 
1948 
1949 class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1950  public:
1952  LOperand* key,
1953  LOperand* value) {
1954  inputs_[0] = external_pointer;
1955  inputs_[1] = key;
1956  inputs_[2] = value;
1957  }
1958 
1960  LOperand* key() { return inputs_[1]; }
1961  LOperand* value() { return inputs_[2]; }
1962 
1963  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1964  "store-keyed-specialized-array-element")
1965  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1966 
1967  ElementsKind elements_kind() const { return hydrogen()->elements_kind(); }
1968  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1969 };
1970 
1971 
1972 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
1973  public:
1975  inputs_[0] = object;
1976  inputs_[1] = key;
1977  inputs_[2] = value;
1978  }
1979 
1980  LOperand* object() { return inputs_[0]; }
1981  LOperand* key() { return inputs_[1]; }
1982  LOperand* value() { return inputs_[2]; }
1983 
1984  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1985  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
1986 
1987  virtual void PrintDataTo(StringStream* stream);
1988 
1989  StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1990 };
1991 
1992 
1993 class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> {
1994  public:
1996  LOperand* new_map_temp,
1997  LOperand* temp) {
1998  inputs_[0] = object;
1999  temps_[0] = new_map_temp;
2000  temps_[1] = temp;
2001  }
2002 
2003  LOperand* object() { return inputs_[0]; }
2004  LOperand* new_map_temp() { return temps_[0]; }
2005  LOperand* temp() { return temps_[1]; }
2006 
2007  DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2008  "transition-elements-kind")
2009  DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2010 
2011  virtual void PrintDataTo(StringStream* stream);
2012 
2013  Handle<Map> original_map() { return hydrogen()->original_map(); }
2014  Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
2015 };
2016 
2017 
2018 class LStringAdd: public LTemplateInstruction<1, 2, 0> {
2019  public:
2020  LStringAdd(LOperand* left, LOperand* right) {
2021  inputs_[0] = left;
2022  inputs_[1] = right;
2023  }
2024 
2025  LOperand* left() { return inputs_[0]; }
2026  LOperand* right() { return inputs_[1]; }
2027 
2028  DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2029  DECLARE_HYDROGEN_ACCESSOR(StringAdd)
2030 };
2031 
2032 
2033 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
2034  public:
2036  inputs_[0] = string;
2037  inputs_[1] = index;
2038  }
2039 
2040  LOperand* string() { return inputs_[0]; }
2041  LOperand* index() { return inputs_[1]; }
2042 
2043  DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2044  DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2045 };
2046 
2047 
2048 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
2049  public:
2050  explicit LStringCharFromCode(LOperand* char_code) {
2051  inputs_[0] = char_code;
2052  }
2053 
2054  LOperand* char_code() { return inputs_[0]; }
2055 
2056  DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2057  DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
2058 };
2059 
2060 
2061 class LStringLength: public LTemplateInstruction<1, 1, 0> {
2062  public:
2063  explicit LStringLength(LOperand* string) {
2064  inputs_[0] = string;
2065  }
2066 
2067  LOperand* string() { return inputs_[0]; }
2068 
2069  DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
2070  DECLARE_HYDROGEN_ACCESSOR(StringLength)
2071 };
2072 
2073 
2074 class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
2075  public:
2076  explicit LCheckFunction(LOperand* value) {
2077  inputs_[0] = value;
2078  }
2079 
2080  LOperand* value() { return inputs_[0]; }
2081 
2082  DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
2083  DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
2084 };
2085 
2086 
2087 class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
2088  public:
2089  explicit LCheckInstanceType(LOperand* value) {
2090  inputs_[0] = value;
2091  }
2092 
2093  LOperand* value() { return inputs_[0]; }
2094 
2095  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
2096  DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
2097 };
2098 
2099 
2100 class LCheckMaps: public LTemplateInstruction<0, 1, 0> {
2101  public:
2102  explicit LCheckMaps(LOperand* value) {
2103  inputs_[0] = value;
2104  }
2105 
2106  LOperand* value() { return inputs_[0]; }
2107 
2108  DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
2109  DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
2110 };
2111 
2112 
2113 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> {
2114  public:
2115  explicit LCheckPrototypeMaps(LOperand* temp) {
2116  temps_[0] = temp;
2117  }
2118 
2119  LOperand* temp() { return temps_[0]; }
2120 
2121  DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
2122  DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
2123 
2124  Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
2125  Handle<JSObject> holder() const { return hydrogen()->holder(); }
2126 };
2127 
2128 
2129 class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
2130  public:
2131  explicit LCheckSmi(LOperand* value) {
2132  inputs_[0] = value;
2133  }
2134 
2135  LOperand* value() { return inputs_[0]; }
2136 
2137  DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
2138 };
2139 
2140 
2141 class LClampDToUint8: public LTemplateInstruction<1, 1, 0> {
2142  public:
2143  explicit LClampDToUint8(LOperand* unclamped) {
2144  inputs_[0] = unclamped;
2145  }
2146 
2147  LOperand* unclamped() { return inputs_[0]; }
2148 
2149  DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
2150 };
2151 
2152 
2153 class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
2154  public:
2155  explicit LClampIToUint8(LOperand* unclamped) {
2156  inputs_[0] = unclamped;
2157  }
2158 
2159  LOperand* unclamped() { return inputs_[0]; }
2160 
2161  DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
2162 };
2163 
2164 
2165 class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
2166  public:
2168  LOperand* temp_xmm) {
2169  inputs_[0] = unclamped;
2170  temps_[0] = temp_xmm;
2171  }
2172 
2173  LOperand* unclamped() { return inputs_[0]; }
2174  LOperand* temp_xmm() { return temps_[0]; }
2175 
2176  DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2177 };
2178 
2179 
2180 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
2181  public:
2182  explicit LCheckNonSmi(LOperand* value) {
2183  inputs_[0] = value;
2184  }
2185 
2186  LOperand* value() { return inputs_[0]; }
2187 
2188  DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2189 };
2190 
2191 
2192 class LAllocateObject: public LTemplateInstruction<1, 0, 1> {
2193  public:
2194  explicit LAllocateObject(LOperand* temp) {
2195  temps_[0] = temp;
2196  }
2197 
2198  LOperand* temp() { return temps_[0]; }
2199 
2200  DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object")
2201  DECLARE_HYDROGEN_ACCESSOR(AllocateObject)
2202 };
2203 
2204 
2205 class LFastLiteral: public LTemplateInstruction<1, 0, 0> {
2206  public:
2207  DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal")
2208  DECLARE_HYDROGEN_ACCESSOR(FastLiteral)
2209 };
2210 
2211 
2212 class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
2213  public:
2214  DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
2216 };
2217 
2218 
2219 class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
2220  public:
2221  DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
2223 };
2224 
2225 
2226 class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
2227  public:
2228  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2230 };
2231 
2232 
2233 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
2234  public:
2235  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
2237 
2238  Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
2239 };
2240 
2241 
2242 class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
2243  public:
2244  explicit LToFastProperties(LOperand* value) {
2245  inputs_[0] = value;
2246  }
2247 
2248  LOperand* value() { return inputs_[0]; }
2249 
2250  DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2251  DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2252 };
2253 
2254 
2255 class LTypeof: public LTemplateInstruction<1, 1, 0> {
2256  public:
2257  explicit LTypeof(LOperand* value) {
2258  inputs_[0] = value;
2259  }
2260 
2261  LOperand* value() { return inputs_[0]; }
2262 
2263  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2264 };
2265 
2266 
2267 class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
2268  public:
2269  explicit LTypeofIsAndBranch(LOperand* value) {
2270  inputs_[0] = value;
2271  }
2272 
2273  LOperand* value() { return inputs_[0]; }
2274 
2275  DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2276  DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2277 
2278  Handle<String> type_literal() { return hydrogen()->type_literal(); }
2279 
2280  virtual void PrintDataTo(StringStream* stream);
2281 };
2282 
2283 
2284 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
2285  public:
2287  temps_[0] = temp;
2288  }
2289 
2290  LOperand* temp() { return temps_[0]; }
2291 
2292  DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2293  "is-construct-call-and-branch")
2294  DECLARE_HYDROGEN_ACCESSOR(IsConstructCallAndBranch)
2295 };
2296 
2297 
2298 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
2299  public:
2301  inputs_[0] = obj;
2302  inputs_[1] = key;
2303  }
2304 
2305  LOperand* object() { return inputs_[0]; }
2306  LOperand* key() { return inputs_[1]; }
2307 
2308  DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2309 };
2310 
2311 
2312 class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2313  public:
2314  LOsrEntry();
2315 
2316  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2317 
2318  LOperand** SpilledRegisterArray() { return register_spills_; }
2319  LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
2320 
2321  void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
2322  void MarkSpilledDoubleRegister(int allocation_index,
2323  LOperand* spill_operand);
2324 
2325  private:
2326  // Arrays of spill slot operands for registers with an assigned spill
2327  // slot, i.e., that must also be restored to the spill slot on OSR entry.
2328  // NULL if the register has no assigned spill slot. Indexed by allocation
2329  // index.
2330  LOperand* register_spills_[Register::kNumAllocatableRegisters];
2331  LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
2332 };
2333 
2334 
2335 class LStackCheck: public LTemplateInstruction<0, 0, 0> {
2336  public:
2337  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2338  DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2339 
2340  Label* done_label() { return &done_label_; }
2341 
2342  private:
2343  Label done_label_;
2344 };
2345 
2346 
2347 class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
2348  public:
2349  explicit LForInPrepareMap(LOperand* object) {
2350  inputs_[0] = object;
2351  }
2352 
2353  LOperand* object() { return inputs_[0]; }
2354 
2355  DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2356 };
2357 
2358 
2359 class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
2360  public:
2361  explicit LForInCacheArray(LOperand* map) {
2362  inputs_[0] = map;
2363  }
2364 
2365  LOperand* map() { return inputs_[0]; }
2366 
2367  DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2368 
2369  int idx() {
2370  return HForInCacheArray::cast(this->hydrogen_value())->idx();
2371  }
2372 };
2373 
2374 
2375 class LCheckMapValue: public LTemplateInstruction<0, 2, 0> {
2376  public:
2378  inputs_[0] = value;
2379  inputs_[1] = map;
2380  }
2381 
2382  LOperand* value() { return inputs_[0]; }
2383  LOperand* map() { return inputs_[1]; }
2384 
2385  DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2386 };
2387 
2388 
2389 class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> {
2390  public:
2392  inputs_[0] = object;
2393  inputs_[1] = index;
2394  }
2395 
2396  LOperand* object() { return inputs_[0]; }
2397  LOperand* index() { return inputs_[1]; }
2398 
2399  DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2400 };
2401 
2402 
2403 class LChunkBuilder;
2404 class LPlatformChunk: public LChunk {
2405  public:
2407  : LChunk(info, graph) { }
2408 
2409  int GetNextSpillIndex(bool is_double);
2410  LOperand* GetNextSpillSlot(bool is_double);
2411 };
2412 
2413 
2414 class LChunkBuilder BASE_EMBEDDED {
2415  public:
2416  LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2417  : chunk_(NULL),
2418  info_(info),
2419  graph_(graph),
2420  zone_(graph->zone()),
2421  status_(UNUSED),
2422  current_instruction_(NULL),
2423  current_block_(NULL),
2424  next_block_(NULL),
2425  argument_count_(0),
2426  allocator_(allocator),
2427  position_(RelocInfo::kNoPosition),
2428  instruction_pending_deoptimization_environment_(NULL),
2429  pending_deoptimization_ast_id_(BailoutId::None()) { }
2430 
2431  // Build the sequence for the graph.
2432  LPlatformChunk* Build();
2433 
2434  // Declare methods that deal with the individual node types.
2435 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2437 #undef DECLARE_DO
2438 
2439  static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
2440  static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
2441 
2442  private:
2443  enum Status {
2444  UNUSED,
2445  BUILDING,
2446  DONE,
2447  ABORTED
2448  };
2449 
2450  LPlatformChunk* chunk() const { return chunk_; }
2451  CompilationInfo* info() const { return info_; }
2452  HGraph* graph() const { return graph_; }
2453  Zone* zone() const { return zone_; }
2454 
2455  bool is_unused() const { return status_ == UNUSED; }
2456  bool is_building() const { return status_ == BUILDING; }
2457  bool is_done() const { return status_ == DONE; }
2458  bool is_aborted() const { return status_ == ABORTED; }
2459 
2460  void Abort(const char* reason);
2461 
2462  // Methods for getting operands for Use / Define / Temp.
2463  LUnallocated* ToUnallocated(Register reg);
2464  LUnallocated* ToUnallocated(XMMRegister reg);
2465 
2466  // Methods for setting up define-use relationships.
2467  MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2468  MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2469  MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2470  XMMRegister fixed_register);
2471 
2472  // A value that is guaranteed to be allocated to a register.
2473  // Operand created by UseRegister is guaranteed to be live until the end of
2474  // instruction. This means that register allocator will not reuse it's
2475  // register for any other operand inside instruction.
2476  // Operand created by UseRegisterAtStart is guaranteed to be live only at
2477  // instruction start. Register allocator is free to assign the same register
2478  // to some other operand used inside instruction (i.e. temporary or
2479  // output).
2480  MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2481  MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2482 
2483  // An input operand in a register that may be trashed.
2484  MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2485 
2486  // An input operand in a register or stack slot.
2487  MUST_USE_RESULT LOperand* Use(HValue* value);
2488  MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2489 
2490  // An input operand in a register, stack slot or a constant operand.
2491  MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2492  MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2493 
2494  // An input operand in a register or a constant operand.
2495  MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2496  MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2497 
2498  // An input operand in register, stack slot or a constant operand.
2499  // Will not be moved to a register even if one is freely available.
2500  MUST_USE_RESULT LOperand* UseAny(HValue* value);
2501 
2502  // Temporary operand that must be in a register.
2503  MUST_USE_RESULT LUnallocated* TempRegister();
2504  MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2505  MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2506 
2507  // Methods for setting up define-use relationships.
2508  // Return the same instruction that they are passed.
2509  template<int I, int T>
2510  LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
2511  LUnallocated* result);
2512  template<int I, int T>
2513  LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
2514  template<int I, int T>
2515  LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
2516  int index);
2517  template<int I, int T>
2518  LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
2519  template<int I, int T>
2520  LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2521  Register reg);
2522  template<int I, int T>
2523  LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2524  XMMRegister reg);
2525  // Assigns an environment to an instruction. An instruction which can
2526  // deoptimize must have an environment.
2527  LInstruction* AssignEnvironment(LInstruction* instr);
2528  // Assigns a pointer map to an instruction. An instruction which can
2529  // trigger a GC or a lazy deoptimization must have a pointer map.
2530  LInstruction* AssignPointerMap(LInstruction* instr);
2531 
2532  enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2533 
2534  // Marks a call for the register allocator. Assigns a pointer map to
2535  // support GC and lazy deoptimization. Assigns an environment to support
2536  // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY.
2538  LInstruction* instr,
2539  HInstruction* hinstr,
2540  CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2541 
2542  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env,
2543  int* argument_index_accumulator);
2544 
2545  void VisitInstruction(HInstruction* current);
2546 
2547  void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2548  LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2549  LInstruction* DoArithmeticD(Token::Value op,
2550  HArithmeticBinaryOperation* instr);
2551  LInstruction* DoArithmeticT(Token::Value op,
2552  HArithmeticBinaryOperation* instr);
2553 
2554  LPlatformChunk* chunk_;
2555  CompilationInfo* info_;
2556  HGraph* const graph_;
2557  Zone* zone_;
2558  Status status_;
2559  HInstruction* current_instruction_;
2560  HBasicBlock* current_block_;
2561  HBasicBlock* next_block_;
2562  int argument_count_;
2563  LAllocator* allocator_;
2564  int position_;
2565  LInstruction* instruction_pending_deoptimization_environment_;
2566  BailoutId pending_deoptimization_ast_id_;
2567 
2568  DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2569 };
2570 
2571 #undef DECLARE_HYDROGEN_ACCESSOR
2572 #undef DECLARE_CONCRETE_INSTRUCTION
2573 
2574 } } // namespace v8::int
2575 
2576 #endif // V8_X64_LITHIUM_X64_H_
LCmpT(LOperand *left, LOperand *right)
Definition: lithium-x64.h:851
LStringCharCodeAt(LOperand *string, LOperand *index)
Definition: lithium-x64.h:2035
LArgumentsLength(LOperand *elements)
Definition: lithium-x64.h:527
LLoadContextSlot(LOperand *context)
Definition: lithium-x64.h:1481
LDoubleToI(LOperand *value)
Definition: lithium-x64.h:1785
LOperand * temp()
Definition: lithium-x64.h:571
LGlobalReceiver(LOperand *global_object)
Definition: lithium-x64.h:1582
static LGap * cast(LInstruction *instr)
Definition: lithium-x64.h:329
virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment *env)
Definition: lithium-x64.h:257
LLoadFieldByIndex(LOperand *object, LOperand *index)
Definition: lithium-x64.h:2391
LGetCachedArrayIndex(LOperand *value)
Definition: lithium-x64.h:802
LCallKeyed(LOperand *key)
Definition: lithium-x64.h:1624
void set_pointer_map(LPointerMap *p)
Definition: lithium-x64.h:248
LThrow(LOperand *value)
Definition: lithium-x64.h:1144
bool IsMarkedAsCall() const
Definition: lithium-x64.h:260
int count() const
Definition: lithium-x64.h:1533
LStoreKeyedFastDoubleElement(LOperand *elements, LOperand *key, LOperand *value)
Definition: lithium-x64.h:1926
LOperand * left()
Definition: lithium-x64.h:604
void set_environment(LEnvironment *env)
Definition: lithium-x64.h:244
void set_result(LOperand *operand)
Definition: lithium-x64.h:298
LReturn(LOperand *value)
Definition: lithium-x64.h:1268
virtual void PrintOutputOperandTo(StringStream *stream)
Definition: lithium-arm.cc:120
LOperand * right()
Definition: lithium-x64.h:553
EmbeddedContainer< LOperand *, T > temps_
Definition: lithium-arm.h:303
LStoreContextSlot(LOperand *context, LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1498
LSmiTag(LOperand *value)
Definition: lithium-x64.h:1818
Definition: v8.h:869
Token::Value op() const
Definition: lithium-x64.h:1232
LAllocateObject(LOperand *temp)
Definition: lithium-x64.h:2194
LWrapReceiver(LOperand *receiver, LOperand *function)
Definition: lithium-x64.h:474
LParallelMove * GetOrCreateParallelMove(InnerPosition pos, Zone *zone)
Definition: lithium-x64.h:347
LConstantD(LOperand *temp)
Definition: lithium-x64.h:1000
LNumberTagI(LOperand *value)
Definition: lithium-x64.h:1744
#define DECLARE_OPCODE(type)
Definition: lithium-x64.h:224
LOperand * right()
Definition: lithium-x64.h:570
LInstructionGap(HBasicBlock *block)
Definition: lithium-x64.h:367
LDateField(LOperand *date, Smi *index)
Definition: lithium-x64.h:1127
LClampTToUint8(LOperand *unclamped, LOperand *temp_xmm)
Definition: lithium-x64.h:2167
LLoadGlobalGeneric(LOperand *global_object)
Definition: lithium-x64.h:1432
LOperand * left()
Definition: lithium-x64.h:943
LCheckSmi(LOperand *value)
Definition: lithium-x64.h:2131
LLoadFunctionPrototype(LOperand *function)
Definition: lithium-x64.h:1320
LStringLength(LOperand *string)
Definition: lithium-x64.h:2063
LOperand * right()
Definition: lithium-x64.h:963
Handle< Object > name() const
Definition: lithium-x64.h:1314
LLabel(HBasicBlock *block)
Definition: lithium-x64.h:412
LJSArrayLength(LOperand *value)
Definition: lithium-x64.h:1062
LOperand * right()
Definition: lithium-x64.h:1174
LClampIToUint8(LOperand *unclamped)
Definition: lithium-x64.h:2155
LChunkBuilder(CompilationInfo *info, HGraph *graph, LAllocator *allocator)
Definition: lithium-x64.h:2416
int int32_t
Definition: unicode.cc:47
LTransitionElementsKind(LOperand *object, LOperand *new_map_temp, LOperand *temp)
Definition: lithium-x64.h:1995
LMathFloorOfDiv(LOperand *left, LOperand *right, LOperand *temp=NULL)
Definition: lithium-x64.h:580
LOuterContext(LOperand *context)
Definition: lithium-x64.h:1557
static const int kNumAllocatableRegisters
Handle< Map > transition() const
Definition: lithium-x64.h:1878
EqualityKind
Definition: v8.h:145
LOperand * constructor()
Definition: lithium-x64.h:1695
LEnvironment * environment() const
Definition: lithium-x64.h:245
LOperand * right()
Definition: lithium-x64.h:1204
LValueOf(LOperand *value)
Definition: lithium-x64.h:1114
virtual HBasicBlock * SuccessorAt(int i)=0
LCheckNonSmi(LOperand *value)
Definition: lithium-x64.h:2182
#define ASSERT(condition)
Definition: checks.h:270
#define DECLARE_DO(type)
Definition: lithium-x64.h:2435
LOperand * right()
Definition: lithium-x64.h:982
Token::Value op() const
Definition: lithium-x64.h:961
LBoundsCheck(LOperand *index, LOperand *length)
Definition: lithium-x64.h:923
virtual const char * Mnemonic() const =0
LClassOfTestAndBranch(LOperand *value, LOperand *temp, LOperand *temp2)
Definition: lithium-x64.h:831
LCheckInstanceType(LOperand *value)
Definition: lithium-x64.h:2089
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:111
LModI(LOperand *left, LOperand *right, LOperand *temp)
Definition: lithium-x64.h:546
#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
Definition: lithium-x64.h:49
LStoreKeyedFastElement(LOperand *object, LOperand *key, LOperand *value)
Definition: lithium-x64.h:1904
LInvokeFunction(LOperand *function)
Definition: lithium-x64.h:1606
bool needs_check() const
Definition: lithium-x64.h:1849
LStoreKeyedGeneric(LOperand *object, LOperand *key, LOperand *value)
Definition: lithium-x64.h:1974
LUint32ToDouble(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1730
LNumberTagD(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1770
LBranch(LOperand *value)
Definition: lithium-x64.h:1024
LNumberUntagD(LOperand *value)
Definition: lithium-x64.h:1830
LIsNilAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:681
#define DECLARE_PREDICATE(type)
Definition: lithium-x64.h:233
LForInPrepareMap(LOperand *object)
Definition: lithium-x64.h:2349
void set_hydrogen_value(HValue *value)
Definition: lithium-x64.h:252
LLoadNamedField(LOperand *object)
Definition: lithium-x64.h:1280
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
LPower(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1198
LOperand * left()
Definition: lithium-x64.h:856
virtual bool HasResult() const =0
bool can_deopt() const
Definition: lithium-x64.h:964
Handle< JSObject > holder() const
Definition: lithium-x64.h:2125
Token::Value op() const
Definition: lithium-x64.h:946
virtual Opcode opcode() const =0
Handle< Object > name() const
Definition: lithium-x64.h:1440
Handle< Map > map() const
Definition: lithium-x64.h:1050
#define MUST_USE_RESULT
Definition: globals.h:346
EmbeddedContainer< LOperand *, R > results_
Definition: lithium-arm.h:301
LLabel * replacement() const
Definition: lithium-x64.h:422
LDeleteProperty(LOperand *obj, LOperand *key)
Definition: lithium-x64.h:2300
LDivI(LOperand *left, LOperand *right, LOperand *temp)
Definition: lithium-x64.h:563
Handle< JSFunction > known_function()
Definition: lithium-x64.h:1618
LAddI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1168
LOperand * left()
Definition: lithium-x64.h:981
bool is_loop_header() const
Definition: lithium-x64.h:420
NilValue
Definition: v8.h:141
LCmpObjectEqAndBranch(LOperand *left, LOperand *right)
Definition: lithium-x64.h:652
LOperand ** SpilledDoubleRegisterArray()
Definition: lithium-x64.h:2319
LOperand * key()
Definition: lithium-x64.h:873
LElementsKind(LOperand *value)
Definition: lithium-x64.h:1101
virtual Opcode opcode() const
Definition: lithium-x64.h:1236
HBasicBlock * SuccessorAt(int i)
Definition: lithium-x64.h:461
LIsStringAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:716
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement,"load-keyed-fast-double-element") LOperand *elements()
Definition: lithium-x64.h:1379
int block_id() const
Definition: lithium-arm.h:416
LLoadKeyedFastElement(LOperand *elements, LOperand *key)
Definition: lithium-x64.h:1358
bool HasEnvironment() const
Definition: lithium-x64.h:246
virtual bool HasResult() const
Definition: lithium-x64.h:297
LBitI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:938
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: globals.h:307
virtual bool IsControl() const
Definition: lithium-x64.h:458
LTypeofIsAndBranch(LOperand *value)
Definition: lithium-x64.h:2269
virtual LOperand * result()=0
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random generator(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer
LStoreGlobalGeneric(LOperand *global_object, LOperand *value)
Definition: lithium-x64.h:1462
LOperand * global_object()
Definition: lithium-x64.h:1217
virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment *env)
Definition: lithium-x64.h:912
virtual bool IsControl() const
Definition: lithium-arm.h:376
LCmpMapAndBranch(LOperand *value)
Definition: lithium-x64.h:1039
LStringCharFromCode(LOperand *char_code)
Definition: lithium-x64.h:2050
HBasicBlock * block() const
Definition: lithium-arm.h:334
LSubI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:976
LOperand * left()
Definition: lithium-x64.h:569
TranscendentalCache::Type transcendental_type()
Definition: lithium-arm.h:440
virtual void PrintTo(StringStream *stream)
Definition: lithium-arm.cc:92
#define BASE_EMBEDDED
Definition: allocation.h:68
activate correct semantics for inheriting readonliness false
Definition: flags.cc:141
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:125
#define DECLARE_HYDROGEN_ACCESSOR(type)
Definition: lithium-x64.h:201
#define T(name, string, precedence)
Definition: token.cc:48
LOperand * left()
Definition: lithium-x64.h:1173
LToFastProperties(LOperand *value)
Definition: lithium-x64.h:2244
LInstanceOf(LOperand *left, LOperand *right)
Definition: lithium-x64.h:882
LIsObjectAndBranch(LOperand *value)
Definition: lithium-x64.h:701
LMulI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:599
Definition: v8.h:1425
LRandom(LOperand *global_object)
Definition: lithium-x64.h:1213
virtual bool IsControl() const
Definition: lithium-x64.h:242
LPointerMap * pointer_map() const
Definition: lithium-x64.h:249
LShiftI(Token::Value op, LOperand *left, LOperand *right, bool can_deopt)
Definition: lithium-x64.h:955
LOperand * right()
Definition: lithium-x64.h:605
EmbeddedContainer< LOperand *, I > inputs_
Definition: lithium-arm.h:302
virtual bool IsGap() const
Definition: lithium-x64.h:240
LTaggedToI(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1801
LOperand * right()
Definition: lithium-x64.h:944
LCheckFunction(LOperand *value)
Definition: lithium-x64.h:2076
LAccessArgumentsAt(LOperand *arguments, LOperand *length, LOperand *index)
Definition: lithium-x64.h:509
LOperand * value()
Definition: lithium-x64.h:1148
LArithmeticT(Token::Value op, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1247
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:145
int block_id() const
Definition: lithium-arm.h:378
LOperand * temp()
Definition: lithium-x64.h:554
void set_gap_instructions_size(int gap_instructions_size)
Definition: lithium-arm.h:391
LOperand * left()
Definition: lithium-x64.h:552
LLoadElements(LOperand *object)
Definition: lithium-x64.h:1333
virtual void CompileToNative(LCodeGen *generator)=0
virtual bool IsGap() const
Definition: lithium-x64.h:327
LMathMinMax(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1183
static const int kNumAllocatableRegisters
Definition: assembler-arm.h:74
LNumberTagU(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1756
LTypeof(LOperand *value)
Definition: lithium-x64.h:2257
LStringAdd(LOperand *left, LOperand *right)
Definition: lithium-x64.h:2020
LCheckMaps(LOperand *value)
Definition: lithium-x64.h:2102
Token::Value op() const
Definition: lithium-x64.h:1253
LClampDToUint8(LOperand *unclamped)
Definition: lithium-x64.h:2143
bool IsLoopHeader() const
Definition: hydrogen.h:97
LStoreNamedField(LOperand *object, LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1860
LLoadKeyedFastDoubleElement(LOperand *elements, LOperand *key)
Definition: lithium-x64.h:1374
LArithmeticD(Token::Value op, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1226
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:190
LMapEnumLength(LOperand *value)
Definition: lithium-x64.h:1089
LUnaryMathOperation(LOperand *value)
Definition: lithium-x64.h:636
LEnvironment * GetDeferredLazyDeoptimizationEnvironment()
Definition: lithium-x64.h:909
void set_replacement(LLabel *label)
Definition: lithium-x64.h:423
LCmpIDAndBranch(LOperand *left, LOperand *right)
Definition: lithium-x64.h:614
LParallelMove * GetParallelMove(InnerPosition pos)
Definition: lithium-x64.h:355
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
Definition: flags.cc:301
virtual Opcode opcode() const
Definition: lithium-x64.h:1257
LInstanceOfKnownGlobal(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:896
bool HasPointerMap() const
Definition: lithium-x64.h:250
LCheckMapValue(LOperand *value, LOperand *map)
Definition: lithium-x64.h:2377
LIsSmiAndBranch(LOperand *value)
Definition: lithium-x64.h:733
LOperand * right()
Definition: lithium-x64.h:857
int block_id() const
Definition: hydrogen.h:61
LInteger32ToDouble(LOperand *value)
Definition: lithium-x64.h:1718
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,"store-keyed-specialized-array-element") ElementsKind elements_kind() const
Definition: lithium-x64.h:1963
bool IsRedundant() const
Definition: lithium-arm.cc:134
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,"load-keyed-specialized-array-element") LOperand *external_pointer()
Definition: lithium-x64.h:1396
LGoto(int block_id)
Definition: lithium-x64.h:375
LCallNew(LOperand *constructor)
Definition: lithium-x64.h:1691
LIn(LOperand *key, LOperand *object)
Definition: lithium-x64.h:868
static HValue * cast(HValue *value)
LLoadNamedGeneric(LOperand *object)
Definition: lithium-x64.h:1306
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,"instance-of-known-global") Handle< JSFunction > function() const
Definition: lithium-x64.h:904
HValue * hydrogen_value() const
Definition: lithium-x64.h:253
LPushArgument(LOperand *value)
Definition: lithium-x64.h:1519
LStringCompareAndBranch(LOperand *left, LOperand *right)
Definition: lithium-x64.h:766
bool HasReplacement() const
Definition: lithium-x64.h:424
LOperand * object()
Definition: lithium-x64.h:874
LBitNotI(LOperand *value)
Definition: lithium-x64.h:1156
LApplyArguments(LOperand *function, LOperand *receiver, LOperand *length, LOperand *elements)
Definition: lithium-x64.h:488
LCallFunction(LOperand *function)
Definition: lithium-x64.h:1653
LStoreNamedGeneric(LOperand *object, LOperand *value)
Definition: lithium-x64.h:1884
LLoadKeyedGeneric(LOperand *obj, LOperand *key)
Definition: lithium-x64.h:1411
LStoreGlobalCell(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1447
LIsUndetectableAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:748
LSmiUntag(LOperand *value, bool needs_check)
Definition: lithium-x64.h:1843
LLoadKeyedSpecializedArrayElement(LOperand *external_pointer, LOperand *key)
Definition: lithium-x64.h:1391
LGap(HBasicBlock *block)
Definition: lithium-x64.h:318
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:348
LPlatformChunk(CompilationInfo *info, HGraph *graph)
Definition: lithium-x64.h:2406
LStoreKeyedSpecializedArrayElement(LOperand *external_pointer, LOperand *key, LOperand *value)
Definition: lithium-x64.h:1951
#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)
Definition: lithium-x64.h:191