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