v8  3.25.30(node0.11.13)
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_CONCRETE_INSTRUCTION_LIST(V) \
44  V(AccessArgumentsAt) \
45  V(AddI) \
46  V(Allocate) \
47  V(ApplyArguments) \
48  V(ArgumentsElements) \
49  V(ArgumentsLength) \
50  V(ArithmeticD) \
51  V(ArithmeticT) \
52  V(BitI) \
53  V(BoundsCheck) \
54  V(Branch) \
55  V(CallJSFunction) \
56  V(CallWithDescriptor) \
57  V(CallFunction) \
58  V(CallNew) \
59  V(CallNewArray) \
60  V(CallRuntime) \
61  V(CallStub) \
62  V(CheckInstanceType) \
63  V(CheckMaps) \
64  V(CheckMapValue) \
65  V(CheckNonSmi) \
66  V(CheckSmi) \
67  V(CheckValue) \
68  V(ClampDToUint8) \
69  V(ClampIToUint8) \
70  V(ClampTToUint8) \
71  V(ClassOfTestAndBranch) \
72  V(CompareMinusZeroAndBranch) \
73  V(CompareNumericAndBranch) \
74  V(CmpObjectEqAndBranch) \
75  V(CmpHoleAndBranch) \
76  V(CmpMapAndBranch) \
77  V(CmpT) \
78  V(ConstantD) \
79  V(ConstantE) \
80  V(ConstantI) \
81  V(ConstantS) \
82  V(ConstantT) \
83  V(ConstructDouble) \
84  V(Context) \
85  V(DateField) \
86  V(DebugBreak) \
87  V(DeclareGlobals) \
88  V(Deoptimize) \
89  V(DivByConstI) \
90  V(DivByPowerOf2I) \
91  V(DivI) \
92  V(DoubleToI) \
93  V(DoubleBits) \
94  V(DoubleToSmi) \
95  V(Drop) \
96  V(Dummy) \
97  V(DummyUse) \
98  V(FlooringDivByConstI) \
99  V(FlooringDivByPowerOf2I) \
100  V(ForInCacheArray) \
101  V(ForInPrepareMap) \
102  V(FunctionLiteral) \
103  V(GetCachedArrayIndex) \
104  V(Goto) \
105  V(HasCachedArrayIndexAndBranch) \
106  V(HasInstanceTypeAndBranch) \
107  V(InnerAllocatedObject) \
108  V(InstanceOf) \
109  V(InstanceOfKnownGlobal) \
110  V(InstructionGap) \
111  V(Integer32ToDouble) \
112  V(InvokeFunction) \
113  V(IsConstructCallAndBranch) \
114  V(IsObjectAndBranch) \
115  V(IsStringAndBranch) \
116  V(IsSmiAndBranch) \
117  V(IsUndetectableAndBranch) \
118  V(Label) \
119  V(LazyBailout) \
120  V(LoadContextSlot) \
121  V(LoadRoot) \
122  V(LoadFieldByIndex) \
123  V(LoadFunctionPrototype) \
124  V(LoadGlobalCell) \
125  V(LoadGlobalGeneric) \
126  V(LoadKeyed) \
127  V(LoadKeyedGeneric) \
128  V(LoadNamedField) \
129  V(LoadNamedGeneric) \
130  V(MapEnumLength) \
131  V(MathAbs) \
132  V(MathExp) \
133  V(MathClz32) \
134  V(MathFloor) \
135  V(MathLog) \
136  V(MathMinMax) \
137  V(MathPowHalf) \
138  V(MathRound) \
139  V(MathSqrt) \
140  V(ModByConstI) \
141  V(ModByPowerOf2I) \
142  V(ModI) \
143  V(MulI) \
144  V(MultiplyAddD) \
145  V(NumberTagD) \
146  V(NumberTagI) \
147  V(NumberTagU) \
148  V(NumberUntagD) \
149  V(OsrEntry) \
150  V(Parameter) \
151  V(Power) \
152  V(PushArgument) \
153  V(RegExpLiteral) \
154  V(Return) \
155  V(SeqStringGetChar) \
156  V(SeqStringSetChar) \
157  V(ShiftI) \
158  V(SmiTag) \
159  V(SmiUntag) \
160  V(StackCheck) \
161  V(StoreCodeEntry) \
162  V(StoreContextSlot) \
163  V(StoreGlobalCell) \
164  V(StoreKeyed) \
165  V(StoreKeyedGeneric) \
166  V(StoreNamedField) \
167  V(StoreNamedGeneric) \
168  V(StringAdd) \
169  V(StringCharCodeAt) \
170  V(StringCharFromCode) \
171  V(StringCompareAndBranch) \
172  V(SubI) \
173  V(TaggedToI) \
174  V(ThisFunction) \
175  V(ToFastProperties) \
176  V(TransitionElementsKind) \
177  V(TrapAllocationMemento) \
178  V(Typeof) \
179  V(TypeofIsAndBranch) \
180  V(Uint32ToDouble) \
181  V(UnknownOSRValue) \
182  V(WrapReceiver)
183 
184 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
185  virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \
186  return LInstruction::k##type; \
187  } \
188  virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \
189  virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \
190  return mnemonic; \
191  } \
192  static L##type* cast(LInstruction* instr) { \
193  ASSERT(instr->Is##type()); \
194  return reinterpret_cast<L##type*>(instr); \
195  }
196 
197 
198 #define DECLARE_HYDROGEN_ACCESSOR(type) \
199  H##type* hydrogen() const { \
200  return H##type::cast(hydrogen_value()); \
201  }
202 
203 
204 class LInstruction : public ZoneObject {
205  public:
207  : environment_(NULL),
208  hydrogen_value_(NULL),
209  bit_field_(IsCallBits::encode(false)) {
210  }
211 
212  virtual ~LInstruction() {}
213 
214  virtual void CompileToNative(LCodeGen* generator) = 0;
215  virtual const char* Mnemonic() const = 0;
216  virtual void PrintTo(StringStream* stream);
217  virtual void PrintDataTo(StringStream* stream);
218  virtual void PrintOutputOperandTo(StringStream* stream);
219 
220  enum Opcode {
221  // Declare a unique enum value for each instruction.
222 #define DECLARE_OPCODE(type) k##type,
225 #undef DECLARE_OPCODE
226  };
227 
228  virtual Opcode opcode() const = 0;
229 
230  // Declare non-virtual type testers for all leaf IR classes.
231 #define DECLARE_PREDICATE(type) \
232  bool Is##type() const { return opcode() == k##type; }
234 #undef DECLARE_PREDICATE
235 
236  // Declare virtual predicates for instructions that don't have
237  // an opcode.
238  virtual bool IsGap() const { return false; }
239 
240  virtual bool IsControl() const { return false; }
241 
242  void set_environment(LEnvironment* env) { environment_ = env; }
243  LEnvironment* environment() const { return environment_; }
244  bool HasEnvironment() const { return environment_ != NULL; }
245 
246  void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
247  LPointerMap* pointer_map() const { return pointer_map_.get(); }
248  bool HasPointerMap() const { return pointer_map_.is_set(); }
249 
250  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
251  HValue* hydrogen_value() const { return hydrogen_value_; }
252 
253  virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
254 
255  void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
256  bool IsCall() const { return IsCallBits::decode(bit_field_); }
257 
258  // Interface to the register allocator and iterators.
259  bool ClobbersTemps() const { return IsCall(); }
260  bool ClobbersRegisters() const { return IsCall(); }
261  virtual bool ClobbersDoubleRegisters() const { return IsCall(); }
262 
263  // Interface to the register allocator and iterators.
264  bool IsMarkedAsCall() const { return IsCall(); }
265 
266  virtual bool HasResult() const = 0;
267  virtual LOperand* result() const = 0;
268 
269  LOperand* FirstInput() { return InputAt(0); }
270  LOperand* Output() { return HasResult() ? result() : NULL; }
271 
272  virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
273 
274 #ifdef DEBUG
275  void VerifyCall();
276 #endif
277 
278  private:
279  // Iterator interface.
280  friend class InputIterator;
281  virtual int InputCount() = 0;
282  virtual LOperand* InputAt(int i) = 0;
283 
284  friend class TempIterator;
285  virtual int TempCount() = 0;
286  virtual LOperand* TempAt(int i) = 0;
287 
288  class IsCallBits: public BitField<bool, 0, 1> {};
289 
290  LEnvironment* environment_;
291  SetOncePointer<LPointerMap> pointer_map_;
292  HValue* hydrogen_value_;
293  int bit_field_;
294 };
295 
296 
297 // R = number of result operands (0 or 1).
298 template<int R>
299 class LTemplateResultInstruction : public LInstruction {
300  public:
301  // Allow 0 or 1 output operands.
302  STATIC_ASSERT(R == 0 || R == 1);
303  virtual bool HasResult() const V8_FINAL V8_OVERRIDE {
304  return R != 0 && result() != NULL;
305  }
306  void set_result(LOperand* operand) { results_[0] = operand; }
307  LOperand* result() const { return results_[0]; }
308 
309  protected:
311 };
312 
313 
314 // R = number of result operands (0 or 1).
315 // I = number of input operands.
316 // T = number of temporary operands.
317 template<int R, int I, int T>
318 class LTemplateInstruction : public LTemplateResultInstruction<R> {
319  protected:
320  EmbeddedContainer<LOperand*, I> inputs_;
321  EmbeddedContainer<LOperand*, T> temps_;
322 
323  private:
324  // Iterator support.
325  virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; }
326  virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
327 
328  virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; }
329  virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; }
330 };
331 
332 
333 class LGap : public LTemplateInstruction<0, 0, 0> {
334  public:
335  explicit LGap(HBasicBlock* block)
336  : block_(block) {
337  parallel_moves_[BEFORE] = NULL;
338  parallel_moves_[START] = NULL;
339  parallel_moves_[END] = NULL;
340  parallel_moves_[AFTER] = NULL;
341  }
342 
343  // Can't use the DECLARE-macro here because of sub-classes.
344  virtual bool IsGap() const V8_FINAL V8_OVERRIDE { return true; }
345  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
346  static LGap* cast(LInstruction* instr) {
347  ASSERT(instr->IsGap());
348  return reinterpret_cast<LGap*>(instr);
349  }
350 
351  bool IsRedundant() const;
352 
353  HBasicBlock* block() const { return block_; }
354 
356  BEFORE,
357  START,
358  END,
359  AFTER,
361  LAST_INNER_POSITION = AFTER
362  };
363 
364  LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) {
365  if (parallel_moves_[pos] == NULL) {
366  parallel_moves_[pos] = new(zone) LParallelMove(zone);
367  }
368  return parallel_moves_[pos];
369  }
370 
371  LParallelMove* GetParallelMove(InnerPosition pos) {
372  return parallel_moves_[pos];
373  }
374 
375  private:
376  LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
377  HBasicBlock* block_;
378 };
379 
380 
381 class LInstructionGap V8_FINAL : public LGap {
382  public:
383  explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
384 
385  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
386  return !IsRedundant();
387  }
388 
389  DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
390 };
391 
392 
393 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> {
394  public:
395  explicit LGoto(HBasicBlock* block) : block_(block) { }
396 
397  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE;
398  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
399  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
400  virtual bool IsControl() const V8_OVERRIDE { return true; }
401 
402  int block_id() const { return block_->block_id(); }
403 
404  private:
405  HBasicBlock* block_;
406 };
407 
408 
409 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> {
410  public:
411  LLazyBailout() : gap_instructions_size_(0) { }
412 
413  DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
414 
415  void set_gap_instructions_size(int gap_instructions_size) {
416  gap_instructions_size_ = gap_instructions_size;
417  }
418  int gap_instructions_size() { return gap_instructions_size_; }
419 
420  private:
421  int gap_instructions_size_;
422 };
423 
424 
425 class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
426  public:
427  explicit LDummy() { }
428  DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
429 };
430 
431 
432 class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {
433  public:
434  explicit LDummyUse(LOperand* value) {
435  inputs_[0] = value;
436  }
437  DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
438 };
439 
440 
441 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
442  public:
443  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
444  DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
445 };
446 
447 
448 class LLabel V8_FINAL : public LGap {
449  public:
450  explicit LLabel(HBasicBlock* block)
451  : LGap(block), replacement_(NULL) { }
452 
453  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
454  return false;
455  }
456  DECLARE_CONCRETE_INSTRUCTION(Label, "label")
457 
458  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
459 
460  int block_id() const { return block()->block_id(); }
461  bool is_loop_header() const { return block()->IsLoopHeader(); }
462  bool is_osr_entry() const { return block()->is_osr_entry(); }
463  Label* label() { return &label_; }
464  LLabel* replacement() const { return replacement_; }
465  void set_replacement(LLabel* label) { replacement_ = label; }
466  bool HasReplacement() const { return replacement_ != NULL; }
467 
468  private:
469  Label label_;
470  LLabel* replacement_;
471 };
472 
473 
474 class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> {
475  public:
476  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
477  return false;
478  }
479  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
480 };
481 
482 
483 class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> {
484  public:
485  explicit LCallStub(LOperand* context) {
486  inputs_[0] = context;
487  }
488 
489  LOperand* context() { return inputs_[0]; }
490 
491  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
492  DECLARE_HYDROGEN_ACCESSOR(CallStub)
493 };
494 
495 
496 class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> {
497  public:
498  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
499  return false;
500  }
501  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
502 };
503 
504 
505 template<int I, int T>
506 class LControlInstruction : public LTemplateInstruction<0, I, T> {
507  public:
508  LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
509 
510  virtual bool IsControl() const V8_FINAL V8_OVERRIDE { return true; }
511 
512  int SuccessorCount() { return hydrogen()->SuccessorCount(); }
513  HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
514 
515  int TrueDestination(LChunk* chunk) {
516  return chunk->LookupDestination(true_block_id());
517  }
518  int FalseDestination(LChunk* chunk) {
519  return chunk->LookupDestination(false_block_id());
520  }
521 
522  Label* TrueLabel(LChunk* chunk) {
523  if (true_label_ == NULL) {
524  true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk));
525  }
526  return true_label_;
527  }
528  Label* FalseLabel(LChunk* chunk) {
529  if (false_label_ == NULL) {
530  false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk));
531  }
532  return false_label_;
533  }
534 
535  protected:
536  int true_block_id() { return SuccessorAt(0)->block_id(); }
537  int false_block_id() { return SuccessorAt(1)->block_id(); }
538 
539  private:
540  HControlInstruction* hydrogen() {
541  return HControlInstruction::cast(this->hydrogen_value());
542  }
543 
544  Label* false_label_;
545  Label* true_label_;
546 };
547 
548 
549 class LWrapReceiver V8_FINAL : public LTemplateInstruction<1, 2, 0> {
550  public:
551  LWrapReceiver(LOperand* receiver, LOperand* function) {
552  inputs_[0] = receiver;
553  inputs_[1] = function;
554  }
555 
556  DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
557  DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
558 
559  LOperand* receiver() { return inputs_[0]; }
560  LOperand* function() { return inputs_[1]; }
561 };
562 
563 
564 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> {
565  public:
567  LOperand* receiver,
568  LOperand* length,
569  LOperand* elements) {
570  inputs_[0] = function;
571  inputs_[1] = receiver;
572  inputs_[2] = length;
573  inputs_[3] = elements;
574  }
575 
576  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
577 
578  LOperand* function() { return inputs_[0]; }
579  LOperand* receiver() { return inputs_[1]; }
580  LOperand* length() { return inputs_[2]; }
581  LOperand* elements() { return inputs_[3]; }
582 };
583 
584 
585 class LAccessArgumentsAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
586  public:
587  LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
588  inputs_[0] = arguments;
589  inputs_[1] = length;
590  inputs_[2] = index;
591  }
592 
593  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
594 
595  LOperand* arguments() { return inputs_[0]; }
596  LOperand* length() { return inputs_[1]; }
597  LOperand* index() { return inputs_[2]; }
598 
599  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
600 };
601 
602 
603 class LArgumentsLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
604  public:
605  explicit LArgumentsLength(LOperand* elements) {
606  inputs_[0] = elements;
607  }
608 
609  LOperand* elements() { return inputs_[0]; }
610 
611  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
612 };
613 
614 
615 class LArgumentsElements V8_FINAL : public LTemplateInstruction<1, 0, 0> {
616  public:
617  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
618  DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
619 };
620 
621 
622 class LModByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
623  public:
624  LModByPowerOf2I(LOperand* dividend, int32_t divisor) {
625  inputs_[0] = dividend;
626  divisor_ = divisor;
627  }
628 
629  LOperand* dividend() { return inputs_[0]; }
630  int32_t divisor() const { return divisor_; }
631 
632  DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
634 
635  private:
636  int32_t divisor_;
637 };
638 
639 
640 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
641  public:
642  LModByConstI(LOperand* dividend, int32_t divisor) {
643  inputs_[0] = dividend;
644  divisor_ = divisor;
645  }
646 
647  LOperand* dividend() { return inputs_[0]; }
648  int32_t divisor() const { return divisor_; }
649 
650  DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
652 
653  private:
654  int32_t divisor_;
655 };
656 
657 
658 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 3> {
659  public:
661  LOperand* right) {
662  inputs_[0] = left;
663  inputs_[1] = right;
664  }
665 
666  LOperand* left() { return inputs_[0]; }
667  LOperand* right() { return inputs_[1]; }
668 
669  DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
671 };
672 
673 
674 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
675  public:
676  LDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
677  inputs_[0] = dividend;
678  divisor_ = divisor;
679  }
680 
681  LOperand* dividend() { return inputs_[0]; }
682  int32_t divisor() const { return divisor_; }
683 
684  DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
686 
687  private:
688  int32_t divisor_;
689 };
690 
691 
692 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
693  public:
694  LDivByConstI(LOperand* dividend, int32_t divisor) {
695  inputs_[0] = dividend;
696  divisor_ = divisor;
697  }
698 
699  LOperand* dividend() { return inputs_[0]; }
700  int32_t divisor() const { return divisor_; }
701 
702  DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
704 
705  private:
706  int32_t divisor_;
707 };
708 
709 
710 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
711  public:
712  LDivI(LOperand* left, LOperand* right) {
713  inputs_[0] = left;
714  inputs_[1] = right;
715  }
716 
717  LOperand* left() { return inputs_[0]; }
718  LOperand* right() { return inputs_[1]; }
719 
720  DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
721  DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
722 };
723 
724 
725 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
726  public:
728  inputs_[0] = dividend;
729  divisor_ = divisor;
730  }
731 
732  LOperand* dividend() { return inputs_[0]; }
733  int32_t divisor() { return divisor_; }
734 
735  DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
736  "flooring-div-by-power-of-2-i")
737  DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
738 
739  private:
740  int32_t divisor_;
741 };
742 
743 
744 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
745  public:
746  LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
747  inputs_[0] = dividend;
748  divisor_ = divisor;
749  temps_[0] = temp;
750  }
751 
752  LOperand* dividend() { return inputs_[0]; }
753  int32_t divisor() const { return divisor_; }
754  LOperand* temp() { return temps_[0]; }
755 
756  DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
757  DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
758 
759  private:
760  int32_t divisor_;
761 };
762 
763 
764 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
765  public:
766  LMulI(LOperand* left, LOperand* right) {
767  inputs_[0] = left;
768  inputs_[1] = right;
769  }
770 
771  LOperand* left() { return inputs_[0]; }
772  LOperand* right() { return inputs_[1]; }
773 
774  DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
776 };
777 
778 
779 // Instruction for computing multiplier * multiplicand + addend.
780 class LMultiplyAddD V8_FINAL : public LTemplateInstruction<1, 3, 0> {
781  public:
782  LMultiplyAddD(LOperand* addend, LOperand* multiplier,
783  LOperand* multiplicand) {
784  inputs_[0] = addend;
785  inputs_[1] = multiplier;
786  inputs_[2] = multiplicand;
787  }
788 
789  LOperand* addend() { return inputs_[0]; }
790  LOperand* multiplier() { return inputs_[1]; }
791  LOperand* multiplicand() { return inputs_[2]; }
792 
793  DECLARE_CONCRETE_INSTRUCTION(MultiplyAddD, "multiply-add-d")
794 };
795 
796 
797 class LDebugBreak V8_FINAL : public LTemplateInstruction<0, 0, 0> {
798  public:
799  DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
800 };
801 
802 
803 class LCompareNumericAndBranch V8_FINAL : public LControlInstruction<2, 0> {
804  public:
806  inputs_[0] = left;
807  inputs_[1] = right;
808  }
809 
810  LOperand* left() { return inputs_[0]; }
811  LOperand* right() { return inputs_[1]; }
812 
813  DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
814  "compare-numeric-and-branch")
815  DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
816 
817  Token::Value op() const { return hydrogen()->token(); }
818  bool is_double() const {
819  return hydrogen()->representation().IsDouble();
820  }
821 
822  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
823 };
824 
825 
826 class LMathFloor V8_FINAL : public LTemplateInstruction<1, 1, 1> {
827  public:
828  LMathFloor(LOperand* value, LOperand* temp) {
829  inputs_[0] = value;
830  temps_[0] = temp;
831  }
832 
833  LOperand* value() { return inputs_[0]; }
834  LOperand* temp() { return temps_[0]; }
835 
836  DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
837  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
838 };
839 
840 
841 class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> {
842  public:
843  LMathRound(LOperand* value, LOperand* temp) {
844  inputs_[0] = value;
845  temps_[0] = temp;
846  }
847 
848  LOperand* value() { return inputs_[0]; }
849  LOperand* temp() { return temps_[0]; }
850 
851  DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
852  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
853 };
854 
855 
856 class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
857  public:
858  LMathAbs(LOperand* context, LOperand* value) {
859  inputs_[1] = context;
860  inputs_[0] = value;
861  }
862 
863  LOperand* context() { return inputs_[1]; }
864  LOperand* value() { return inputs_[0]; }
865 
866  DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
867  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
868 };
869 
870 
871 class LMathLog V8_FINAL : public LTemplateInstruction<1, 1, 0> {
872  public:
873  explicit LMathLog(LOperand* value) {
874  inputs_[0] = value;
875  }
876 
877  LOperand* value() { return inputs_[0]; }
878 
879  DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
880 };
881 
882 
883 class LMathClz32 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
884  public:
885  explicit LMathClz32(LOperand* value) {
886  inputs_[0] = value;
887  }
888 
889  LOperand* value() { return inputs_[0]; }
890 
891  DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32")
892 };
893 
894 
895 class LMathExp V8_FINAL : public LTemplateInstruction<1, 1, 3> {
896  public:
898  LOperand* double_temp,
899  LOperand* temp1,
900  LOperand* temp2) {
901  inputs_[0] = value;
902  temps_[0] = temp1;
903  temps_[1] = temp2;
904  temps_[2] = double_temp;
905  ExternalReference::InitializeMathExpData();
906  }
907 
908  LOperand* value() { return inputs_[0]; }
909  LOperand* temp1() { return temps_[0]; }
910  LOperand* temp2() { return temps_[1]; }
911  LOperand* double_temp() { return temps_[2]; }
912 
913  DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
914 };
915 
916 
917 class LMathSqrt V8_FINAL : public LTemplateInstruction<1, 1, 0> {
918  public:
919  explicit LMathSqrt(LOperand* value) {
920  inputs_[0] = value;
921  }
922 
923  LOperand* value() { return inputs_[0]; }
924 
925  DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
926 };
927 
928 
929 class LMathPowHalf V8_FINAL : public LTemplateInstruction<1, 1, 1> {
930  public:
931  LMathPowHalf(LOperand* value, LOperand* temp) {
932  inputs_[0] = value;
933  temps_[0] = temp;
934  }
935 
936  LOperand* value() { return inputs_[0]; }
937  LOperand* temp() { return temps_[0]; }
938 
939  DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
940 };
941 
942 
943 class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> {
944  public:
946  inputs_[0] = left;
947  inputs_[1] = right;
948  }
949 
950  LOperand* left() { return inputs_[0]; }
951  LOperand* right() { return inputs_[1]; }
952 
953  DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch")
954  DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
955 };
956 
957 
958 class LCmpHoleAndBranch V8_FINAL : public LControlInstruction<1, 0> {
959  public:
960  explicit LCmpHoleAndBranch(LOperand* object) {
961  inputs_[0] = object;
962  }
963 
964  LOperand* object() { return inputs_[0]; }
965 
966  DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch")
967  DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
968 };
969 
970 
971 class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 1> {
972  public:
974  inputs_[0] = value;
975  temps_[0] = temp;
976  }
977 
978  LOperand* value() { return inputs_[0]; }
979  LOperand* temp() { return temps_[0]; }
980 
981  DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch,
982  "cmp-minus-zero-and-branch")
983  DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch)
984 };
985 
986 
987 class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 1> {
988  public:
990  inputs_[0] = value;
991  temps_[0] = temp;
992  }
993 
994  LOperand* value() { return inputs_[0]; }
995  LOperand* temp() { return temps_[0]; }
996 
997  DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
998  DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
999 
1000  virtual void PrintDataTo(StringStream* stream);
1001 };
1002 
1003 
1004 class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
1005  public:
1007  inputs_[0] = value;
1008  temps_[0] = temp;
1009  }
1010 
1011  LOperand* value() { return inputs_[0]; }
1012  LOperand* temp() { return temps_[0]; }
1013 
1014  DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
1015  DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
1016 
1017  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1018 };
1019 
1020 
1021 class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> {
1022  public:
1023  explicit LIsSmiAndBranch(LOperand* value) {
1024  inputs_[0] = value;
1025  }
1026 
1027  LOperand* value() { return inputs_[0]; }
1028 
1029  DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
1030  DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
1031 
1032  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1033 };
1034 
1035 
1036 class LIsUndetectableAndBranch V8_FINAL : public LControlInstruction<1, 1> {
1037  public:
1038  explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
1039  inputs_[0] = value;
1040  temps_[0] = temp;
1041  }
1042 
1043  LOperand* value() { return inputs_[0]; }
1044  LOperand* temp() { return temps_[0]; }
1045 
1046  DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
1047  "is-undetectable-and-branch")
1048  DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
1049 
1050  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1051 };
1052 
1053 
1054 class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
1055  public:
1057  inputs_[0] = context;
1058  inputs_[1] = left;
1059  inputs_[2] = right;
1060  }
1061 
1062  LOperand* context() { return inputs_[0]; }
1063  LOperand* left() { return inputs_[1]; }
1064  LOperand* right() { return inputs_[2]; }
1065 
1066  DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1067  "string-compare-and-branch")
1068  DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
1069 
1070  Token::Value op() const { return hydrogen()->token(); }
1071 
1072  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1073 };
1074 
1075 
1076 class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 0> {
1077  public:
1079  inputs_[0] = value;
1080  }
1081 
1082  LOperand* value() { return inputs_[0]; }
1083 
1084  DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
1085  "has-instance-type-and-branch")
1086  DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
1087 
1088  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1089 };
1090 
1091 
1092 class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1093  public:
1094  explicit LGetCachedArrayIndex(LOperand* value) {
1095  inputs_[0] = value;
1096  }
1097 
1098  LOperand* value() { return inputs_[0]; }
1099 
1100  DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
1101  DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
1102 };
1103 
1104 
1105 class LHasCachedArrayIndexAndBranch V8_FINAL
1106  : public LControlInstruction<1, 0> {
1107  public:
1109  inputs_[0] = value;
1110  }
1111 
1112  LOperand* value() { return inputs_[0]; }
1113 
1114  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
1115  "has-cached-array-index-and-branch")
1116  DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
1117 
1118  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1119 };
1120 
1121 
1122 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 1> {
1123  public:
1125  inputs_[0] = value;
1126  temps_[0] = temp;
1127  }
1128 
1129  LOperand* value() { return inputs_[0]; }
1130  LOperand* temp() { return temps_[0]; }
1131 
1132  DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
1133  "class-of-test-and-branch")
1134  DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
1135 
1136  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1137 };
1138 
1139 
1140 class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1141  public:
1142  LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1143  inputs_[0] = context;
1144  inputs_[1] = left;
1145  inputs_[2] = right;
1146  }
1147 
1148  LOperand* context() { return inputs_[0]; }
1149  LOperand* left() { return inputs_[1]; }
1150  LOperand* right() { return inputs_[2]; }
1151 
1152  DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
1153  DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
1154 
1155  Token::Value op() const { return hydrogen()->token(); }
1156 };
1157 
1158 
1159 class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1160  public:
1161  LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1162  inputs_[0] = context;
1163  inputs_[1] = left;
1164  inputs_[2] = right;
1165  }
1166 
1167  LOperand* context() { return inputs_[0]; }
1168  LOperand* left() { return inputs_[1]; }
1169  LOperand* right() { return inputs_[2]; }
1170 
1171  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1172 };
1173 
1174 
1175 class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 2, 1> {
1176  public:
1178  inputs_[0] = context;
1179  inputs_[1] = value;
1180  temps_[0] = temp;
1181  }
1182 
1183  LOperand* context() { return inputs_[0]; }
1184  LOperand* value() { return inputs_[1]; }
1185  LOperand* temp() { return temps_[0]; }
1186 
1187  DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
1188  "instance-of-known-global")
1189  DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
1190 
1191  Handle<JSFunction> function() const { return hydrogen()->function(); }
1193  return lazy_deopt_env_;
1194  }
1196  LEnvironment* env) V8_OVERRIDE {
1197  lazy_deopt_env_ = env;
1198  }
1199 
1200  private:
1201  LEnvironment* lazy_deopt_env_;
1202 };
1203 
1204 
1205 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1206  public:
1207  LBoundsCheck(LOperand* index, LOperand* length) {
1208  inputs_[0] = index;
1209  inputs_[1] = length;
1210  }
1211 
1212  LOperand* index() { return inputs_[0]; }
1213  LOperand* length() { return inputs_[1]; }
1214 
1215  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
1216  DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
1217 };
1218 
1219 
1220 class LBitI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1221  public:
1222  LBitI(LOperand* left, LOperand* right) {
1223  inputs_[0] = left;
1224  inputs_[1] = right;
1225  }
1226 
1227  LOperand* left() { return inputs_[0]; }
1228  LOperand* right() { return inputs_[1]; }
1229 
1230  Token::Value op() const { return hydrogen()->op(); }
1231 
1232  DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
1233  DECLARE_HYDROGEN_ACCESSOR(Bitwise)
1234 };
1235 
1236 
1237 class LShiftI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1238  public:
1239  LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
1240  : op_(op), can_deopt_(can_deopt) {
1241  inputs_[0] = left;
1242  inputs_[1] = right;
1243  }
1244 
1245  Token::Value op() const { return op_; }
1246  LOperand* left() { return inputs_[0]; }
1247  LOperand* right() { return inputs_[1]; }
1248  bool can_deopt() const { return can_deopt_; }
1249 
1250  DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1251 
1252  private:
1253  Token::Value op_;
1254  bool can_deopt_;
1255 };
1256 
1257 
1258 class LSubI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1259  public:
1260  LSubI(LOperand* left, LOperand* right) {
1261  inputs_[0] = left;
1262  inputs_[1] = right;
1263  }
1264 
1265  LOperand* left() { return inputs_[0]; }
1266  LOperand* right() { return inputs_[1]; }
1267 
1268  DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1270 };
1271 
1272 
1273 class LConstantI V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1274  public:
1275  DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1276  DECLARE_HYDROGEN_ACCESSOR(Constant)
1277 
1278  int32_t value() const { return hydrogen()->Integer32Value(); }
1279 };
1280 
1281 
1282 class LConstantS V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1283  public:
1284  DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s")
1285  DECLARE_HYDROGEN_ACCESSOR(Constant)
1286 
1287  Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
1288 };
1289 
1290 
1291 class LConstantD V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1292  public:
1293  DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1294  DECLARE_HYDROGEN_ACCESSOR(Constant)
1295 
1296  double value() const { return hydrogen()->DoubleValue(); }
1297 };
1298 
1299 
1300 class LConstantE V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1301  public:
1302  DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
1303  DECLARE_HYDROGEN_ACCESSOR(Constant)
1304 
1305  ExternalReference value() const {
1306  return hydrogen()->ExternalReferenceValue();
1307  }
1308 };
1309 
1310 
1311 class LConstantT V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1312  public:
1313  DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1314  DECLARE_HYDROGEN_ACCESSOR(Constant)
1315 
1316  Handle<Object> value(Isolate* isolate) const {
1317  return hydrogen()->handle(isolate);
1318  }
1319 };
1320 
1321 
1322 class LBranch V8_FINAL : public LControlInstruction<1, 0> {
1323  public:
1324  explicit LBranch(LOperand* value) {
1325  inputs_[0] = value;
1326  }
1327 
1328  LOperand* value() { return inputs_[0]; }
1329 
1330  DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1332 
1333  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1334 };
1335 
1336 
1337 class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> {
1338  public:
1340  inputs_[0] = value;
1341  temps_[0] = temp;
1342  }
1343 
1344  LOperand* value() { return inputs_[0]; }
1345  LOperand* temp() { return temps_[0]; }
1346 
1347  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1348  DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1349 
1350  Handle<Map> map() const { return hydrogen()->map().handle(); }
1351 };
1352 
1353 
1354 class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1355  public:
1356  explicit LMapEnumLength(LOperand* value) {
1357  inputs_[0] = value;
1358  }
1359 
1360  LOperand* value() { return inputs_[0]; }
1361 
1362  DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
1363 };
1364 
1365 
1366 class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> {
1367  public:
1368  LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) {
1369  inputs_[0] = date;
1370  temps_[0] = temp;
1371  }
1372 
1373  LOperand* date() { return inputs_[0]; }
1374  LOperand* temp() { return temps_[0]; }
1375  Smi* index() const { return index_; }
1376 
1377  DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1378  DECLARE_HYDROGEN_ACCESSOR(DateField)
1379 
1380  private:
1381  Smi* index_;
1382 };
1383 
1384 
1385 class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1386  public:
1388  inputs_[0] = string;
1389  inputs_[1] = index;
1390  }
1391 
1392  LOperand* string() const { return inputs_[0]; }
1393  LOperand* index() const { return inputs_[1]; }
1394 
1395  DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
1396  DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
1397 };
1398 
1399 
1400 class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
1401  public:
1403  LOperand* string,
1404  LOperand* index,
1405  LOperand* value) {
1406  inputs_[0] = context;
1407  inputs_[1] = string;
1408  inputs_[2] = index;
1409  inputs_[3] = value;
1410  }
1411 
1412  LOperand* string() { return inputs_[1]; }
1413  LOperand* index() { return inputs_[2]; }
1414  LOperand* value() { return inputs_[3]; }
1415 
1416  DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
1417  DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
1418 };
1419 
1420 
1421 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1422  public:
1423  LAddI(LOperand* left, LOperand* right) {
1424  inputs_[0] = left;
1425  inputs_[1] = right;
1426  }
1427 
1428  LOperand* left() { return inputs_[0]; }
1429  LOperand* right() { return inputs_[1]; }
1430 
1431  DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1433 };
1434 
1435 
1436 class LMathMinMax V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1437  public:
1438  LMathMinMax(LOperand* left, LOperand* right) {
1439  inputs_[0] = left;
1440  inputs_[1] = right;
1441  }
1442 
1443  LOperand* left() { return inputs_[0]; }
1444  LOperand* right() { return inputs_[1]; }
1445 
1446  DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
1447  DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1448 };
1449 
1450 
1451 class LPower V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1452  public:
1453  LPower(LOperand* left, LOperand* right) {
1454  inputs_[0] = left;
1455  inputs_[1] = right;
1456  }
1457 
1458  LOperand* left() { return inputs_[0]; }
1459  LOperand* right() { return inputs_[1]; }
1460 
1461  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1463 };
1464 
1465 
1466 class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1467  public:
1469  : op_(op) {
1470  inputs_[0] = left;
1471  inputs_[1] = right;
1472  }
1473 
1474  Token::Value op() const { return op_; }
1475  LOperand* left() { return inputs_[0]; }
1476  LOperand* right() { return inputs_[1]; }
1477 
1478  virtual Opcode opcode() const V8_OVERRIDE {
1479  return LInstruction::kArithmeticD;
1480  }
1481  virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
1482  virtual const char* Mnemonic() const V8_OVERRIDE;
1483 
1484  private:
1485  Token::Value op_;
1486 };
1487 
1488 
1489 class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1490  public:
1492  LOperand* context,
1493  LOperand* left,
1494  LOperand* right)
1495  : op_(op) {
1496  inputs_[0] = context;
1497  inputs_[1] = left;
1498  inputs_[2] = right;
1499  }
1500 
1501  LOperand* context() { return inputs_[0]; }
1502  LOperand* left() { return inputs_[1]; }
1503  LOperand* right() { return inputs_[2]; }
1504  Token::Value op() const { return op_; }
1505 
1506  virtual Opcode opcode() const V8_FINAL { return LInstruction::kArithmeticT; }
1507  virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
1508  virtual const char* Mnemonic() const V8_OVERRIDE;
1509 
1510  private:
1511  Token::Value op_;
1512 };
1513 
1514 
1515 class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> {
1516  public:
1517  LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
1518  inputs_[0] = value;
1519  inputs_[1] = context;
1520  inputs_[2] = parameter_count;
1521  }
1522 
1523  LOperand* value() { return inputs_[0]; }
1524 
1526  return parameter_count()->IsConstantOperand();
1527  }
1528  LConstantOperand* constant_parameter_count() {
1529  ASSERT(has_constant_parameter_count());
1530  return LConstantOperand::cast(parameter_count());
1531  }
1532  LOperand* parameter_count() { return inputs_[2]; }
1533 
1534  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1535 };
1536 
1537 
1538 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1539  public:
1540  explicit LLoadNamedField(LOperand* object) {
1541  inputs_[0] = object;
1542  }
1543 
1544  LOperand* object() { return inputs_[0]; }
1545 
1546  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1547  DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1548 };
1549 
1550 
1551 class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1552  public:
1553  LLoadNamedGeneric(LOperand* context, LOperand* object) {
1554  inputs_[0] = context;
1555  inputs_[1] = object;
1556  }
1557 
1558  LOperand* context() { return inputs_[0]; }
1559  LOperand* object() { return inputs_[1]; }
1560 
1561  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1562  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1563 
1564  Handle<Object> name() const { return hydrogen()->name(); }
1565 };
1566 
1567 
1568 class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1569  public:
1570  explicit LLoadFunctionPrototype(LOperand* function) {
1571  inputs_[0] = function;
1572  }
1573 
1574  LOperand* function() { return inputs_[0]; }
1575 
1576  DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1577  DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1578 };
1579 
1580 
1581 class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1582  public:
1583  DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1584  DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1585 
1586  Heap::RootListIndex index() const { return hydrogen()->index(); }
1587 };
1588 
1589 
1590 class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1591  public:
1592  LLoadKeyed(LOperand* elements, LOperand* key) {
1593  inputs_[0] = elements;
1594  inputs_[1] = key;
1595  }
1596 
1597  LOperand* elements() { return inputs_[0]; }
1598  LOperand* key() { return inputs_[1]; }
1600  return hydrogen()->elements_kind();
1601  }
1602  bool is_external() const {
1603  return hydrogen()->is_external();
1604  }
1605  bool is_fixed_typed_array() const {
1606  return hydrogen()->is_fixed_typed_array();
1607  }
1608  bool is_typed_elements() const {
1609  return is_external() || is_fixed_typed_array();
1610  }
1611 
1612  DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1613  DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1614 
1615  virtual void PrintDataTo(StringStream* stream);
1616  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1617 };
1618 
1619 
1620 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1621  public:
1622  LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key) {
1623  inputs_[0] = context;
1624  inputs_[1] = object;
1625  inputs_[2] = key;
1626  }
1627 
1628  LOperand* context() { return inputs_[0]; }
1629  LOperand* object() { return inputs_[1]; }
1630  LOperand* key() { return inputs_[2]; }
1631 
1632  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1633 };
1634 
1635 
1636 class LLoadGlobalCell V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1637  public:
1638  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1639  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1640 };
1641 
1642 
1643 class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1644  public:
1645  LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
1646  inputs_[0] = context;
1647  inputs_[1] = global_object;
1648  }
1649 
1650  LOperand* context() { return inputs_[0]; }
1651  LOperand* global_object() { return inputs_[1]; }
1652 
1653  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1654  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1655 
1656  Handle<Object> name() const { return hydrogen()->name(); }
1657  bool for_typeof() const { return hydrogen()->for_typeof(); }
1658 };
1659 
1660 
1661 class LStoreGlobalCell V8_FINAL : public LTemplateInstruction<0, 1, 1> {
1662  public:
1664  inputs_[0] = value;
1665  temps_[0] = temp;
1666  }
1667 
1668  LOperand* value() { return inputs_[0]; }
1669  LOperand* temp() { return temps_[0]; }
1670 
1671  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1672  DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
1673 };
1674 
1675 
1676 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1677  public:
1678  explicit LLoadContextSlot(LOperand* context) {
1679  inputs_[0] = context;
1680  }
1681 
1682  LOperand* context() { return inputs_[0]; }
1683 
1684  DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1685  DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1686 
1687  int slot_index() { return hydrogen()->slot_index(); }
1688 
1689  virtual void PrintDataTo(StringStream* stream);
1690 };
1691 
1692 
1693 class LStoreContextSlot V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1694  public:
1696  inputs_[0] = context;
1697  inputs_[1] = value;
1698  }
1699 
1700  LOperand* context() { return inputs_[0]; }
1701  LOperand* value() { return inputs_[1]; }
1702 
1703  DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1704  DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1705 
1706  int slot_index() { return hydrogen()->slot_index(); }
1707 
1708  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1709 };
1710 
1711 
1712 class LPushArgument V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1713  public:
1714  explicit LPushArgument(LOperand* value) {
1715  inputs_[0] = value;
1716  }
1717 
1718  LOperand* value() { return inputs_[0]; }
1719 
1720  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1721 };
1722 
1723 
1724 class LDrop V8_FINAL : public LTemplateInstruction<0, 0, 0> {
1725  public:
1726  explicit LDrop(int count) : count_(count) { }
1727 
1728  int count() const { return count_; }
1729 
1730  DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
1731 
1732  private:
1733  int count_;
1734 };
1735 
1736 
1737 class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 1, 1> {
1738  public:
1739  LStoreCodeEntry(LOperand* function, LOperand* code_object) {
1740  inputs_[0] = function;
1741  temps_[0] = code_object;
1742  }
1743 
1744  LOperand* function() { return inputs_[0]; }
1745  LOperand* code_object() { return temps_[0]; }
1746 
1747  virtual void PrintDataTo(StringStream* stream);
1748 
1749  DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
1750  DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
1751 };
1752 
1753 
1754 class LInnerAllocatedObject V8_FINAL: public LTemplateInstruction<1, 2, 0> {
1755  public:
1756  LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
1757  inputs_[0] = base_object;
1758  inputs_[1] = offset;
1759  }
1760 
1761  LOperand* base_object() const { return inputs_[0]; }
1762  LOperand* offset() const { return inputs_[1]; }
1763 
1764  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1765 
1766  DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
1767 };
1768 
1769 
1770 class LThisFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1771  public:
1772  DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1773  DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
1774 };
1775 
1776 
1777 class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1778  public:
1781 };
1782 
1783 
1784 class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1785  public:
1786  explicit LDeclareGlobals(LOperand* context) {
1787  inputs_[0] = context;
1788  }
1789 
1790  LOperand* context() { return inputs_[0]; }
1791 
1792  DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1793  DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1794 };
1795 
1796 
1797 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1798  public:
1799  explicit LCallJSFunction(LOperand* function) {
1800  inputs_[0] = function;
1801  }
1802 
1803  LOperand* function() { return inputs_[0]; }
1804 
1805  DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
1806  DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
1807 
1808  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1809 
1810  int arity() const { return hydrogen()->argument_count() - 1; }
1811 };
1812 
1813 
1814 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
1815  public:
1817  ZoneList<LOperand*>& operands,
1818  Zone* zone)
1819  : descriptor_(descriptor),
1820  inputs_(descriptor->environment_length() + 1, zone) {
1821  ASSERT(descriptor->environment_length() + 1 == operands.length());
1822  inputs_.AddAll(operands, zone);
1823  }
1824 
1825  LOperand* target() const { return inputs_[0]; }
1826 
1827  const CallInterfaceDescriptor* descriptor() { return descriptor_; }
1828 
1829  private:
1830  DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1831  DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1832 
1833  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1834 
1835  int arity() const { return hydrogen()->argument_count() - 1; }
1836 
1837  const CallInterfaceDescriptor* descriptor_;
1838  ZoneList<LOperand*> inputs_;
1839 
1840  // Iterator support.
1841  virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
1842  virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
1843 
1844  virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
1845  virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
1846 };
1847 
1848 
1849 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1850  public:
1851  LInvokeFunction(LOperand* context, LOperand* function) {
1852  inputs_[0] = context;
1853  inputs_[1] = function;
1854  }
1855 
1856  LOperand* context() { return inputs_[0]; }
1857  LOperand* function() { return inputs_[1]; }
1858 
1859  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1860  DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1861 
1862  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1863 
1864  int arity() const { return hydrogen()->argument_count() - 1; }
1865 };
1866 
1867 
1868 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1869  public:
1870  LCallFunction(LOperand* context, LOperand* function) {
1871  inputs_[0] = context;
1872  inputs_[1] = function;
1873  }
1874 
1875  LOperand* context() { return inputs_[0]; }
1876  LOperand* function() { return inputs_[1]; }
1877 
1878  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1879  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1880 
1881  int arity() const { return hydrogen()->argument_count() - 1; }
1882 };
1883 
1884 
1885 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1886  public:
1887  LCallNew(LOperand* context, LOperand* constructor) {
1888  inputs_[0] = context;
1889  inputs_[1] = constructor;
1890  }
1891 
1892  LOperand* context() { return inputs_[0]; }
1893  LOperand* constructor() { return inputs_[1]; }
1894 
1895  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1896  DECLARE_HYDROGEN_ACCESSOR(CallNew)
1897 
1898  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1899 
1900  int arity() const { return hydrogen()->argument_count() - 1; }
1901 };
1902 
1903 
1904 class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1905  public:
1906  LCallNewArray(LOperand* context, LOperand* constructor) {
1907  inputs_[0] = context;
1908  inputs_[1] = constructor;
1909  }
1910 
1911  LOperand* context() { return inputs_[0]; }
1912  LOperand* constructor() { return inputs_[1]; }
1913 
1914  DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
1915  DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
1916 
1917  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1918 
1919  int arity() const { return hydrogen()->argument_count() - 1; }
1920 };
1921 
1922 
1923 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1924  public:
1925  explicit LCallRuntime(LOperand* context) {
1926  inputs_[0] = context;
1927  }
1928 
1929  LOperand* context() { return inputs_[0]; }
1930 
1931  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1932  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1933 
1934  virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
1935  return save_doubles() == kDontSaveFPRegs;
1936  }
1937 
1938  const Runtime::Function* function() const { return hydrogen()->function(); }
1939  int arity() const { return hydrogen()->argument_count(); }
1940  SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1941 };
1942 
1943 
1944 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1945  public:
1946  explicit LInteger32ToDouble(LOperand* value) {
1947  inputs_[0] = value;
1948  }
1949 
1950  LOperand* value() { return inputs_[0]; }
1951 
1952  DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1953 };
1954 
1955 
1956 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1957  public:
1958  explicit LUint32ToDouble(LOperand* value) {
1959  inputs_[0] = value;
1960  }
1961 
1962  LOperand* value() { return inputs_[0]; }
1963 
1964  DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
1965 };
1966 
1967 
1968 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
1969  public:
1970  LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) {
1971  inputs_[0] = value;
1972  temps_[0] = temp1;
1973  temps_[1] = temp2;
1974  }
1975 
1976  LOperand* value() { return inputs_[0]; }
1977  LOperand* temp1() { return temps_[0]; }
1978  LOperand* temp2() { return temps_[1]; }
1979 
1980  DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1981 };
1982 
1983 
1984 class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> {
1985  public:
1986  LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) {
1987  inputs_[0] = value;
1988  temps_[0] = temp1;
1989  temps_[1] = temp2;
1990  }
1991 
1992  LOperand* value() { return inputs_[0]; }
1993  LOperand* temp1() { return temps_[0]; }
1994  LOperand* temp2() { return temps_[1]; }
1995 
1996  DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
1997 };
1998 
1999 
2000 class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 2> {
2001  public:
2002  LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) {
2003  inputs_[0] = value;
2004  temps_[0] = temp;
2005  temps_[1] = temp2;
2006  }
2007 
2008  LOperand* value() { return inputs_[0]; }
2009  LOperand* temp() { return temps_[0]; }
2010  LOperand* temp2() { return temps_[1]; }
2011 
2012  DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
2014 };
2015 
2016 
2017 class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2018  public:
2019  explicit LDoubleToSmi(LOperand* value) {
2020  inputs_[0] = value;
2021  }
2022 
2023  LOperand* value() { return inputs_[0]; }
2024 
2025  DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi")
2026  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2027 
2028  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2029 };
2030 
2031 
2032 // Sometimes truncating conversion from a tagged value to an int32.
2033 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2034  public:
2035  explicit LDoubleToI(LOperand* value) {
2036  inputs_[0] = value;
2037  }
2038 
2039  LOperand* value() { return inputs_[0]; }
2040 
2041  DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
2042  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2043 
2044  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2045 };
2046 
2047 
2048 // Truncating conversion from a tagged value to an int32.
2049 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
2050  public:
2052  LOperand* temp,
2053  LOperand* temp2) {
2054  inputs_[0] = value;
2055  temps_[0] = temp;
2056  temps_[1] = temp2;
2057  }
2058 
2059  LOperand* value() { return inputs_[0]; }
2060  LOperand* temp() { return temps_[0]; }
2061  LOperand* temp2() { return temps_[1]; }
2062 
2063  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2065 
2066  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2067 };
2068 
2069 
2070 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2071  public:
2072  explicit LSmiTag(LOperand* value) {
2073  inputs_[0] = value;
2074  }
2075 
2076  LOperand* value() { return inputs_[0]; }
2077 
2078  DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
2080 };
2081 
2082 
2083 class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2084  public:
2085  explicit LNumberUntagD(LOperand* value) {
2086  inputs_[0] = value;
2087  }
2088 
2089  LOperand* value() { return inputs_[0]; }
2090 
2091  DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
2093 };
2094 
2095 
2096 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2097  public:
2098  LSmiUntag(LOperand* value, bool needs_check)
2099  : needs_check_(needs_check) {
2100  inputs_[0] = value;
2101  }
2102 
2103  LOperand* value() { return inputs_[0]; }
2104  bool needs_check() const { return needs_check_; }
2105 
2106  DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
2107 
2108  private:
2109  bool needs_check_;
2110 };
2111 
2112 
2113 class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 1> {
2114  public:
2115  LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
2116  inputs_[0] = object;
2117  inputs_[1] = value;
2118  temps_[0] = temp;
2119  }
2120 
2121  LOperand* object() { return inputs_[0]; }
2122  LOperand* value() { return inputs_[1]; }
2123  LOperand* temp() { return temps_[0]; }
2124 
2125  DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
2126  DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
2127 
2128  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2129 
2130  Handle<Map> transition() const { return hydrogen()->transition_map(); }
2132  return hydrogen()->field_representation();
2133  }
2134 };
2135 
2136 
2137 class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2138  public:
2139  LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
2140  inputs_[0] = context;
2141  inputs_[1] = object;
2142  inputs_[2] = value;
2143  }
2144 
2145  LOperand* context() { return inputs_[0]; }
2146  LOperand* object() { return inputs_[1]; }
2147  LOperand* value() { return inputs_[2]; }
2148 
2149  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2150  DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
2151 
2152  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2153 
2154  Handle<Object> name() const { return hydrogen()->name(); }
2155  StrictMode strict_mode() { return hydrogen()->strict_mode(); }
2156 };
2157 
2158 
2159 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2160  public:
2161  LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) {
2162  inputs_[0] = object;
2163  inputs_[1] = key;
2164  inputs_[2] = value;
2165  }
2166 
2167  bool is_external() const { return hydrogen()->is_external(); }
2168  bool is_fixed_typed_array() const {
2169  return hydrogen()->is_fixed_typed_array();
2170  }
2171  bool is_typed_elements() const {
2172  return is_external() || is_fixed_typed_array();
2173  }
2174  LOperand* elements() { return inputs_[0]; }
2175  LOperand* key() { return inputs_[1]; }
2176  LOperand* value() { return inputs_[2]; }
2178  return hydrogen()->elements_kind();
2179  }
2180 
2181  DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
2182  DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2183 
2184  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2185  bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
2186  uint32_t additional_index() const { return hydrogen()->index_offset(); }
2187 };
2188 
2189 
2190 class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> {
2191  public:
2193  LOperand* obj,
2194  LOperand* key,
2195  LOperand* value) {
2196  inputs_[0] = context;
2197  inputs_[1] = obj;
2198  inputs_[2] = key;
2199  inputs_[3] = value;
2200  }
2201 
2202  LOperand* context() { return inputs_[0]; }
2203  LOperand* object() { return inputs_[1]; }
2204  LOperand* key() { return inputs_[2]; }
2205  LOperand* value() { return inputs_[3]; }
2206 
2207  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2208  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
2209 
2210  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2211 
2212  StrictMode strict_mode() { return hydrogen()->strict_mode(); }
2213 };
2214 
2215 
2216 class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> {
2217  public:
2219  LOperand* context,
2220  LOperand* new_map_temp) {
2221  inputs_[0] = object;
2222  inputs_[1] = context;
2223  temps_[0] = new_map_temp;
2224  }
2225 
2226  LOperand* context() { return inputs_[1]; }
2227  LOperand* object() { return inputs_[0]; }
2228  LOperand* new_map_temp() { return temps_[0]; }
2229 
2230  DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2231  "transition-elements-kind")
2232  DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2233 
2234  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2235 
2236  Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2238  return hydrogen()->transitioned_map().handle();
2239  }
2240  ElementsKind from_kind() { return hydrogen()->from_kind(); }
2241  ElementsKind to_kind() { return hydrogen()->to_kind(); }
2242 };
2243 
2244 
2245 class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
2246  public:
2248  LOperand* temp) {
2249  inputs_[0] = object;
2250  temps_[0] = temp;
2251  }
2252 
2253  LOperand* object() { return inputs_[0]; }
2254  LOperand* temp() { return temps_[0]; }
2255 
2256  DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento,
2257  "trap-allocation-memento")
2258 };
2259 
2260 
2261 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2262  public:
2263  LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2264  inputs_[0] = context;
2265  inputs_[1] = left;
2266  inputs_[2] = right;
2267  }
2268 
2269  LOperand* context() { return inputs_[0]; }
2270  LOperand* left() { return inputs_[1]; }
2271  LOperand* right() { return inputs_[2]; }
2272 
2273  DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2274  DECLARE_HYDROGEN_ACCESSOR(StringAdd)
2275 };
2276 
2277 
2278 
2279 class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2280  public:
2281  LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2282  inputs_[0] = context;
2283  inputs_[1] = string;
2284  inputs_[2] = index;
2285  }
2286 
2287  LOperand* context() { return inputs_[0]; }
2288  LOperand* string() { return inputs_[1]; }
2289  LOperand* index() { return inputs_[2]; }
2290 
2291  DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2292  DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2293 };
2294 
2295 
2296 class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2297  public:
2298  explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
2299  inputs_[0] = context;
2300  inputs_[1] = char_code;
2301  }
2302 
2303  LOperand* context() { return inputs_[0]; }
2304  LOperand* char_code() { return inputs_[1]; }
2305 
2306  DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2307  DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
2308 };
2309 
2310 
2311 class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2312  public:
2313  explicit LCheckValue(LOperand* value) {
2314  inputs_[0] = value;
2315  }
2316 
2317  LOperand* value() { return inputs_[0]; }
2318 
2319  DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
2320  DECLARE_HYDROGEN_ACCESSOR(CheckValue)
2321 };
2322 
2323 
2324 class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2325  public:
2326  explicit LCheckInstanceType(LOperand* value) {
2327  inputs_[0] = value;
2328  }
2329 
2330  LOperand* value() { return inputs_[0]; }
2331 
2332  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
2333  DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
2334 };
2335 
2336 
2337 class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2338  public:
2339  explicit LCheckMaps(LOperand* value) {
2340  inputs_[0] = value;
2341  }
2342 
2343  LOperand* value() { return inputs_[0]; }
2344 
2345  DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
2346  DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
2347 };
2348 
2349 
2350 class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2351  public:
2352  explicit LCheckSmi(LOperand* value) {
2353  inputs_[0] = value;
2354  }
2355 
2356  LOperand* value() { return inputs_[0]; }
2357 
2358  DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
2359 };
2360 
2361 
2362 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2363  public:
2364  explicit LCheckNonSmi(LOperand* value) {
2365  inputs_[0] = value;
2366  }
2367 
2368  LOperand* value() { return inputs_[0]; }
2369 
2370  DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2371  DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
2372 };
2373 
2374 
2375 class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
2376  public:
2377  LClampDToUint8(LOperand* unclamped, LOperand* temp) {
2378  inputs_[0] = unclamped;
2379  temps_[0] = temp;
2380  }
2381 
2382  LOperand* unclamped() { return inputs_[0]; }
2383  LOperand* temp() { return temps_[0]; }
2384 
2385  DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
2386 };
2387 
2388 
2389 class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2390  public:
2391  explicit LClampIToUint8(LOperand* unclamped) {
2392  inputs_[0] = unclamped;
2393  }
2394 
2395  LOperand* unclamped() { return inputs_[0]; }
2396 
2397  DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
2398 };
2399 
2400 
2401 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
2402  public:
2403  LClampTToUint8(LOperand* unclamped, LOperand* temp) {
2404  inputs_[0] = unclamped;
2405  temps_[0] = temp;
2406  }
2407 
2408  LOperand* unclamped() { return inputs_[0]; }
2409  LOperand* temp() { return temps_[0]; }
2410 
2411  DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2412 };
2413 
2414 
2415 class LDoubleBits V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2416  public:
2417  explicit LDoubleBits(LOperand* value) {
2418  inputs_[0] = value;
2419  }
2420 
2421  LOperand* value() { return inputs_[0]; }
2422 
2423  DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits")
2424  DECLARE_HYDROGEN_ACCESSOR(DoubleBits)
2425 };
2426 
2427 
2428 class LConstructDouble V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2429  public:
2431  inputs_[0] = hi;
2432  inputs_[1] = lo;
2433  }
2434 
2435  LOperand* hi() { return inputs_[0]; }
2436  LOperand* lo() { return inputs_[1]; }
2437 
2438  DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double")
2439 };
2440 
2441 
2442 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> {
2443  public:
2445  LOperand* size,
2446  LOperand* temp1,
2447  LOperand* temp2) {
2448  inputs_[0] = context;
2449  inputs_[1] = size;
2450  temps_[0] = temp1;
2451  temps_[1] = temp2;
2452  }
2453 
2454  LOperand* context() { return inputs_[0]; }
2455  LOperand* size() { return inputs_[1]; }
2456  LOperand* temp1() { return temps_[0]; }
2457  LOperand* temp2() { return temps_[1]; }
2458 
2459  DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
2460  DECLARE_HYDROGEN_ACCESSOR(Allocate)
2461 };
2462 
2463 
2464 class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2465  public:
2466  explicit LRegExpLiteral(LOperand* context) {
2467  inputs_[0] = context;
2468  }
2469 
2470  LOperand* context() { return inputs_[0]; }
2471 
2472  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2473  DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
2474 };
2475 
2476 
2477 class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2478  public:
2479  explicit LFunctionLiteral(LOperand* context) {
2480  inputs_[0] = context;
2481  }
2482 
2483  LOperand* context() { return inputs_[0]; }
2484 
2485  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
2486  DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
2487 };
2488 
2489 
2490 class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2491  public:
2492  explicit LToFastProperties(LOperand* value) {
2493  inputs_[0] = value;
2494  }
2495 
2496  LOperand* value() { return inputs_[0]; }
2497 
2498  DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2499  DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2500 };
2501 
2502 
2503 class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2504  public:
2505  LTypeof(LOperand* context, LOperand* value) {
2506  inputs_[0] = context;
2507  inputs_[1] = value;
2508  }
2509 
2510  LOperand* context() { return inputs_[0]; }
2511  LOperand* value() { return inputs_[1]; }
2512 
2513  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2514 };
2515 
2516 
2517 class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 0> {
2518  public:
2519  explicit LTypeofIsAndBranch(LOperand* value) {
2520  inputs_[0] = value;
2521  }
2522 
2523  LOperand* value() { return inputs_[0]; }
2524 
2525  DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2526  DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2527 
2528  Handle<String> type_literal() { return hydrogen()->type_literal(); }
2529 
2530  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2531 };
2532 
2533 
2534 class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 1> {
2535  public:
2537  temps_[0] = temp;
2538  }
2539 
2540  LOperand* temp() { return temps_[0]; }
2541 
2542  DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2543  "is-construct-call-and-branch")
2544 };
2545 
2546 
2547 class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> {
2548  public:
2550 
2551  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
2552  return false;
2553  }
2554  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2555 };
2556 
2557 
2558 class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2559  public:
2560  explicit LStackCheck(LOperand* context) {
2561  inputs_[0] = context;
2562  }
2563 
2564  LOperand* context() { return inputs_[0]; }
2565 
2566  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2567  DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2568 
2569  Label* done_label() { return &done_label_; }
2570 
2571  private:
2572  Label done_label_;
2573 };
2574 
2575 
2576 class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2577  public:
2578  LForInPrepareMap(LOperand* context, LOperand* object) {
2579  inputs_[0] = context;
2580  inputs_[1] = object;
2581  }
2582 
2583  LOperand* context() { return inputs_[0]; }
2584  LOperand* object() { return inputs_[1]; }
2585 
2586  DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2587 };
2588 
2589 
2590 class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2591  public:
2593  inputs_[0] = map;
2594  }
2595 
2596  LOperand* map() { return inputs_[0]; }
2597 
2598  DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2599 
2600  int idx() {
2601  return HForInCacheArray::cast(this->hydrogen_value())->idx();
2602  }
2603 };
2604 
2605 
2606 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 0> {
2607  public:
2609  inputs_[0] = value;
2610  inputs_[1] = map;
2611  }
2612 
2613  LOperand* value() { return inputs_[0]; }
2614  LOperand* map() { return inputs_[1]; }
2615 
2616  DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2617 };
2618 
2619 
2620 class LLoadFieldByIndex V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2621  public:
2623  inputs_[0] = object;
2624  inputs_[1] = index;
2625  }
2626 
2627  LOperand* object() { return inputs_[0]; }
2628  LOperand* index() { return inputs_[1]; }
2629 
2630  DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2631 };
2632 
2633 
2634 class LChunkBuilder;
2635 class LPlatformChunk V8_FINAL : public LChunk {
2636  public:
2638  : LChunk(info, graph) { }
2639 
2640  int GetNextSpillIndex(RegisterKind kind);
2641  LOperand* GetNextSpillSlot(RegisterKind kind);
2642 };
2643 
2644 
2645 class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
2646  public:
2647  LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2648  : LChunkBuilderBase(graph->zone()),
2649  chunk_(NULL),
2650  info_(info),
2651  graph_(graph),
2652  status_(UNUSED),
2653  current_instruction_(NULL),
2654  current_block_(NULL),
2655  next_block_(NULL),
2656  allocator_(allocator) { }
2657 
2658  // Build the sequence for the graph.
2659  LPlatformChunk* Build();
2660 
2661  LInstruction* CheckElideControlInstruction(HControlInstruction* instr);
2662 
2663  // Declare methods that deal with the individual node types.
2664 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2666 #undef DECLARE_DO
2667 
2668  LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
2669 
2670  static bool HasMagicNumberForDivisor(int32_t divisor);
2671 
2672  LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2673  LInstruction* DoMathRound(HUnaryMathOperation* instr);
2674  LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2675  LInstruction* DoMathLog(HUnaryMathOperation* instr);
2676  LInstruction* DoMathExp(HUnaryMathOperation* instr);
2677  LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2678  LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2679  LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2680  LInstruction* DoDivByPowerOf2I(HDiv* instr);
2681  LInstruction* DoDivByConstI(HDiv* instr);
2682  LInstruction* DoDivI(HBinaryOperation* instr);
2683  LInstruction* DoModByPowerOf2I(HMod* instr);
2684  LInstruction* DoModByConstI(HMod* instr);
2685  LInstruction* DoModI(HMod* instr);
2686  LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2687  LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2688 
2689  private:
2690  enum Status {
2691  UNUSED,
2692  BUILDING,
2693  DONE,
2694  ABORTED
2695  };
2696 
2697  LPlatformChunk* chunk() const { return chunk_; }
2698  CompilationInfo* info() const { return info_; }
2699  HGraph* graph() const { return graph_; }
2700 
2701  bool is_unused() const { return status_ == UNUSED; }
2702  bool is_building() const { return status_ == BUILDING; }
2703  bool is_done() const { return status_ == DONE; }
2704  bool is_aborted() const { return status_ == ABORTED; }
2705 
2706  void Abort(BailoutReason reason);
2707 
2708  // Methods for getting operands for Use / Define / Temp.
2709  LUnallocated* ToUnallocated(Register reg);
2710  LUnallocated* ToUnallocated(DoubleRegister reg);
2711 
2712  // Methods for setting up define-use relationships.
2713  MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2714  MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2715  MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2716  DoubleRegister fixed_register);
2717 
2718  // A value that is guaranteed to be allocated to a register.
2719  // Operand created by UseRegister is guaranteed to be live until the end of
2720  // instruction. This means that register allocator will not reuse it's
2721  // register for any other operand inside instruction.
2722  // Operand created by UseRegisterAtStart is guaranteed to be live only at
2723  // instruction start. Register allocator is free to assign the same register
2724  // to some other operand used inside instruction (i.e. temporary or
2725  // output).
2726  MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2727  MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2728 
2729  // An input operand in a register that may be trashed.
2730  MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2731 
2732  // An input operand in a register or stack slot.
2733  MUST_USE_RESULT LOperand* Use(HValue* value);
2734  MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2735 
2736  // An input operand in a register, stack slot or a constant operand.
2737  MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2738  MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2739 
2740  // An input operand in a register or a constant operand.
2741  MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2742  MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2743 
2744  // An input operand in a constant operand.
2745  MUST_USE_RESULT LOperand* UseConstant(HValue* value);
2746 
2747  // An input operand in register, stack slot or a constant operand.
2748  // Will not be moved to a register even if one is freely available.
2749  virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE;
2750 
2751  // Temporary operand that must be in a register.
2752  MUST_USE_RESULT LUnallocated* TempRegister();
2753  MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2754  MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
2755 
2756  // Methods for setting up define-use relationships.
2757  // Return the same instruction that they are passed.
2758  LInstruction* Define(LTemplateResultInstruction<1>* instr,
2759  LUnallocated* result);
2760  LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
2761  LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
2762  int index);
2763  LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
2764  LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
2765  Register reg);
2766  LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
2767  DoubleRegister reg);
2768  LInstruction* AssignEnvironment(LInstruction* instr);
2769  LInstruction* AssignPointerMap(LInstruction* instr);
2770 
2771  enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2772 
2773  // By default we assume that instruction sequences generated for calls
2774  // cannot deoptimize eagerly and we do not attach environment to this
2775  // instruction.
2776  LInstruction* MarkAsCall(
2777  LInstruction* instr,
2778  HInstruction* hinstr,
2779  CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2780 
2781  void VisitInstruction(HInstruction* current);
2782 
2783  void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2784  LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2785  LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2786  LInstruction* DoArithmeticD(Token::Value op,
2787  HArithmeticBinaryOperation* instr);
2788  LInstruction* DoArithmeticT(Token::Value op,
2789  HBinaryOperation* instr);
2790 
2791  LPlatformChunk* chunk_;
2792  CompilationInfo* info_;
2793  HGraph* const graph_;
2794  Status status_;
2795  HInstruction* current_instruction_;
2796  HBasicBlock* current_block_;
2797  HBasicBlock* next_block_;
2798  LAllocator* allocator_;
2799 
2800  DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2801 };
2802 
2803 #undef DECLARE_HYDROGEN_ACCESSOR
2804 #undef DECLARE_CONCRETE_INSTRUCTION
2805 
2806 } } // namespace v8::internal
2807 
2808 #endif // V8_MIPS_LITHIUM_MIPS_H_
LCallFunction(LOperand *context, LOperand *function)
LSeqStringSetChar(LOperand *context, LOperand *string, LOperand *index, LOperand *value)
#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
Definition: lithium-mips.h:43
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
Definition: flags.cc:269
LLoadFieldByIndex(LOperand *object, LOperand *index)
virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment *env) V8_OVERRIDE
LBranch(LOperand *value)
virtual Opcode opcode() const V8_OVERRIDE
LCmpObjectEqAndBranch(LOperand *left, LOperand *right)
Definition: lithium-mips.h:945
static LGap * cast(LInstruction *instr)
Definition: lithium-mips.h:346
virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment *env)
Definition: lithium-mips.h:253
LMathFloor(LOperand *value, LOperand *temp)
Definition: lithium-mips.h:828
LClassOfTestAndBranch(LOperand *value, LOperand *temp)
LPower(LOperand *left, LOperand *right)
LModI(LOperand *left, LOperand *right)
Definition: lithium-mips.h:660
void set_pointer_map(LPointerMap *p)
Definition: lithium-mips.h:246
bool IsMarkedAsCall() const
Definition: lithium-mips.h:264
virtual bool HasInterestingComment(LCodeGen *gen) const V8_OVERRIDE
Definition: lithium-mips.h:385
LCheckInstanceType(LOperand *value)
LUint32ToDouble(LOperand *value)
LMultiplyAddD(LOperand *addend, LOperand *multiplier, LOperand *multiplicand)
Definition: lithium-mips.h:782
LMathPowHalf(LOperand *value, LOperand *temp)
Definition: lithium-mips.h:931
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
Definition: flags.cc:350
void set_environment(LEnvironment *env)
Definition: lithium-mips.h:242
LSmiTag(LOperand *value)
virtual void PrintDataTo(StringStream *stream) V8_OVERRIDE
Definition: lithium-arm.cc:124
virtual void PrintOutputOperandTo(StringStream *stream)
Definition: lithium-arm.cc:99
EmbeddedContainer< LOperand *, T > temps_
Definition: lithium-arm.h:324
LMathClz32(LOperand *value)
Definition: lithium-mips.h:885
LLoadKeyedGeneric(LOperand *context, LOperand *object, LOperand *key)
Definition: v8.h:1407
LForInCacheArray(LOperand *map)
static Smi * FromInt(int value)
Definition: objects-inl.h:1209
LInstanceOf(LOperand *context, LOperand *left, LOperand *right)
#define DECLARE_OPCODE(type)
Definition: lithium-mips.h:222
LParallelMove * GetOrCreateParallelMove(InnerPosition pos, Zone *zone)
Definition: lithium-mips.h:364
bool is_loop_header() const
Definition: lithium-mips.h:461
LStringAdd(LOperand *context, LOperand *left, LOperand *right)
LDummyUse(LOperand *value)
Definition: lithium-mips.h:434
LLabel(HBasicBlock *block)
Definition: lithium-mips.h:450
bool needs_check() const
Smi * index() const
LStoreNamedGeneric(LOperand *context, LOperand *object, LOperand *value)
LAllocate(LOperand *context, LOperand *size, LOperand *temp1, LOperand *temp2)
LBoundsCheck(LOperand *index, LOperand *length)
int int32_t
Definition: unicode.cc:47
#define DECLARE_DO(type)
LIsConstructCallAndBranch(LOperand *temp)
LEnvironment * environment() const
Definition: lithium-mips.h:243
StrictMode strict_mode()
LArithmeticD(Token::Value op, LOperand *left, LOperand *right)
#define ASSERT(condition)
Definition: checks.h:329
LArithmeticT(Token::Value op, LOperand *context, LOperand *left, LOperand *right)
bool is_typed_elements() const
LConstantOperand * constant_parameter_count()
virtual bool IsGap() const V8_FINAL V8_OVERRIDE
Definition: lithium-mips.h:344
LStringCharCodeAt(LOperand *context, LOperand *string, LOperand *index)
LIsStringAndBranch(LOperand *value, LOperand *temp)
virtual const char * Mnemonic() const =0
LChunkBuilder(CompilationInfo *info, HGraph *graph, LAllocator *allocator)
LNumberTagU(LOperand *value, LOperand *temp1, LOperand *temp2)
LCallStub(LOperand *context)
Definition: lithium-mips.h:485
LCallRuntime(LOperand *context)
LAddI(LOperand *left, LOperand *right)
LTransitionElementsKind(LOperand *object, LOperand *context, LOperand *new_map_temp)
LTypeofIsAndBranch(LOperand *value)
EmbeddedContainer< LOperand *, R > results_
Definition: lithium-arm.h:313
LCmpT(LOperand *context, LOperand *left, LOperand *right)
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:86
LCheckMapValue(LOperand *value, LOperand *map)
LFlooringDivByPowerOf2I(LOperand *dividend, int32_t divisor)
Definition: lithium-mips.h:727
LCheckMaps(LOperand *value)
LCallNewArray(LOperand *context, LOperand *constructor)
LOperand * parameter_count()
virtual bool ClobbersDoubleRegisters() const
Definition: lithium-mips.h:261
#define DECLARE_PREDICATE(type)
Definition: lithium-mips.h:231
LCallJSFunction(LOperand *function)
Label * FalseLabel(LChunk *chunk)
Definition: lithium-mips.h:528
LFlooringDivByConstI(LOperand *dividend, int32_t divisor, LOperand *temp)
Definition: lithium-mips.h:746
Token::Value op() const
Representation representation() const
LOperand * target() const
LOperand * multiplicand()
Definition: lithium-mips.h:791
virtual LOperand * result() const =0
virtual bool HasInterestingComment(LCodeGen *gen) const
Definition: lithium-mips.h:272
LStoreContextSlot(LOperand *context, LOperand *value)
void set(T *value)
Definition: utils.h:515
LClampIToUint8(LOperand *unclamped)
LGetCachedArrayIndex(LOperand *value)
LBitI(LOperand *left, LOperand *right)
LGoto(HBasicBlock *block)
Definition: lithium-mips.h:395
LAccessArgumentsAt(LOperand *arguments, LOperand *length, LOperand *index)
Definition: lithium-mips.h:587
LDoubleToSmi(LOperand *value)
void set_hydrogen_value(HValue *value)
Definition: lithium-mips.h:250
int32_t divisor() const
Definition: lithium-mips.h:630
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
LLoadContextSlot(LOperand *context)
#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)
Definition: lithium-mips.h:184
LIsSmiAndBranch(LOperand *value)
LCmpHoleAndBranch(LOperand *object)
Definition: lithium-mips.h:960
virtual bool HasResult() const =0
LDoubleToI(LOperand *value)
DwVfpRegister DoubleRegister
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
Definition: flags.cc:211
LOperand * base_object() const
virtual Opcode opcode() const =0
LTypeof(LOperand *context, LOperand *value)
LModByPowerOf2I(LOperand *dividend, int32_t divisor)
Definition: lithium-mips.h:624
#define MUST_USE_RESULT
Definition: globals.h:381
LCallNew(LOperand *context, LOperand *constructor)
LMathAbs(LOperand *context, LOperand *value)
Definition: lithium-mips.h:858
LCheckValue(LOperand *value)
LPlatformChunk(CompilationInfo *info, HGraph *graph)
ElementsKind from_kind()
int TrueDestination(LChunk *chunk)
Definition: lithium-mips.h:515
bool can_deopt() const
LNumberTagD(LOperand *value, LOperand *temp, LOperand *temp2)
LOperand * new_map_temp()
HBasicBlock * SuccessorAt(int i)
Definition: lithium-mips.h:513
virtual bool IsControl() const V8_FINAL V8_OVERRIDE
Definition: lithium-mips.h:510
LCmpMapAndBranch(LOperand *value, LOperand *temp)
LClampDToUint8(LOperand *unclamped, LOperand *temp)
LDeclareGlobals(LOperand *context)
bool HasEnvironment() const
Definition: lithium-mips.h:244
LArgumentsLength(LOperand *elements)
Definition: lithium-mips.h:605
LTaggedToI(LOperand *value, LOperand *temp, LOperand *temp2)
LCompareNumericAndBranch(LOperand *left, LOperand *right)
Definition: lithium-mips.h:805
ElementsKind elements_kind() const
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: globals.h:359
bool HasReplacement() const
Definition: lithium-mips.h:466
LMathSqrt(LOperand *value)
Definition: lithium-mips.h:919
LIsUndetectableAndBranch(LOperand *value, LOperand *temp)
LToFastProperties(LOperand *value)
LCompareMinusZeroAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-mips.h:973
LOperand * multiplier()
Definition: lithium-mips.h:790
LModByConstI(LOperand *dividend, int32_t divisor)
Definition: lithium-mips.h:642
LIsObjectAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-mips.h:989
DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,"compare-numeric-and-branch") Token bool is_double() const
Definition: lithium-mips.h:818
LMapEnumLength(LOperand *value)
HBasicBlock * block() const
Definition: lithium-arm.h:356
LMathExp(LOperand *value, LOperand *double_temp, LOperand *temp1, LOperand *temp2)
Definition: lithium-mips.h:897
LDateField(LOperand *date, LOperand *temp, Smi *index)
virtual void PrintTo(StringStream *stream)
Definition: lithium-arm.cc:67
LOperand * global_object()
LLoadKeyed(LOperand *elements, LOperand *key)
LDivByConstI(LOperand *dividend, int32_t divisor)
Definition: lithium-mips.h:694
LStoreKeyedGeneric(LOperand *context, LOperand *obj, LOperand *key, LOperand *value)
#define T(name, string, precedence)
Definition: token.cc:48
LReturn(LOperand *value, LOperand *context, LOperand *parameter_count)
LMathMinMax(LOperand *left, LOperand *right)
virtual bool IsControl() const
Definition: lithium-mips.h:240
LPointerMap * pointer_map() const
Definition: lithium-mips.h:247
void set_replacement(LLabel *label)
Definition: lithium-mips.h:465
LStoreCodeEntry(LOperand *function, LOperand *code_object)
LOperand * index() const
bool is_osr_entry() const
Definition: lithium-mips.h:462
ElementsKind to_kind()
EmbeddedContainer< LOperand *, I > inputs_
Definition: lithium-arm.h:323
LApplyArguments(LOperand *function, LOperand *receiver, LOperand *length, LOperand *elements)
Definition: lithium-mips.h:566
LOperand * offset() const
virtual bool IsGap() const
Definition: lithium-mips.h:238
bool for_typeof() const
const CallInterfaceDescriptor * descriptor()
#define V8_OVERRIDE
Definition: v8config.h:402
LMathLog(LOperand *value)
Definition: lithium-mips.h:873
LSeqStringGetChar(LOperand *string, LOperand *index)
LLoadNamedField(LOperand *object)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
Definition: flags.cc:317
LSubI(LOperand *left, LOperand *right)
LHasInstanceTypeAndBranch(LOperand *value)
LCheckSmi(LOperand *value)
Label * TrueLabel(LChunk *chunk)
Definition: lithium-mips.h:522
LNumberTagI(LOperand *value, LOperand *temp1, LOperand *temp2)
LShiftI(Token::Value op, LOperand *left, LOperand *right, bool can_deopt)
LCallWithDescriptor(const CallInterfaceDescriptor *descriptor, ZoneList< LOperand * > &operands, Zone *zone)
bool is_external() const
LNumberUntagD(LOperand *value)
virtual void CompileToNative(LCodeGen *generator)=0
#define DECLARE_HYDROGEN_ACCESSOR(type)
Definition: lithium-mips.h:198
LLabel * replacement() const
Definition: lithium-mips.h:464
LStoreGlobalCell(LOperand *value, LOperand *temp)
LDoubleBits(LOperand *value)
Handle< Map > transitioned_map()
LEnvironment * GetDeferredLazyDeoptimizationEnvironment()
virtual bool HasResult() const V8_FINAL V8_OVERRIDE
Definition: lithium-mips.h:303
uint32_t additional_index() const
LLoadNamedGeneric(LOperand *context, LOperand *object)
LMathRound(LOperand *value, LOperand *temp)
Definition: lithium-mips.h:843
LOperand * constructor()
LOperand * double_temp()
Definition: lithium-mips.h:911
LClampTToUint8(LOperand *unclamped, LOperand *temp)
LWrapReceiver(LOperand *receiver, LOperand *function)
Definition: lithium-mips.h:551
LCheckNonSmi(LOperand *value)
LParallelMove * GetParallelMove(InnerPosition pos)
Definition: lithium-mips.h:371
bool ClobbersRegisters() const
Definition: lithium-mips.h:260
LStringCompareAndBranch(LOperand *context, LOperand *left, LOperand *right)
LForInPrepareMap(LOperand *context, LOperand *object)
Label * GetAssemblyLabel(int block_id) const
Definition: lithium.cc:278
bool is_fixed_typed_array() const
HeapObject * obj
LInstructionGap(HBasicBlock *block)
Definition: lithium-mips.h:383
virtual Opcode opcode() const V8_FINAL
LPushArgument(LOperand *value)
LOperand * string() const
LStoreKeyed(LOperand *object, LOperand *key, LOperand *value)
LFunctionLiteral(LOperand *context)
LInvokeFunction(LOperand *context, LOperand *function)
LMulI(LOperand *left, LOperand *right)
Definition: lithium-mips.h:766
bool IsRedundant() const
Definition: lithium-arm.cc:113
LStackCheck(LOperand *context)
int LookupDestination(int block_id) const
Definition: lithium.cc:270
LInstanceOfKnownGlobal(LOperand *context, LOperand *value, LOperand *temp)
LStringCharFromCode(LOperand *context, LOperand *char_code)
LInnerAllocatedObject(LOperand *base_object, LOperand *offset)
LOperand * code_object()
LDivI(LOperand *left, LOperand *right)
Definition: lithium-mips.h:712
LStoreNamedField(LOperand *object, LOperand *value, LOperand *temp)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing 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 statistics of the maximum memory committed for the heap in name
Definition: flags.cc:505
static HValue * cast(HValue *value)
LLoadFunctionPrototype(LOperand *function)
LSmiUntag(LOperand *value, bool needs_check)
HValue * hydrogen_value() const
Definition: lithium-mips.h:251
LDivByPowerOf2I(LOperand *dividend, int32_t divisor)
Definition: lithium-mips.h:676
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,"instance-of-known-global") Handle< JSFunction > function() const
SaveFPRegsMode save_doubles() const
int FalseDestination(LChunk *chunk)
Definition: lithium-mips.h:518
LLoadGlobalGeneric(LOperand *context, LOperand *global_object)
LRegExpLiteral(LOperand *context)
LTrapAllocationMemento(LOperand *object, LOperand *temp)
LInteger32ToDouble(LOperand *value)
LGap(HBasicBlock *block)
Definition: lithium-mips.h:335
LHasCachedArrayIndexAndBranch(LOperand *value)
LConstructDouble(LOperand *hi, LOperand *lo)
bool is_set() const
Definition: utils.h:508