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-x64.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_X64_LITHIUM_X64_H_
29 #define V8_X64_LITHIUM_X64_H_
30 
31 #include "hydrogen.h"
32 #include "lithium-allocator.h"
33 #include "lithium.h"
34 #include "safepoint-table.h"
35 #include "utils.h"
36 
37 namespace v8 {
38 namespace internal {
39 
40 // Forward declarations.
41 class LCodeGen;
42 
43 #define LITHIUM_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(DoubleBits) \
93  V(DoubleToI) \
94  V(DoubleToSmi) \
95  V(Drop) \
96  V(DummyUse) \
97  V(Dummy) \
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(MathClz32) \
133  V(MathExp) \
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(NumberTagD) \
145  V(NumberTagI) \
146  V(NumberTagU) \
147  V(NumberUntagD) \
148  V(OsrEntry) \
149  V(Parameter) \
150  V(Power) \
151  V(PushArgument) \
152  V(RegExpLiteral) \
153  V(Return) \
154  V(SeqStringGetChar) \
155  V(SeqStringSetChar) \
156  V(ShiftI) \
157  V(SmiTag) \
158  V(SmiUntag) \
159  V(StackCheck) \
160  V(StoreCodeEntry) \
161  V(StoreContextSlot) \
162  V(StoreGlobalCell) \
163  V(StoreKeyed) \
164  V(StoreKeyedGeneric) \
165  V(StoreNamedField) \
166  V(StoreNamedGeneric) \
167  V(StringAdd) \
168  V(StringCharCodeAt) \
169  V(StringCharFromCode) \
170  V(StringCompareAndBranch) \
171  V(SubI) \
172  V(TaggedToI) \
173  V(ThisFunction) \
174  V(ToFastProperties) \
175  V(TransitionElementsKind) \
176  V(TrapAllocationMemento) \
177  V(Typeof) \
178  V(TypeofIsAndBranch) \
179  V(Uint32ToDouble) \
180  V(UnknownOSRValue) \
181  V(WrapReceiver)
182 
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  void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
254  bool IsCall() const { return IsCallBits::decode(bit_field_); }
255 
256  // Interface to the register allocator and iterators.
257  bool ClobbersTemps() const { return IsCall(); }
258  bool ClobbersRegisters() const { return IsCall(); }
259  virtual bool ClobbersDoubleRegisters() const { return IsCall(); }
260 
261  virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
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  virtual bool MustSignExtendResult(LPlatformChunk* chunk) const {
275  return false;
276  }
277 
278 #ifdef DEBUG
279  void VerifyCall();
280 #endif
281 
282  private:
283  // Iterator support.
284  friend class InputIterator;
285  virtual int InputCount() = 0;
286  virtual LOperand* InputAt(int i) = 0;
287 
288  friend class TempIterator;
289  virtual int TempCount() = 0;
290  virtual LOperand* TempAt(int i) = 0;
291 
292  class IsCallBits: public BitField<bool, 0, 1> {};
293 
294  LEnvironment* environment_;
295  SetOncePointer<LPointerMap> pointer_map_;
296  HValue* hydrogen_value_;
297  int bit_field_;
298 };
299 
300 
301 // R = number of result operands (0 or 1).
302 template<int R>
303 class LTemplateResultInstruction : public LInstruction {
304  public:
305  // Allow 0 or 1 output operands.
306  STATIC_ASSERT(R == 0 || R == 1);
307  virtual bool HasResult() const V8_FINAL V8_OVERRIDE {
308  return R != 0 && result() != NULL;
309  }
310  void set_result(LOperand* operand) { results_[0] = operand; }
311  LOperand* result() const { return results_[0]; }
312 
313  virtual bool MustSignExtendResult(
314  LPlatformChunk* chunk) const V8_FINAL V8_OVERRIDE;
315 
316  protected:
318 };
319 
320 
321 // R = number of result operands (0 or 1).
322 // I = number of input operands.
323 // T = number of temporary operands.
324 template<int R, int I, int T>
325 class LTemplateInstruction : public LTemplateResultInstruction<R> {
326  protected:
327  EmbeddedContainer<LOperand*, I> inputs_;
328  EmbeddedContainer<LOperand*, T> temps_;
329 
330  private:
331  // Iterator support.
332  virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; }
333  virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
334 
335  virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; }
336  virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; }
337 };
338 
339 
340 class LGap : public LTemplateInstruction<0, 0, 0> {
341  public:
342  explicit LGap(HBasicBlock* block)
343  : block_(block) {
344  parallel_moves_[BEFORE] = NULL;
345  parallel_moves_[START] = NULL;
346  parallel_moves_[END] = NULL;
347  parallel_moves_[AFTER] = NULL;
348  }
349 
350  // Can't use the DECLARE-macro here because of sub-classes.
351  virtual bool IsGap() const V8_FINAL V8_OVERRIDE { return true; }
352  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
353  static LGap* cast(LInstruction* instr) {
354  ASSERT(instr->IsGap());
355  return reinterpret_cast<LGap*>(instr);
356  }
357 
358  bool IsRedundant() const;
359 
360  HBasicBlock* block() const { return block_; }
361 
363  BEFORE,
364  START,
365  END,
366  AFTER,
368  LAST_INNER_POSITION = AFTER
369  };
370 
372  Zone* zone) {
373  if (parallel_moves_[pos] == NULL) {
374  parallel_moves_[pos] = new(zone) LParallelMove(zone);
375  }
376  return parallel_moves_[pos];
377  }
378 
379  LParallelMove* GetParallelMove(InnerPosition pos) {
380  return parallel_moves_[pos];
381  }
382 
383  private:
384  LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
385  HBasicBlock* block_;
386 };
387 
388 
389 class LInstructionGap V8_FINAL : public LGap {
390  public:
391  explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
392 
393  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
394  return !IsRedundant();
395  }
396 
397  DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
398 };
399 
400 
401 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> {
402  public:
403  explicit LGoto(HBasicBlock* block) : block_(block) { }
404 
405  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE;
406  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
407  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
408  virtual bool IsControl() const V8_OVERRIDE { return true; }
409 
410  int block_id() const { return block_->block_id(); }
411 
412  private:
413  HBasicBlock* block_;
414 };
415 
416 
417 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> {
418  public:
419  LLazyBailout() : gap_instructions_size_(0) { }
420 
421  DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
422 
423  void set_gap_instructions_size(int gap_instructions_size) {
424  gap_instructions_size_ = gap_instructions_size;
425  }
426  int gap_instructions_size() { return gap_instructions_size_; }
427 
428  private:
429  int gap_instructions_size_;
430 };
431 
432 
433 class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
434  public:
435  explicit LDummy() { }
436  DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
437 };
438 
439 
440 class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {
441  public:
442  explicit LDummyUse(LOperand* value) {
443  inputs_[0] = value;
444  }
445  DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
446 };
447 
448 
449 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
450  public:
451  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
452  DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
453 };
454 
455 
456 class LLabel V8_FINAL : public LGap {
457  public:
458  explicit LLabel(HBasicBlock* block)
459  : LGap(block), replacement_(NULL) { }
460 
461  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
462  return false;
463  }
464  DECLARE_CONCRETE_INSTRUCTION(Label, "label")
465 
466  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
467 
468  int block_id() const { return block()->block_id(); }
469  bool is_loop_header() const { return block()->IsLoopHeader(); }
470  bool is_osr_entry() const { return block()->is_osr_entry(); }
471  Label* label() { return &label_; }
472  LLabel* replacement() const { return replacement_; }
473  void set_replacement(LLabel* label) { replacement_ = label; }
474  bool HasReplacement() const { return replacement_ != NULL; }
475 
476  private:
477  Label label_;
478  LLabel* replacement_;
479 };
480 
481 
482 class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> {
483  public:
484  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
485  return false;
486  }
487  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
488 };
489 
490 
491 class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> {
492  public:
493  explicit LCallStub(LOperand* context) {
494  inputs_[0] = context;
495  }
496 
497  LOperand* context() { return inputs_[0]; }
498 
499  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
500  DECLARE_HYDROGEN_ACCESSOR(CallStub)
501 };
502 
503 
504 class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> {
505  public:
506  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
507  return false;
508  }
509  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
510 };
511 
512 
513 template<int I, int T>
514 class LControlInstruction : public LTemplateInstruction<0, I, T> {
515  public:
516  LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
517 
518  virtual bool IsControl() const V8_FINAL V8_OVERRIDE { return true; }
519 
520  int SuccessorCount() { return hydrogen()->SuccessorCount(); }
521  HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
522 
523  int TrueDestination(LChunk* chunk) {
524  return chunk->LookupDestination(true_block_id());
525  }
526  int FalseDestination(LChunk* chunk) {
527  return chunk->LookupDestination(false_block_id());
528  }
529 
530  Label* TrueLabel(LChunk* chunk) {
531  if (true_label_ == NULL) {
532  true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk));
533  }
534  return true_label_;
535  }
536  Label* FalseLabel(LChunk* chunk) {
537  if (false_label_ == NULL) {
538  false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk));
539  }
540  return false_label_;
541  }
542 
543  protected:
544  int true_block_id() { return SuccessorAt(0)->block_id(); }
545  int false_block_id() { return SuccessorAt(1)->block_id(); }
546 
547  private:
548  HControlInstruction* hydrogen() {
549  return HControlInstruction::cast(this->hydrogen_value());
550  }
551 
552  Label* false_label_;
553  Label* true_label_;
554 };
555 
556 
557 class LWrapReceiver V8_FINAL : public LTemplateInstruction<1, 2, 0> {
558  public:
559  LWrapReceiver(LOperand* receiver, LOperand* function) {
560  inputs_[0] = receiver;
561  inputs_[1] = function;
562  }
563 
564  LOperand* receiver() { return inputs_[0]; }
565  LOperand* function() { return inputs_[1]; }
566 
567  DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
568  DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
569 };
570 
571 
572 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> {
573  public:
575  LOperand* receiver,
576  LOperand* length,
577  LOperand* elements) {
578  inputs_[0] = function;
579  inputs_[1] = receiver;
580  inputs_[2] = length;
581  inputs_[3] = elements;
582  }
583 
584  LOperand* function() { return inputs_[0]; }
585  LOperand* receiver() { return inputs_[1]; }
586  LOperand* length() { return inputs_[2]; }
587  LOperand* elements() { return inputs_[3]; }
588 
589  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
590 };
591 
592 
593 class LAccessArgumentsAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
594  public:
595  LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
596  inputs_[0] = arguments;
597  inputs_[1] = length;
598  inputs_[2] = index;
599  }
600 
601  LOperand* arguments() { return inputs_[0]; }
602  LOperand* length() { return inputs_[1]; }
603  LOperand* index() { return inputs_[2]; }
604 
605  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
606 
607  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
608 };
609 
610 
611 class LArgumentsLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
612  public:
613  explicit LArgumentsLength(LOperand* elements) {
614  inputs_[0] = elements;
615  }
616 
617  LOperand* elements() { return inputs_[0]; }
618 
619  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
620 };
621 
622 
623 class LArgumentsElements V8_FINAL : public LTemplateInstruction<1, 0, 0> {
624  public:
625  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
626  DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
627 };
628 
629 
630 class LModByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
631  public:
632  LModByPowerOf2I(LOperand* dividend, int32_t divisor) {
633  inputs_[0] = dividend;
634  divisor_ = divisor;
635  }
636 
637  LOperand* dividend() { return inputs_[0]; }
638  int32_t divisor() const { return divisor_; }
639 
640  DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
642 
643  private:
644  int32_t divisor_;
645 };
646 
647 
648 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
649  public:
651  int32_t divisor,
652  LOperand* temp1,
653  LOperand* temp2) {
654  inputs_[0] = dividend;
655  divisor_ = divisor;
656  temps_[0] = temp1;
657  temps_[1] = temp2;
658  }
659 
660  LOperand* dividend() { return inputs_[0]; }
661  int32_t divisor() const { return divisor_; }
662  LOperand* temp1() { return temps_[0]; }
663  LOperand* temp2() { return temps_[1]; }
664 
665  DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
667 
668  private:
669  int32_t divisor_;
670 };
671 
672 
673 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
674  public:
675  LModI(LOperand* left, LOperand* right, LOperand* temp) {
676  inputs_[0] = left;
677  inputs_[1] = right;
678  temps_[0] = temp;
679  }
680 
681  LOperand* left() { return inputs_[0]; }
682  LOperand* right() { return inputs_[1]; }
683  LOperand* temp() { return temps_[0]; }
684 
685  DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
687 };
688 
689 
690 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
691  public:
692  LDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
693  inputs_[0] = dividend;
694  divisor_ = divisor;
695  }
696 
697  LOperand* dividend() { return inputs_[0]; }
698  int32_t divisor() const { return divisor_; }
699 
700  DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
702 
703  private:
704  int32_t divisor_;
705 };
706 
707 
708 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
709  public:
711  int32_t divisor,
712  LOperand* temp1,
713  LOperand* temp2) {
714  inputs_[0] = dividend;
715  divisor_ = divisor;
716  temps_[0] = temp1;
717  temps_[1] = temp2;
718  }
719 
720  LOperand* dividend() { return inputs_[0]; }
721  int32_t divisor() const { return divisor_; }
722  LOperand* temp1() { return temps_[0]; }
723  LOperand* temp2() { return temps_[1]; }
724 
725  DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
727 
728  private:
729  int32_t divisor_;
730 };
731 
732 
733 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
734  public:
735  LDivI(LOperand* left, LOperand* right, LOperand* temp) {
736  inputs_[0] = left;
737  inputs_[1] = right;
738  temps_[0] = temp;
739  }
740 
741  LOperand* left() { return inputs_[0]; }
742  LOperand* right() { return inputs_[1]; }
743  LOperand* temp() { return temps_[0]; }
744 
745  DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
746  DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
747 };
748 
749 
750 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
751  public:
753  inputs_[0] = dividend;
754  divisor_ = divisor;
755  }
756 
757  LOperand* dividend() { return inputs_[0]; }
758  int32_t divisor() const { return divisor_; }
759 
760  DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
761  "flooring-div-by-power-of-2-i")
762  DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
763 
764  private:
765  int32_t divisor_;
766 };
767 
768 
769 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 3> {
770  public:
772  int32_t divisor,
773  LOperand* temp1,
774  LOperand* temp2,
775  LOperand* temp3) {
776  inputs_[0] = dividend;
777  divisor_ = divisor;
778  temps_[0] = temp1;
779  temps_[1] = temp2;
780  temps_[2] = temp3;
781  }
782 
783  LOperand* dividend() { return inputs_[0]; }
784  int32_t divisor() const { return divisor_; }
785  LOperand* temp1() { return temps_[0]; }
786  LOperand* temp2() { return temps_[1]; }
787  LOperand* temp3() { return temps_[2]; }
788 
789  DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
790  DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
791 
792  private:
793  int32_t divisor_;
794 };
795 
796 
797 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
798  public:
799  LMulI(LOperand* left, LOperand* right) {
800  inputs_[0] = left;
801  inputs_[1] = right;
802  }
803 
804  LOperand* left() { return inputs_[0]; }
805  LOperand* right() { return inputs_[1]; }
806 
807  DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
809 };
810 
811 
812 class LCompareNumericAndBranch V8_FINAL : public LControlInstruction<2, 0> {
813  public:
815  inputs_[0] = left;
816  inputs_[1] = right;
817  }
818 
819  LOperand* left() { return inputs_[0]; }
820  LOperand* right() { return inputs_[1]; }
821 
822  DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
823  "compare-numeric-and-branch")
824  DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
825 
826  Token::Value op() const { return hydrogen()->token(); }
827  bool is_double() const {
828  return hydrogen()->representation().IsDouble();
829  }
830 
831  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
832 };
833 
834 
835 class LMathFloor V8_FINAL : public LTemplateInstruction<1, 1, 0> {
836  public:
837  explicit LMathFloor(LOperand* value) {
838  inputs_[0] = value;
839  }
840 
841  LOperand* value() { return inputs_[0]; }
842 
843  DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
844  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
845 };
846 
847 
848 class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> {
849  public:
850  explicit LMathRound(LOperand* value, LOperand* temp) {
851  inputs_[0] = value;
852  temps_[0] = temp;
853  }
854 
855  LOperand* value() { return inputs_[0]; }
856  LOperand* temp() { return temps_[0]; }
857 
858  DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
859  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
860 };
861 
862 
863 class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
864  public:
865  explicit LMathAbs(LOperand* context, LOperand* value) {
866  inputs_[1] = context;
867  inputs_[0] = value;
868  }
869 
870  LOperand* context() { return inputs_[1]; }
871  LOperand* value() { return inputs_[0]; }
872 
873  DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
874  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
875 };
876 
877 
878 class LMathLog V8_FINAL : public LTemplateInstruction<1, 1, 0> {
879  public:
880  explicit LMathLog(LOperand* value) {
881  inputs_[0] = value;
882  }
883 
884  LOperand* value() { return inputs_[0]; }
885 
886  DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
887 };
888 
889 
890 class LMathClz32 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
891  public:
892  explicit LMathClz32(LOperand* value) {
893  inputs_[0] = value;
894  }
895 
896  LOperand* value() { return inputs_[0]; }
897 
898  DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32")
899 };
900 
901 
902 class LMathExp V8_FINAL : public LTemplateInstruction<1, 1, 2> {
903  public:
904  LMathExp(LOperand* value, LOperand* temp1, LOperand* temp2) {
905  inputs_[0] = value;
906  temps_[0] = temp1;
907  temps_[1] = temp2;
908  ExternalReference::InitializeMathExpData();
909  }
910 
911  LOperand* value() { return inputs_[0]; }
912  LOperand* temp1() { return temps_[0]; }
913  LOperand* temp2() { return temps_[1]; }
914 
915  DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
916 };
917 
918 
919 class LMathSqrt V8_FINAL : public LTemplateInstruction<1, 1, 0> {
920  public:
921  explicit LMathSqrt(LOperand* value) {
922  inputs_[0] = value;
923  }
924 
925  LOperand* value() { return inputs_[0]; }
926 
927  DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
928 };
929 
930 
931 class LMathPowHalf V8_FINAL : public LTemplateInstruction<1, 1, 0> {
932  public:
933  explicit LMathPowHalf(LOperand* value) {
934  inputs_[0] = value;
935  }
936 
937  LOperand* value() { return inputs_[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 };
955 
956 
957 class LCmpHoleAndBranch V8_FINAL : public LControlInstruction<1, 0> {
958  public:
959  explicit LCmpHoleAndBranch(LOperand* object) {
960  inputs_[0] = object;
961  }
962 
963  LOperand* object() { return inputs_[0]; }
964 
965  DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch")
966  DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
967 };
968 
969 
970 class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 0> {
971  public:
973  inputs_[0] = value;
974  }
975 
976  LOperand* value() { return inputs_[0]; }
977 
978  DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch,
979  "cmp-minus-zero-and-branch")
980  DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch)
981 };
982 
983 
984 
985 class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 0> {
986  public:
987  explicit LIsObjectAndBranch(LOperand* value) {
988  inputs_[0] = value;
989  }
990 
991  LOperand* value() { return inputs_[0]; }
992 
993  DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
994  DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
995 
996  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
997 };
998 
999 
1000 class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
1001  public:
1002  explicit LIsStringAndBranch(LOperand* value, LOperand* temp) {
1003  inputs_[0] = value;
1004  temps_[0] = temp;
1005  }
1006 
1007  LOperand* value() { return inputs_[0]; }
1008  LOperand* temp() { return temps_[0]; }
1009 
1010  DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
1011  DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
1012 
1013  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1014 };
1015 
1016 
1017 class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> {
1018  public:
1019  explicit LIsSmiAndBranch(LOperand* value) {
1020  inputs_[0] = value;
1021  }
1022 
1023  LOperand* value() { return inputs_[0]; }
1024 
1025  DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
1026  DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
1027 
1028  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1029 };
1030 
1031 
1032 class LIsUndetectableAndBranch V8_FINAL : public LControlInstruction<1, 1> {
1033  public:
1034  explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
1035  inputs_[0] = value;
1036  temps_[0] = temp;
1037  }
1038 
1039  LOperand* value() { return inputs_[0]; }
1040  LOperand* temp() { return temps_[0]; }
1041 
1042  DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
1043  "is-undetectable-and-branch")
1044  DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
1045 
1046  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1047 };
1048 
1049 
1050 class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
1051  public:
1053  LOperand* left,
1054  LOperand* right) {
1055  inputs_[0] = context;
1056  inputs_[1] = left;
1057  inputs_[2] = right;
1058  }
1059 
1060  LOperand* context() { return inputs_[0]; }
1061  LOperand* left() { return inputs_[1]; }
1062  LOperand* right() { return inputs_[2]; }
1063 
1064  DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1065  "string-compare-and-branch")
1066  DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
1067 
1068  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1069 
1070  Token::Value op() const { return hydrogen()->token(); }
1071 };
1072 
1073 
1074 class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 0> {
1075  public:
1077  inputs_[0] = value;
1078  }
1079 
1080  LOperand* value() { return inputs_[0]; }
1081 
1082  DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
1083  "has-instance-type-and-branch")
1084  DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
1085 
1086  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1087 };
1088 
1089 
1090 class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1091  public:
1092  explicit LGetCachedArrayIndex(LOperand* value) {
1093  inputs_[0] = value;
1094  }
1095 
1096  LOperand* value() { return inputs_[0]; }
1097 
1098  DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
1099  DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
1100 };
1101 
1102 
1103 class LHasCachedArrayIndexAndBranch V8_FINAL
1104  : public LControlInstruction<1, 0> {
1105  public:
1107  inputs_[0] = value;
1108  }
1109 
1110  LOperand* value() { return inputs_[0]; }
1111 
1112  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
1113  "has-cached-array-index-and-branch")
1114  DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
1115 
1116  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1117 };
1118 
1119 
1120 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 2> {
1121  public:
1123  inputs_[0] = value;
1124  temps_[0] = temp;
1125  temps_[1] = temp2;
1126  }
1127 
1128  LOperand* value() { return inputs_[0]; }
1129  LOperand* temp() { return temps_[0]; }
1130  LOperand* temp2() { return temps_[1]; }
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, 1> {
1292  public:
1293  explicit LConstantD(LOperand* temp) {
1294  temps_[0] = temp;
1295  }
1296 
1297  LOperand* temp() { return temps_[0]; }
1298 
1299  DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1300  DECLARE_HYDROGEN_ACCESSOR(Constant)
1301 
1302  double value() const { return hydrogen()->DoubleValue(); }
1303 };
1304 
1305 
1306 class LConstantE V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1307  public:
1308  DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
1309  DECLARE_HYDROGEN_ACCESSOR(Constant)
1310 
1311  ExternalReference value() const {
1312  return hydrogen()->ExternalReferenceValue();
1313  }
1314 };
1315 
1316 
1317 class LConstantT V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1318  public:
1319  DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1320  DECLARE_HYDROGEN_ACCESSOR(Constant)
1321 
1322  Handle<Object> value(Isolate* isolate) const {
1323  return hydrogen()->handle(isolate);
1324  }
1325 };
1326 
1327 
1328 class LBranch V8_FINAL : public LControlInstruction<1, 0> {
1329  public:
1330  explicit LBranch(LOperand* value) {
1331  inputs_[0] = value;
1332  }
1333 
1334  LOperand* value() { return inputs_[0]; }
1335 
1336  DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1338 
1339  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1340 };
1341 
1342 
1343 class LDebugBreak V8_FINAL : public LTemplateInstruction<0, 0, 0> {
1344  public:
1345  DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
1346 };
1347 
1348 
1349 class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 0> {
1350  public:
1351  explicit LCmpMapAndBranch(LOperand* value) {
1352  inputs_[0] = value;
1353  }
1354 
1355  LOperand* value() { return inputs_[0]; }
1356 
1357  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1358  DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1359 
1360  Handle<Map> map() const { return hydrogen()->map().handle(); }
1361 };
1362 
1363 
1364 class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1365  public:
1366  explicit LMapEnumLength(LOperand* value) {
1367  inputs_[0] = value;
1368  }
1369 
1370  LOperand* value() { return inputs_[0]; }
1371 
1372  DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
1373 };
1374 
1375 
1376 class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1377  public:
1378  LDateField(LOperand* date, Smi* index) : index_(index) {
1379  inputs_[0] = date;
1380  }
1381 
1382  LOperand* date() { return inputs_[0]; }
1383  Smi* index() const { return index_; }
1384 
1385  DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1386  DECLARE_HYDROGEN_ACCESSOR(DateField)
1387 
1388  private:
1389  Smi* index_;
1390 };
1391 
1392 
1393 class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1394  public:
1396  inputs_[0] = string;
1397  inputs_[1] = index;
1398  }
1399 
1400  LOperand* string() const { return inputs_[0]; }
1401  LOperand* index() const { return inputs_[1]; }
1402 
1403  DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
1404  DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
1405 };
1406 
1407 
1408 class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
1409  public:
1411  LOperand* string,
1412  LOperand* index,
1413  LOperand* value) {
1414  inputs_[0] = context;
1415  inputs_[1] = string;
1416  inputs_[2] = index;
1417  inputs_[3] = value;
1418  }
1419 
1420  LOperand* string() { return inputs_[1]; }
1421  LOperand* index() { return inputs_[2]; }
1422  LOperand* value() { return inputs_[3]; }
1423 
1424  DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
1425  DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
1426 };
1427 
1428 
1429 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1430  public:
1431  LAddI(LOperand* left, LOperand* right) {
1432  inputs_[0] = left;
1433  inputs_[1] = right;
1434  }
1435 
1436  LOperand* left() { return inputs_[0]; }
1437  LOperand* right() { return inputs_[1]; }
1438 
1439  static bool UseLea(HAdd* add) {
1440  return !add->CheckFlag(HValue::kCanOverflow) &&
1441  add->BetterLeftOperand()->UseCount() > 1;
1442  }
1443 
1444  DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1446 };
1447 
1448 
1449 class LMathMinMax V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1450  public:
1451  LMathMinMax(LOperand* left, LOperand* right) {
1452  inputs_[0] = left;
1453  inputs_[1] = right;
1454  }
1455 
1456  LOperand* left() { return inputs_[0]; }
1457  LOperand* right() { return inputs_[1]; }
1458 
1459  DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
1460  DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1461 };
1462 
1463 
1464 class LPower V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1465  public:
1466  LPower(LOperand* left, LOperand* right) {
1467  inputs_[0] = left;
1468  inputs_[1] = right;
1469  }
1470 
1471  LOperand* left() { return inputs_[0]; }
1472  LOperand* right() { return inputs_[1]; }
1473 
1474  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1476 };
1477 
1478 
1479 class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1480  public:
1482  : op_(op) {
1483  inputs_[0] = left;
1484  inputs_[1] = right;
1485  }
1486 
1487  Token::Value op() const { return op_; }
1488  LOperand* left() { return inputs_[0]; }
1489  LOperand* right() { return inputs_[1]; }
1490 
1491  virtual Opcode opcode() const V8_OVERRIDE {
1492  return LInstruction::kArithmeticD;
1493  }
1494  virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
1495  virtual const char* Mnemonic() const V8_OVERRIDE;
1496 
1497  private:
1498  Token::Value op_;
1499 };
1500 
1501 
1502 class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1503  public:
1505  LOperand* context,
1506  LOperand* left,
1507  LOperand* right)
1508  : op_(op) {
1509  inputs_[0] = context;
1510  inputs_[1] = left;
1511  inputs_[2] = right;
1512  }
1513 
1514  Token::Value op() const { return op_; }
1515  LOperand* context() { return inputs_[0]; }
1516  LOperand* left() { return inputs_[1]; }
1517  LOperand* right() { return inputs_[2]; }
1518 
1519  virtual Opcode opcode() const V8_OVERRIDE {
1520  return LInstruction::kArithmeticT;
1521  }
1522  virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
1523  virtual const char* Mnemonic() const V8_OVERRIDE;
1524 
1525  private:
1526  Token::Value op_;
1527 };
1528 
1529 
1530 class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> {
1531  public:
1532  explicit LReturn(LOperand* value,
1533  LOperand* context,
1534  LOperand* parameter_count) {
1535  inputs_[0] = value;
1536  inputs_[1] = context;
1537  inputs_[2] = parameter_count;
1538  }
1539 
1540  LOperand* value() { return inputs_[0]; }
1541  LOperand* context() { return inputs_[1]; }
1542 
1544  return parameter_count()->IsConstantOperand();
1545  }
1546  LConstantOperand* constant_parameter_count() {
1547  ASSERT(has_constant_parameter_count());
1548  return LConstantOperand::cast(parameter_count());
1549  }
1550  LOperand* parameter_count() { return inputs_[2]; }
1551 
1552  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1554 };
1555 
1556 
1557 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1558  public:
1559  explicit LLoadNamedField(LOperand* object) {
1560  inputs_[0] = object;
1561  }
1562 
1563  LOperand* object() { return inputs_[0]; }
1564 
1565  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1566  DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1567 };
1568 
1569 
1570 class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1571  public:
1572  explicit LLoadNamedGeneric(LOperand* context, LOperand* object) {
1573  inputs_[0] = context;
1574  inputs_[1] = object;
1575  }
1576 
1577  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1578  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1579 
1580  LOperand* context() { return inputs_[0]; }
1581  LOperand* object() { return inputs_[1]; }
1582  Handle<Object> name() const { return hydrogen()->name(); }
1583 };
1584 
1585 
1586 class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1587  public:
1588  explicit LLoadFunctionPrototype(LOperand* function) {
1589  inputs_[0] = function;
1590  }
1591 
1592  DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1593  DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1594 
1595  LOperand* function() { return inputs_[0]; }
1596 };
1597 
1598 
1599 class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1600  public:
1601  DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1602  DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1603 
1604  Heap::RootListIndex index() const { return hydrogen()->index(); }
1605 };
1606 
1607 
1608 class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1609  public:
1610  LLoadKeyed(LOperand* elements, LOperand* key) {
1611  inputs_[0] = elements;
1612  inputs_[1] = key;
1613  }
1614 
1615  DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1616  DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1617 
1618  bool is_external() const {
1619  return hydrogen()->is_external();
1620  }
1621  bool is_fixed_typed_array() const {
1622  return hydrogen()->is_fixed_typed_array();
1623  }
1624  bool is_typed_elements() const {
1625  return is_external() || is_fixed_typed_array();
1626  }
1627  LOperand* elements() { return inputs_[0]; }
1628  LOperand* key() { return inputs_[1]; }
1629  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1630  uint32_t additional_index() const { return hydrogen()->index_offset(); }
1632  return hydrogen()->elements_kind();
1633  }
1634 };
1635 
1636 
1637 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1638  public:
1640  inputs_[0] = context;
1641  inputs_[1] = obj;
1642  inputs_[2] = key;
1643  }
1644 
1645  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1646 
1647  LOperand* context() { return inputs_[0]; }
1648  LOperand* object() { return inputs_[1]; }
1649  LOperand* key() { return inputs_[2]; }
1650 };
1651 
1652 
1653 class LLoadGlobalCell V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1654  public:
1655  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1656  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1657 };
1658 
1659 
1660 class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1661  public:
1662  explicit LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
1663  inputs_[0] = context;
1664  inputs_[1] = global_object;
1665  }
1666 
1667  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1668  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1669 
1670  LOperand* context() { return inputs_[0]; }
1671  LOperand* global_object() { return inputs_[1]; }
1672  Handle<Object> name() const { return hydrogen()->name(); }
1673  bool for_typeof() const { return hydrogen()->for_typeof(); }
1674 };
1675 
1676 
1677 class LStoreGlobalCell V8_FINAL : public LTemplateInstruction<0, 1, 1> {
1678  public:
1679  explicit LStoreGlobalCell(LOperand* value, LOperand* temp) {
1680  inputs_[0] = value;
1681  temps_[0] = temp;
1682  }
1683 
1684  LOperand* value() { return inputs_[0]; }
1685  LOperand* temp() { return temps_[0]; }
1686 
1687  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1688  DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
1689 };
1690 
1691 
1692 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1693  public:
1694  explicit LLoadContextSlot(LOperand* context) {
1695  inputs_[0] = context;
1696  }
1697 
1698  LOperand* context() { return inputs_[0]; }
1699 
1700  DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1701  DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1702 
1703  int slot_index() { return hydrogen()->slot_index(); }
1704 
1705  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1706 };
1707 
1708 
1709 class LStoreContextSlot V8_FINAL : public LTemplateInstruction<0, 2, 1> {
1710  public:
1711  LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1712  inputs_[0] = context;
1713  inputs_[1] = value;
1714  temps_[0] = temp;
1715  }
1716 
1717  LOperand* context() { return inputs_[0]; }
1718  LOperand* value() { return inputs_[1]; }
1719  LOperand* temp() { return temps_[0]; }
1720 
1721  DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1722  DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1723 
1724  int slot_index() { return hydrogen()->slot_index(); }
1725 
1726  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1727 };
1728 
1729 
1730 class LPushArgument V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1731  public:
1732  explicit LPushArgument(LOperand* value) {
1733  inputs_[0] = value;
1734  }
1735 
1736  LOperand* value() { return inputs_[0]; }
1737 
1738  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1739 };
1740 
1741 
1742 class LDrop V8_FINAL : public LTemplateInstruction<0, 0, 0> {
1743  public:
1744  explicit LDrop(int count) : count_(count) { }
1745 
1746  int count() const { return count_; }
1747 
1748  DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
1749 
1750  private:
1751  int count_;
1752 };
1753 
1754 
1755 class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 1, 1> {
1756  public:
1757  LStoreCodeEntry(LOperand* function, LOperand* code_object) {
1758  inputs_[0] = function;
1759  temps_[0] = code_object;
1760  }
1761 
1762  LOperand* function() { return inputs_[0]; }
1763  LOperand* code_object() { return temps_[0]; }
1764 
1765  virtual void PrintDataTo(StringStream* stream);
1766 
1767  DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
1768  DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
1769 };
1770 
1771 
1772 class LInnerAllocatedObject V8_FINAL: public LTemplateInstruction<1, 2, 0> {
1773  public:
1774  LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
1775  inputs_[0] = base_object;
1776  inputs_[1] = offset;
1777  }
1778 
1779  LOperand* base_object() const { return inputs_[0]; }
1780  LOperand* offset() const { return inputs_[1]; }
1781 
1782  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1783 
1784  DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
1785 };
1786 
1787 
1788 class LThisFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1789  public:
1790  DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1791  DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
1792 };
1793 
1794 
1795 class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1796  public:
1799 };
1800 
1801 
1802 class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1803  public:
1804  explicit LDeclareGlobals(LOperand* context) {
1805  inputs_[0] = context;
1806  }
1807 
1808  LOperand* context() { return inputs_[0]; }
1809 
1810  DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1811  DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1812 };
1813 
1814 
1815 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1816  public:
1817  explicit LCallJSFunction(LOperand* function) {
1818  inputs_[0] = function;
1819  }
1820 
1821  LOperand* function() { return inputs_[0]; }
1822 
1823  DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
1824  DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
1825 
1826  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1827 
1828  int arity() const { return hydrogen()->argument_count() - 1; }
1829 };
1830 
1831 
1832 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
1833  public:
1835  ZoneList<LOperand*>& operands,
1836  Zone* zone)
1837  : inputs_(descriptor->environment_length() + 1, zone) {
1838  ASSERT(descriptor->environment_length() + 1 == operands.length());
1839  inputs_.AddAll(operands, zone);
1840  }
1841 
1842  LOperand* target() const { return inputs_[0]; }
1843 
1844  private:
1845  DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1846  DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1847 
1848  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1849 
1850  int arity() const { return hydrogen()->argument_count() - 1; }
1851 
1852  ZoneList<LOperand*> inputs_;
1853 
1854  // Iterator support.
1855  virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
1856  virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
1857 
1858  virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
1859  virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
1860 };
1861 
1862 
1863 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1864  public:
1865  LInvokeFunction(LOperand* context, LOperand* function) {
1866  inputs_[0] = context;
1867  inputs_[1] = function;
1868  }
1869 
1870  LOperand* context() { return inputs_[0]; }
1871  LOperand* function() { return inputs_[1]; }
1872 
1873  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1874  DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1875 
1876  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1877 
1878  int arity() const { return hydrogen()->argument_count() - 1; }
1879 };
1880 
1881 
1882 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1883  public:
1884  LCallFunction(LOperand* context, LOperand* function) {
1885  inputs_[0] = context;
1886  inputs_[1] = function;
1887  }
1888 
1889  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1890  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1891 
1892  LOperand* context() { return inputs_[0]; }
1893  LOperand* function() { return inputs_[1]; }
1894  int arity() const { return hydrogen()->argument_count() - 1; }
1895 };
1896 
1897 
1898 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1899  public:
1900  LCallNew(LOperand* context, LOperand* constructor) {
1901  inputs_[0] = context;
1902  inputs_[1] = constructor;
1903  }
1904 
1905  LOperand* context() { return inputs_[0]; }
1906  LOperand* constructor() { return inputs_[1]; }
1907 
1908  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1909  DECLARE_HYDROGEN_ACCESSOR(CallNew)
1910 
1911  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1912 
1913  int arity() const { return hydrogen()->argument_count() - 1; }
1914 };
1915 
1916 
1917 class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1918  public:
1919  LCallNewArray(LOperand* context, LOperand* constructor) {
1920  inputs_[0] = context;
1921  inputs_[1] = constructor;
1922  }
1923 
1924  LOperand* context() { return inputs_[0]; }
1925  LOperand* constructor() { return inputs_[1]; }
1926 
1927  DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
1928  DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
1929 
1930  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1931 
1932  int arity() const { return hydrogen()->argument_count() - 1; }
1933 };
1934 
1935 
1936 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1937  public:
1938  explicit LCallRuntime(LOperand* context) {
1939  inputs_[0] = context;
1940  }
1941 
1942  LOperand* context() { return inputs_[0]; }
1943 
1944  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1945  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1946 
1947  virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
1948  return save_doubles() == kDontSaveFPRegs;
1949  }
1950 
1951  const Runtime::Function* function() const { return hydrogen()->function(); }
1952  int arity() const { return hydrogen()->argument_count(); }
1953  SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1954 };
1955 
1956 
1957 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1958  public:
1959  explicit LInteger32ToDouble(LOperand* value) {
1960  inputs_[0] = value;
1961  }
1962 
1963  LOperand* value() { return inputs_[0]; }
1964 
1965  DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1966 };
1967 
1968 
1969 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 1> {
1970  public:
1971  explicit LUint32ToDouble(LOperand* value, LOperand* temp) {
1972  inputs_[0] = value;
1973  temps_[0] = temp;
1974  }
1975 
1976  LOperand* value() { return inputs_[0]; }
1977  LOperand* temp() { return temps_[0]; }
1978 
1979  DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
1980 };
1981 
1982 
1983 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1984  public:
1985  explicit LNumberTagI(LOperand* value) {
1986  inputs_[0] = value;
1987  }
1988 
1989  LOperand* value() { return inputs_[0]; }
1990 
1991  DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1992 };
1993 
1994 
1995 class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> {
1996  public:
1997  LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) {
1998  inputs_[0] = value;
1999  temps_[0] = temp1;
2000  temps_[1] = temp2;
2001  }
2002 
2003  LOperand* value() { return inputs_[0]; }
2004  LOperand* temp1() { return temps_[0]; }
2005  LOperand* temp2() { return temps_[1]; }
2006 
2007  DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
2008 };
2009 
2010 
2011 class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 1> {
2012  public:
2013  explicit LNumberTagD(LOperand* value, LOperand* temp) {
2014  inputs_[0] = value;
2015  temps_[0] = temp;
2016  }
2017 
2018  LOperand* value() { return inputs_[0]; }
2019  LOperand* temp() { return temps_[0]; }
2020 
2021  DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
2023 };
2024 
2025 
2026 // Sometimes truncating conversion from a tagged value to an int32.
2027 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2028  public:
2029  explicit LDoubleToI(LOperand* value) {
2030  inputs_[0] = value;
2031  }
2032 
2033  LOperand* value() { return inputs_[0]; }
2034 
2035  DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
2036  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2037 
2038  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2039 };
2040 
2041 
2042 class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2043  public:
2044  explicit LDoubleToSmi(LOperand* value) {
2045  inputs_[0] = value;
2046  }
2047 
2048  LOperand* value() { return inputs_[0]; }
2049 
2050  DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi")
2051  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2052 };
2053 
2054 
2055 // Truncating conversion from a tagged value to an int32.
2056 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
2057  public:
2058  LTaggedToI(LOperand* value, LOperand* temp) {
2059  inputs_[0] = value;
2060  temps_[0] = temp;
2061  }
2062 
2063  LOperand* value() { return inputs_[0]; }
2064  LOperand* temp() { return temps_[0]; }
2065 
2066  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2068 
2069  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2070 };
2071 
2072 
2073 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2074  public:
2075  explicit LSmiTag(LOperand* value) {
2076  inputs_[0] = value;
2077  }
2078 
2079  LOperand* value() { return inputs_[0]; }
2080 
2081  DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
2083 };
2084 
2085 
2086 class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2087  public:
2088  explicit LNumberUntagD(LOperand* value) {
2089  inputs_[0] = value;
2090  }
2091 
2092  LOperand* value() { return inputs_[0]; }
2093 
2094  DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
2095  DECLARE_HYDROGEN_ACCESSOR(Change);
2096 };
2097 
2098 
2099 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2100  public:
2101  LSmiUntag(LOperand* value, bool needs_check)
2102  : needs_check_(needs_check) {
2103  inputs_[0] = value;
2104  }
2105 
2106  LOperand* value() { return inputs_[0]; }
2107  bool needs_check() const { return needs_check_; }
2108 
2109  DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
2110 
2111  private:
2112  bool needs_check_;
2113 };
2114 
2115 
2116 class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 1> {
2117  public:
2118  LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
2119  inputs_[0] = object;
2120  inputs_[1] = value;
2121  temps_[0] = temp;
2122  }
2123 
2124  LOperand* object() { return inputs_[0]; }
2125  LOperand* value() { return inputs_[1]; }
2126  LOperand* temp() { return temps_[0]; }
2127 
2128  DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
2129  DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
2130 
2131  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2132 
2133  Handle<Map> transition() const { return hydrogen()->transition_map(); }
2135  return hydrogen()->field_representation();
2136  }
2137 };
2138 
2139 
2140 class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2141  public:
2142  LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
2143  inputs_[0] = context;
2144  inputs_[1] = object;
2145  inputs_[2] = value;
2146  }
2147 
2148  LOperand* context() { return inputs_[0]; }
2149  LOperand* object() { return inputs_[1]; }
2150  LOperand* value() { return inputs_[2]; }
2151 
2152  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2153  DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
2154 
2155  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2156 
2157  Handle<Object> name() const { return hydrogen()->name(); }
2158  StrictMode strict_mode() { return hydrogen()->strict_mode(); }
2159 };
2160 
2161 
2162 class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2163  public:
2164  LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) {
2165  inputs_[0] = object;
2166  inputs_[1] = key;
2167  inputs_[2] = value;
2168  }
2169 
2170  bool is_external() const { return hydrogen()->is_external(); }
2171  bool is_fixed_typed_array() const {
2172  return hydrogen()->is_fixed_typed_array();
2173  }
2174  bool is_typed_elements() const {
2175  return is_external() || is_fixed_typed_array();
2176  }
2177  LOperand* elements() { return inputs_[0]; }
2178  LOperand* key() { return inputs_[1]; }
2179  LOperand* value() { return inputs_[2]; }
2180  ElementsKind elements_kind() const { return hydrogen()->elements_kind(); }
2181 
2182  DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
2183  DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2184 
2185  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2186  bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
2187  uint32_t additional_index() const { return hydrogen()->index_offset(); }
2188 };
2189 
2190 
2191 class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> {
2192  public:
2194  LOperand* object,
2195  LOperand* key,
2196  LOperand* value) {
2197  inputs_[0] = context;
2198  inputs_[1] = object;
2199  inputs_[2] = key;
2200  inputs_[3] = value;
2201  }
2202 
2203  LOperand* context() { return inputs_[0]; }
2204  LOperand* object() { return inputs_[1]; }
2205  LOperand* key() { return inputs_[2]; }
2206  LOperand* value() { return inputs_[3]; }
2207 
2208  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2209  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
2210 
2211  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2212 
2213  StrictMode strict_mode() { return hydrogen()->strict_mode(); }
2214 };
2215 
2216 
2217 class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> {
2218  public:
2220  LOperand* context,
2221  LOperand* new_map_temp,
2222  LOperand* temp) {
2223  inputs_[0] = object;
2224  inputs_[1] = context;
2225  temps_[0] = new_map_temp;
2226  temps_[1] = temp;
2227  }
2228 
2229  LOperand* object() { return inputs_[0]; }
2230  LOperand* context() { return inputs_[1]; }
2231  LOperand* new_map_temp() { return temps_[0]; }
2232  LOperand* temp() { return temps_[1]; }
2233 
2234  DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2235  "transition-elements-kind")
2236  DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2237 
2238  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2239 
2240  Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2242  return hydrogen()->transitioned_map().handle();
2243  }
2244  ElementsKind from_kind() { return hydrogen()->from_kind(); }
2245  ElementsKind to_kind() { return hydrogen()->to_kind(); }
2246 };
2247 
2248 
2249 class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
2250  public:
2252  LOperand* temp) {
2253  inputs_[0] = object;
2254  temps_[0] = temp;
2255  }
2256 
2257  LOperand* object() { return inputs_[0]; }
2258  LOperand* temp() { return temps_[0]; }
2259 
2260  DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento,
2261  "trap-allocation-memento")
2262 };
2263 
2264 
2265 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2266  public:
2267  LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2268  inputs_[0] = context;
2269  inputs_[1] = left;
2270  inputs_[2] = right;
2271  }
2272 
2273  LOperand* context() { return inputs_[0]; }
2274  LOperand* left() { return inputs_[1]; }
2275  LOperand* right() { return inputs_[2]; }
2276 
2277  DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2278  DECLARE_HYDROGEN_ACCESSOR(StringAdd)
2279 };
2280 
2281 
2282 class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2283  public:
2284  LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2285  inputs_[0] = context;
2286  inputs_[1] = string;
2287  inputs_[2] = index;
2288  }
2289 
2290  LOperand* context() { return inputs_[0]; }
2291  LOperand* string() { return inputs_[1]; }
2292  LOperand* index() { return inputs_[2]; }
2293 
2294  DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2295  DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2296 };
2297 
2298 
2299 class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2300  public:
2301  explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
2302  inputs_[0] = context;
2303  inputs_[1] = char_code;
2304  }
2305 
2306  LOperand* context() { return inputs_[0]; }
2307  LOperand* char_code() { return inputs_[1]; }
2308 
2309  DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2310  DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
2311 };
2312 
2313 
2314 class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2315  public:
2316  explicit LCheckValue(LOperand* value) {
2317  inputs_[0] = value;
2318  }
2319 
2320  LOperand* value() { return inputs_[0]; }
2321 
2322  DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
2323  DECLARE_HYDROGEN_ACCESSOR(CheckValue)
2324 };
2325 
2326 
2327 class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2328  public:
2329  explicit LCheckInstanceType(LOperand* value) {
2330  inputs_[0] = value;
2331  }
2332 
2333  LOperand* value() { return inputs_[0]; }
2334 
2335  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
2336  DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
2337 };
2338 
2339 
2340 class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2341  public:
2342  explicit LCheckMaps(LOperand* value) {
2343  inputs_[0] = value;
2344  }
2345 
2346  LOperand* value() { return inputs_[0]; }
2347 
2348  DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
2349  DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
2350 };
2351 
2352 
2353 class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2354  public:
2355  explicit LCheckSmi(LOperand* value) {
2356  inputs_[0] = value;
2357  }
2358 
2359  LOperand* value() { return inputs_[0]; }
2360 
2361  DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
2362 };
2363 
2364 
2365 class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2366  public:
2367  explicit LClampDToUint8(LOperand* unclamped) {
2368  inputs_[0] = unclamped;
2369  }
2370 
2371  LOperand* unclamped() { return inputs_[0]; }
2372 
2373  DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
2374 };
2375 
2376 
2377 class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2378  public:
2379  explicit LClampIToUint8(LOperand* unclamped) {
2380  inputs_[0] = unclamped;
2381  }
2382 
2383  LOperand* unclamped() { return inputs_[0]; }
2384 
2385  DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
2386 };
2387 
2388 
2389 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
2390  public:
2392  LOperand* temp_xmm) {
2393  inputs_[0] = unclamped;
2394  temps_[0] = temp_xmm;
2395  }
2396 
2397  LOperand* unclamped() { return inputs_[0]; }
2398  LOperand* temp_xmm() { return temps_[0]; }
2399 
2400  DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2401 };
2402 
2403 
2404 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2405  public:
2406  explicit LCheckNonSmi(LOperand* value) {
2407  inputs_[0] = value;
2408  }
2409 
2410  LOperand* value() { return inputs_[0]; }
2411 
2412  DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2413  DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
2414 };
2415 
2416 
2417 class LDoubleBits V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2418  public:
2419  explicit LDoubleBits(LOperand* value) {
2420  inputs_[0] = value;
2421  }
2422 
2423  LOperand* value() { return inputs_[0]; }
2424 
2425  DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits")
2426  DECLARE_HYDROGEN_ACCESSOR(DoubleBits)
2427 };
2428 
2429 
2430 class LConstructDouble V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2431  public:
2433  inputs_[0] = hi;
2434  inputs_[1] = lo;
2435  }
2436 
2437  LOperand* hi() { return inputs_[0]; }
2438  LOperand* lo() { return inputs_[1]; }
2439 
2440  DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double")
2441 };
2442 
2443 
2444 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 1> {
2445  public:
2446  LAllocate(LOperand* context, LOperand* size, LOperand* temp) {
2447  inputs_[0] = context;
2448  inputs_[1] = size;
2449  temps_[0] = temp;
2450  }
2451 
2452  LOperand* context() { return inputs_[0]; }
2453  LOperand* size() { return inputs_[1]; }
2454  LOperand* temp() { return temps_[0]; }
2455 
2456  DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
2457  DECLARE_HYDROGEN_ACCESSOR(Allocate)
2458 };
2459 
2460 
2461 class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2462  public:
2463  explicit LRegExpLiteral(LOperand* context) {
2464  inputs_[0] = context;
2465  }
2466 
2467  LOperand* context() { return inputs_[0]; }
2468 
2469  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2470  DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
2471 };
2472 
2473 
2474 class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2475  public:
2476  explicit LFunctionLiteral(LOperand* context) {
2477  inputs_[0] = context;
2478  }
2479 
2480  LOperand* context() { return inputs_[0]; }
2481 
2482  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
2483  DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
2484 };
2485 
2486 
2487 class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2488  public:
2489  explicit LToFastProperties(LOperand* value) {
2490  inputs_[0] = value;
2491  }
2492 
2493  LOperand* value() { return inputs_[0]; }
2494 
2495  DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2496  DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2497 };
2498 
2499 
2500 class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2501  public:
2502  LTypeof(LOperand* context, LOperand* value) {
2503  inputs_[0] = context;
2504  inputs_[1] = value;
2505  }
2506 
2507  LOperand* context() { return inputs_[0]; }
2508  LOperand* value() { return inputs_[1]; }
2509 
2510  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2511 };
2512 
2513 
2514 class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 0> {
2515  public:
2516  explicit LTypeofIsAndBranch(LOperand* value) {
2517  inputs_[0] = value;
2518  }
2519 
2520  LOperand* value() { return inputs_[0]; }
2521 
2522  DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2523  DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2524 
2525  Handle<String> type_literal() { return hydrogen()->type_literal(); }
2526 
2527  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2528 };
2529 
2530 
2531 class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 1> {
2532  public:
2534  temps_[0] = temp;
2535  }
2536 
2537  LOperand* temp() { return temps_[0]; }
2538 
2539  DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2540  "is-construct-call-and-branch")
2541  DECLARE_HYDROGEN_ACCESSOR(IsConstructCallAndBranch)
2542 };
2543 
2544 
2545 class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> {
2546  public:
2548 
2549  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
2550  return false;
2551  }
2552  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2553 };
2554 
2555 
2556 class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2557  public:
2558  explicit LStackCheck(LOperand* context) {
2559  inputs_[0] = context;
2560  }
2561 
2562  LOperand* context() { return inputs_[0]; }
2563 
2564  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2565  DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2566 
2567  Label* done_label() { return &done_label_; }
2568 
2569  private:
2570  Label done_label_;
2571 };
2572 
2573 
2574 class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2575  public:
2576  LForInPrepareMap(LOperand* context, LOperand* object) {
2577  inputs_[0] = context;
2578  inputs_[1] = object;
2579  }
2580 
2581  LOperand* context() { return inputs_[0]; }
2582  LOperand* object() { return inputs_[1]; }
2583 
2584  DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2585 };
2586 
2587 
2588 class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2589  public:
2591  inputs_[0] = map;
2592  }
2593 
2594  LOperand* map() { return inputs_[0]; }
2595 
2596  DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2597 
2598  int idx() {
2599  return HForInCacheArray::cast(this->hydrogen_value())->idx();
2600  }
2601 };
2602 
2603 
2604 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 0> {
2605  public:
2607  inputs_[0] = value;
2608  inputs_[1] = map;
2609  }
2610 
2611  LOperand* value() { return inputs_[0]; }
2612  LOperand* map() { return inputs_[1]; }
2613 
2614  DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2615 };
2616 
2617 
2618 class LLoadFieldByIndex V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2619  public:
2621  inputs_[0] = object;
2622  inputs_[1] = index;
2623  }
2624 
2625  LOperand* object() { return inputs_[0]; }
2626  LOperand* index() { return inputs_[1]; }
2627 
2628  DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2629 };
2630 
2631 
2632 class LChunkBuilder;
2633 class LPlatformChunk V8_FINAL : public LChunk {
2634  public:
2636  : LChunk(info, graph),
2637  dehoisted_key_ids_(graph->GetMaximumValueID(), graph->zone()) { }
2638 
2639  int GetNextSpillIndex(RegisterKind kind);
2640  LOperand* GetNextSpillSlot(RegisterKind kind);
2641  BitVector* GetDehoistedKeyIds() { return &dehoisted_key_ids_; }
2642  bool IsDehoistedKey(HValue* value) {
2643  return dehoisted_key_ids_.Contains(value->id());
2644  }
2645 
2646  private:
2647  BitVector dehoisted_key_ids_;
2648 };
2649 
2650 
2651 class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
2652  public:
2653  LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2654  : LChunkBuilderBase(graph->zone()),
2655  chunk_(NULL),
2656  info_(info),
2657  graph_(graph),
2658  status_(UNUSED),
2659  current_instruction_(NULL),
2660  current_block_(NULL),
2661  next_block_(NULL),
2662  allocator_(allocator) { }
2663 
2664  // Build the sequence for the graph.
2665  LPlatformChunk* Build();
2666 
2667  LInstruction* CheckElideControlInstruction(HControlInstruction* instr);
2668 
2669  // Declare methods that deal with the individual node types.
2670 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2672 #undef DECLARE_DO
2673 
2674  LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2675  LInstruction* DoMathRound(HUnaryMathOperation* instr);
2676  LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2677  LInstruction* DoMathLog(HUnaryMathOperation* instr);
2678  LInstruction* DoMathExp(HUnaryMathOperation* instr);
2679  LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2680  LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2681  LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2682  LInstruction* DoDivByPowerOf2I(HDiv* instr);
2683  LInstruction* DoDivByConstI(HDiv* instr);
2684  LInstruction* DoDivI(HBinaryOperation* instr);
2685  LInstruction* DoModByPowerOf2I(HMod* instr);
2686  LInstruction* DoModByConstI(HMod* instr);
2687  LInstruction* DoModI(HMod* instr);
2688  LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2689  LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2690 
2691  private:
2692  enum Status {
2693  UNUSED,
2694  BUILDING,
2695  DONE,
2696  ABORTED
2697  };
2698 
2699  LPlatformChunk* chunk() const { return chunk_; }
2700  CompilationInfo* info() const { return info_; }
2701  HGraph* graph() const { return graph_; }
2702 
2703  bool is_unused() const { return status_ == UNUSED; }
2704  bool is_building() const { return status_ == BUILDING; }
2705  bool is_done() const { return status_ == DONE; }
2706  bool is_aborted() const { return status_ == ABORTED; }
2707 
2708  void Abort(BailoutReason reason);
2709 
2710  // Methods for getting operands for Use / Define / Temp.
2711  LUnallocated* ToUnallocated(Register reg);
2712  LUnallocated* ToUnallocated(XMMRegister reg);
2713 
2714  // Methods for setting up define-use relationships.
2715  MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2716  MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2717  MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2718  XMMRegister fixed_register);
2719 
2720  // A value that is guaranteed to be allocated to a register.
2721  // Operand created by UseRegister is guaranteed to be live until the end of
2722  // instruction. This means that register allocator will not reuse it's
2723  // register for any other operand inside instruction.
2724  // Operand created by UseRegisterAtStart is guaranteed to be live only at
2725  // instruction start. Register allocator is free to assign the same register
2726  // to some other operand used inside instruction (i.e. temporary or
2727  // output).
2728  MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2729  MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2730 
2731  // An input operand in a register that may be trashed.
2732  MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2733 
2734  // An input operand in a register that may be trashed or a constant operand.
2735  MUST_USE_RESULT LOperand* UseTempRegisterOrConstant(HValue* value);
2736 
2737  // An input operand in a register or stack slot.
2738  MUST_USE_RESULT LOperand* Use(HValue* value);
2739  MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2740 
2741  // An input operand in a register, stack slot or a constant operand.
2742  MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2743  MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2744 
2745  // An input operand in a register or a constant operand.
2746  MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2747  MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2748 
2749  // An input operand in a constant operand.
2750  MUST_USE_RESULT LOperand* UseConstant(HValue* value);
2751 
2752  // An input operand in register, stack slot or a constant operand.
2753  // Will not be moved to a register even if one is freely available.
2754  virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE;
2755 
2756  // Temporary operand that must be in a register.
2757  MUST_USE_RESULT LUnallocated* TempRegister();
2758  MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2759  MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2760 
2761  // Methods for setting up define-use relationships.
2762  // Return the same instruction that they are passed.
2763  LInstruction* Define(LTemplateResultInstruction<1>* instr,
2764  LUnallocated* result);
2765  LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
2766  LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
2767  int index);
2768  LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
2769  LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
2770  Register reg);
2771  LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
2772  XMMRegister reg);
2773  // Assigns an environment to an instruction. An instruction which can
2774  // deoptimize must have an environment.
2775  LInstruction* AssignEnvironment(LInstruction* instr);
2776  // Assigns a pointer map to an instruction. An instruction which can
2777  // trigger a GC or a lazy deoptimization must have a pointer map.
2778  LInstruction* AssignPointerMap(LInstruction* instr);
2779 
2780  enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2781 
2782  // Marks a call for the register allocator. Assigns a pointer map to
2783  // support GC and lazy deoptimization. Assigns an environment to support
2784  // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY.
2785  LInstruction* MarkAsCall(
2786  LInstruction* instr,
2787  HInstruction* hinstr,
2788  CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2789 
2790  void VisitInstruction(HInstruction* current);
2791 
2792  void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2793  LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2794  LInstruction* DoArithmeticD(Token::Value op,
2795  HArithmeticBinaryOperation* instr);
2796  LInstruction* DoArithmeticT(Token::Value op,
2797  HBinaryOperation* instr);
2798  void FindDehoistedKeyDefinitions(HValue* candidate);
2799 
2800  LPlatformChunk* chunk_;
2801  CompilationInfo* info_;
2802  HGraph* const graph_;
2803  Status status_;
2804  HInstruction* current_instruction_;
2805  HBasicBlock* current_block_;
2806  HBasicBlock* next_block_;
2807  LAllocator* allocator_;
2808 
2809  DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2810 };
2811 
2812 #undef DECLARE_HYDROGEN_ACCESSOR
2813 #undef DECLARE_CONCRETE_INSTRUCTION
2814 
2815 } } // namespace v8::int
2816 
2817 #endif // V8_X64_LITHIUM_X64_H_
LCallFunction(LOperand *context, LOperand *function)
Definition: lithium-x64.h:1884
LSeqStringSetChar(LOperand *context, LOperand *string, LOperand *index, LOperand *value)
Definition: lithium-x64.h:1410
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)
Definition: lithium-x64.h:2620
LModByConstI(LOperand *dividend, int32_t divisor, LOperand *temp1, LOperand *temp2)
Definition: lithium-x64.h:650
virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment *env) V8_OVERRIDE
Definition: lithium-x64.h:1195
LBranch(LOperand *value)
Definition: lithium-x64.h:1330
virtual Opcode opcode() const V8_OVERRIDE
Definition: lithium-x64.h:1491
LCmpObjectEqAndBranch(LOperand *left, LOperand *right)
Definition: lithium-x64.h:945
static LGap * cast(LInstruction *instr)
Definition: lithium-x64.h:353
LClampTToUint8(LOperand *unclamped, LOperand *temp_xmm)
Definition: lithium-x64.h:2391
virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment *env)
Definition: lithium-x64.h:261
LPower(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1466
void set_pointer_map(LPointerMap *p)
Definition: lithium-x64.h:246
bool IsMarkedAsCall() const
Definition: lithium-x64.h:264
virtual bool HasInterestingComment(LCodeGen *gen) const V8_OVERRIDE
Definition: lithium-x64.h:393
LModI(LOperand *left, LOperand *right, LOperand *temp)
Definition: lithium-x64.h:675
LCheckInstanceType(LOperand *value)
Definition: lithium-x64.h:2329
LMathFloor(LOperand *value)
Definition: lithium-x64.h:837
LOperand * receiver()
Definition: lithium-x64.h:564
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-x64.h:242
LOperand * char_code()
Definition: lithium-x64.h:2307
LSmiTag(LOperand *value)
Definition: lithium-x64.h:2075
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-x64.h:892
Definition: v8.h:1407
LForInCacheArray(LOperand *map)
Definition: lithium-x64.h:2590
static Smi * FromInt(int value)
Definition: objects-inl.h:1209
LOperand * context()
Definition: lithium-x64.h:497
LInstanceOf(LOperand *context, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1161
LFlooringDivByConstI(LOperand *dividend, int32_t divisor, LOperand *temp1, LOperand *temp2, LOperand *temp3)
Definition: lithium-x64.h:771
LParallelMove * GetOrCreateParallelMove(InnerPosition pos, Zone *zone)
Definition: lithium-x64.h:371
#define DECLARE_OPCODE(type)
Definition: lithium-x64.h:222
bool is_loop_header() const
Definition: lithium-x64.h:469
virtual bool MustSignExtendResult(LPlatformChunk *chunk) const
Definition: lithium-x64.h:274
LStringAdd(LOperand *context, LOperand *left, LOperand *right)
Definition: lithium-x64.h:2267
LDummyUse(LOperand *value)
Definition: lithium-x64.h:442
LLabel(HBasicBlock *block)
Definition: lithium-x64.h:458
bool needs_check() const
Definition: lithium-x64.h:2107
Smi * index() const
Definition: lithium-x64.h:1383
LStoreNamedGeneric(LOperand *context, LOperand *object, LOperand *value)
Definition: lithium-x64.h:2142
Handle< Object > name() const
Definition: lithium-x64.h:1582
LConstantD(LOperand *temp)
Definition: lithium-x64.h:1293
LBoundsCheck(LOperand *index, LOperand *length)
Definition: lithium-x64.h:1207
int int32_t
Definition: unicode.cc:47
LMathPowHalf(LOperand *value)
Definition: lithium-x64.h:933
LIsConstructCallAndBranch(LOperand *temp)
Definition: lithium-x64.h:2533
LEnvironment * environment() const
Definition: lithium-x64.h:243
StrictMode strict_mode()
Definition: lithium-x64.h:2158
LArithmeticD(Token::Value op, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1481
#define ASSERT(condition)
Definition: checks.h:329
LArithmeticT(Token::Value op, LOperand *context, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1504
LCompareMinusZeroAndBranch(LOperand *value)
Definition: lithium-x64.h:972
bool is_typed_elements() const
Definition: lithium-x64.h:1624
LConstantOperand * constant_parameter_count()
Definition: lithium-x64.h:1546
virtual bool IsGap() const V8_FINAL V8_OVERRIDE
Definition: lithium-x64.h:351
#define DECLARE_DO(type)
Definition: lithium-x64.h:2670
LStringCharCodeAt(LOperand *context, LOperand *string, LOperand *index)
Definition: lithium-x64.h:2284
LDateField(LOperand *date, Smi *index)
Definition: lithium-x64.h:1378
LIsStringAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1002
virtual const char * Mnemonic() const =0
LChunkBuilder(CompilationInfo *info, HGraph *graph, LAllocator *allocator)
Definition: lithium-x64.h:2653
LNumberTagU(LOperand *value, LOperand *temp1, LOperand *temp2)
Definition: lithium-x64.h:1997
LCallStub(LOperand *context)
Definition: lithium-x64.h:493
LCallRuntime(LOperand *context)
Definition: lithium-x64.h:1938
LAddI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1431
LTypeofIsAndBranch(LOperand *value)
Definition: lithium-x64.h:2516
EmbeddedContainer< LOperand *, R > results_
Definition: lithium-arm.h:313
LCmpT(LOperand *context, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1142
virtual void PrintDataTo(StringStream *stream)
Definition: lithium-arm.cc:86
LCheckMapValue(LOperand *value, LOperand *map)
Definition: lithium-x64.h:2606
#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
Definition: lithium-x64.h:43
LFlooringDivByPowerOf2I(LOperand *dividend, int32_t divisor)
Definition: lithium-x64.h:752
LNumberTagD(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:2013
LCheckMaps(LOperand *value)
Definition: lithium-x64.h:2342
LCallNewArray(LOperand *context, LOperand *constructor)
Definition: lithium-x64.h:1919
LOperand * parameter_count()
Definition: lithium-x64.h:1550
LOperand * arguments()
Definition: lithium-x64.h:601
virtual bool ClobbersDoubleRegisters() const
Definition: lithium-x64.h:259
LCallJSFunction(LOperand *function)
Definition: lithium-x64.h:1817
Label * FalseLabel(LChunk *chunk)
Definition: lithium-x64.h:536
Token::Value op() const
Definition: lithium-x64.h:1230
Representation representation() const
Definition: lithium-x64.h:2134
LOperand * unclamped()
Definition: lithium-x64.h:2371
LOperand * target() const
Definition: lithium-x64.h:1842
virtual LOperand * result() const =0
virtual bool HasInterestingComment(LCodeGen *gen) const
Definition: lithium-x64.h:272
void set(T *value)
Definition: utils.h:515
LClampIToUint8(LOperand *unclamped)
Definition: lithium-x64.h:2379
LGetCachedArrayIndex(LOperand *value)
Definition: lithium-x64.h:1092
LBitI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1222
LGoto(HBasicBlock *block)
Definition: lithium-x64.h:403
LClassOfTestAndBranch(LOperand *value, LOperand *temp, LOperand *temp2)
Definition: lithium-x64.h:1122
LAccessArgumentsAt(LOperand *arguments, LOperand *length, LOperand *index)
Definition: lithium-x64.h:595
LDoubleToSmi(LOperand *value)
Definition: lithium-x64.h:2044
bool has_constant_parameter_count()
Definition: lithium-x64.h:1543
LClampDToUint8(LOperand *unclamped)
Definition: lithium-x64.h:2367
#define DECLARE_PREDICATE(type)
Definition: lithium-x64.h:231
LDivByConstI(LOperand *dividend, int32_t divisor, LOperand *temp1, LOperand *temp2)
Definition: lithium-x64.h:710
void set_hydrogen_value(HValue *value)
Definition: lithium-x64.h:250
int32_t divisor() const
Definition: lithium-x64.h:638
LMathExp(LOperand *value, LOperand *temp1, LOperand *temp2)
Definition: lithium-x64.h:904
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
LLoadContextSlot(LOperand *context)
Definition: lithium-x64.h:1694
LIsSmiAndBranch(LOperand *value)
Definition: lithium-x64.h:1019
LCmpHoleAndBranch(LOperand *object)
Definition: lithium-x64.h:959
virtual bool HasResult() const =0
LDoubleToI(LOperand *value)
Definition: lithium-x64.h:2029
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
Definition: lithium-x64.h:1779
virtual Opcode opcode() const =0
LTypeof(LOperand *context, LOperand *value)
Definition: lithium-x64.h:2502
LModByPowerOf2I(LOperand *dividend, int32_t divisor)
Definition: lithium-x64.h:632
#define MUST_USE_RESULT
Definition: globals.h:381
LCallNew(LOperand *context, LOperand *constructor)
Definition: lithium-x64.h:1900
LMathAbs(LOperand *context, LOperand *value)
Definition: lithium-x64.h:865
LCheckValue(LOperand *value)
Definition: lithium-x64.h:2316
LPlatformChunk(CompilationInfo *info, HGraph *graph)
Definition: lithium-x64.h:2635
ElementsKind from_kind()
Definition: lithium-x64.h:2244
int TrueDestination(LChunk *chunk)
Definition: lithium-x64.h:523
LCmpMapAndBranch(LOperand *value)
Definition: lithium-x64.h:1351
bool can_deopt() const
Definition: lithium-x64.h:1248
LOperand * new_map_temp()
Definition: lithium-x64.h:2231
HBasicBlock * SuccessorAt(int i)
Definition: lithium-x64.h:521
virtual bool IsControl() const V8_FINAL V8_OVERRIDE
Definition: lithium-x64.h:518
LOperand * dividend()
Definition: lithium-x64.h:637
LDeclareGlobals(LOperand *context)
Definition: lithium-x64.h:1804
LDivI(LOperand *left, LOperand *right, LOperand *temp)
Definition: lithium-x64.h:735
LNumberTagI(LOperand *value)
Definition: lithium-x64.h:1985
bool HasEnvironment() const
Definition: lithium-x64.h:244
LArgumentsLength(LOperand *elements)
Definition: lithium-x64.h:613
LCompareNumericAndBranch(LOperand *left, LOperand *right)
Definition: lithium-x64.h:814
ElementsKind elements_kind() const
Definition: lithium-x64.h:1631
LIsObjectAndBranch(LOperand *value)
Definition: lithium-x64.h:987
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: globals.h:359
LTaggedToI(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:2058
bool HasReplacement() const
Definition: lithium-x64.h:474
LMathSqrt(LOperand *value)
Definition: lithium-x64.h:921
LIsUndetectableAndBranch(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1034
LToFastProperties(LOperand *value)
Definition: lithium-x64.h:2489
LLoadKeyedGeneric(LOperand *context, LOperand *obj, LOperand *key)
Definition: lithium-x64.h:1639
DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,"compare-numeric-and-branch") Token bool is_double() const
Definition: lithium-x64.h:827
LMapEnumLength(LOperand *value)
Definition: lithium-x64.h:1366
HBasicBlock * block() const
Definition: lithium-arm.h:356
virtual void PrintTo(StringStream *stream)
Definition: lithium-arm.cc:67
LOperand * global_object()
Definition: lithium-x64.h:1671
LLoadKeyed(LOperand *elements, LOperand *key)
Definition: lithium-x64.h:1610
LStoreKeyedGeneric(LOperand *context, LOperand *object, LOperand *key, LOperand *value)
Definition: lithium-x64.h:2193
#define DECLARE_HYDROGEN_ACCESSOR(type)
Definition: lithium-x64.h:198
#define T(name, string, precedence)
Definition: token.cc:48
LReturn(LOperand *value, LOperand *context, LOperand *parameter_count)
Definition: lithium-x64.h:1532
LMathMinMax(LOperand *left, LOperand *right)
Definition: lithium-x64.h:1451
bool ClobbersTemps() const
Definition: lithium-x64.h:257
LAllocate(LOperand *context, LOperand *size, LOperand *temp)
Definition: lithium-x64.h:2446
virtual bool IsControl() const
Definition: lithium-x64.h:240
LPointerMap * pointer_map() const
Definition: lithium-x64.h:247
void set_replacement(LLabel *label)
Definition: lithium-x64.h:473
LStoreCodeEntry(LOperand *function, LOperand *code_object)
Definition: lithium-x64.h:1757
LStoreContextSlot(LOperand *context, LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1711
LOperand * index() const
Definition: lithium-x64.h:1401
bool is_osr_entry() const
Definition: lithium-x64.h:470
ElementsKind to_kind()
Definition: lithium-x64.h:2245
EmbeddedContainer< LOperand *, I > inputs_
Definition: lithium-arm.h:323
LApplyArguments(LOperand *function, LOperand *receiver, LOperand *length, LOperand *elements)
Definition: lithium-x64.h:574
LOperand * offset() const
Definition: lithium-x64.h:1780
virtual bool IsGap() const
Definition: lithium-x64.h:238
bool for_typeof() const
Definition: lithium-x64.h:1673
LOperand * elements()
Definition: lithium-x64.h:587
#define V8_OVERRIDE
Definition: v8config.h:402
LMathLog(LOperand *value)
Definition: lithium-x64.h:880
LSeqStringGetChar(LOperand *string, LOperand *index)
Definition: lithium-x64.h:1395
LLoadNamedField(LOperand *object)
Definition: lithium-x64.h:1559
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)
Definition: lithium-x64.h:1260
LHasInstanceTypeAndBranch(LOperand *value)
Definition: lithium-x64.h:1076
LCheckSmi(LOperand *value)
Definition: lithium-x64.h:2355
virtual bool MustSignExtendResult(LPlatformChunk *chunk) const V8_FINAL V8_OVERRIDE
Label * TrueLabel(LChunk *chunk)
Definition: lithium-x64.h:530
int block_id() const
Definition: lithium-x64.h:410
LShiftI(Token::Value op, LOperand *left, LOperand *right, bool can_deopt)
Definition: lithium-x64.h:1239
LCallWithDescriptor(const CallInterfaceDescriptor *descriptor, ZoneList< LOperand * > &operands, Zone *zone)
Definition: lithium-x64.h:1834
bool is_external() const
Definition: lithium-x64.h:2170
LNumberUntagD(LOperand *value)
Definition: lithium-x64.h:2088
virtual void CompileToNative(LCodeGen *generator)=0
LLabel * replacement() const
Definition: lithium-x64.h:472
LStoreGlobalCell(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1679
LDoubleBits(LOperand *value)
Definition: lithium-x64.h:2419
Handle< Map > transitioned_map()
Definition: lithium-x64.h:2241
LEnvironment * GetDeferredLazyDeoptimizationEnvironment()
Definition: lithium-x64.h:1192
virtual bool HasResult() const V8_FINAL V8_OVERRIDE
Definition: lithium-x64.h:307
uint32_t additional_index() const
Definition: lithium-x64.h:1630
LLoadNamedGeneric(LOperand *context, LOperand *object)
Definition: lithium-x64.h:1572
LMathRound(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:850
LOperand * constructor()
Definition: lithium-x64.h:1906
bool IsDehoistedKey(HValue *value)
Definition: lithium-x64.h:2642
LWrapReceiver(LOperand *receiver, LOperand *function)
Definition: lithium-x64.h:559
LCheckNonSmi(LOperand *value)
Definition: lithium-x64.h:2406
LParallelMove * GetParallelMove(InnerPosition pos)
Definition: lithium-x64.h:379
bool ClobbersRegisters() const
Definition: lithium-x64.h:258
LStringCompareAndBranch(LOperand *context, LOperand *left, LOperand *right)
Definition: lithium-x64.h:1052
LForInPrepareMap(LOperand *context, LOperand *object)
Definition: lithium-x64.h:2576
Label * GetAssemblyLabel(int block_id) const
Definition: lithium.cc:278
LTransitionElementsKind(LOperand *object, LOperand *context, LOperand *new_map_temp, LOperand *temp)
Definition: lithium-x64.h:2219
bool is_fixed_typed_array() const
Definition: lithium-x64.h:1621
void set_result(LOperand *operand)
Definition: lithium-x64.h:310
HeapObject * obj
bool HasPointerMap() const
Definition: lithium-x64.h:248
LInstructionGap(HBasicBlock *block)
Definition: lithium-x64.h:391
LPushArgument(LOperand *value)
Definition: lithium-x64.h:1732
LOperand * string() const
Definition: lithium-x64.h:1400
LStoreKeyed(LOperand *object, LOperand *key, LOperand *value)
Definition: lithium-x64.h:2164
LFunctionLiteral(LOperand *context)
Definition: lithium-x64.h:2476
LInvokeFunction(LOperand *context, LOperand *function)
Definition: lithium-x64.h:1865
LMulI(LOperand *left, LOperand *right)
Definition: lithium-x64.h:799
bool IsRedundant() const
Definition: lithium-arm.cc:113
LStackCheck(LOperand *context)
Definition: lithium-x64.h:2558
int LookupDestination(int block_id) const
Definition: lithium.cc:270
LInstanceOfKnownGlobal(LOperand *context, LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1177
LStringCharFromCode(LOperand *context, LOperand *char_code)
Definition: lithium-x64.h:2301
LInnerAllocatedObject(LOperand *base_object, LOperand *offset)
Definition: lithium-x64.h:1774
LOperand * code_object()
Definition: lithium-x64.h:1763
LStoreNamedField(LOperand *object, LOperand *value, LOperand *temp)
Definition: lithium-x64.h:2118
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)
Definition: lithium-x64.h:1588
LSmiUntag(LOperand *value, bool needs_check)
Definition: lithium-x64.h:2101
HValue * hydrogen_value() const
Definition: lithium-x64.h:251
LDivByPowerOf2I(LOperand *dividend, int32_t divisor)
Definition: lithium-x64.h:692
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,"instance-of-known-global") Handle< JSFunction > function() const
Definition: lithium-x64.h:1187
LUint32ToDouble(LOperand *value, LOperand *temp)
Definition: lithium-x64.h:1971
SaveFPRegsMode save_doubles() const
Definition: lithium-x64.h:1953
int FalseDestination(LChunk *chunk)
Definition: lithium-x64.h:526
LLoadGlobalGeneric(LOperand *context, LOperand *global_object)
Definition: lithium-x64.h:1662
BitVector * GetDehoistedKeyIds()
Definition: lithium-x64.h:2641
LRegExpLiteral(LOperand *context)
Definition: lithium-x64.h:2463
LTrapAllocationMemento(LOperand *object, LOperand *temp)
Definition: lithium-x64.h:2251
LInteger32ToDouble(LOperand *value)
Definition: lithium-x64.h:1959
static bool UseLea(HAdd *add)
Definition: lithium-x64.h:1439
LGap(HBasicBlock *block)
Definition: lithium-x64.h:342
#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)
Definition: lithium-x64.h:184
LHasCachedArrayIndexAndBranch(LOperand *value)
Definition: lithium-x64.h:1106
LConstructDouble(LOperand *hi, LOperand *lo)
Definition: lithium-x64.h:2432
bool is_set() const
Definition: utils.h:508