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