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