Revision f230a1cf deps/v8/src/mips/lithium-mips.h

View differences:

deps/v8/src/mips/lithium-mips.h
105 105
  V(InnerAllocatedObject)                       \
106 106
  V(InstanceOf)                                 \
107 107
  V(InstanceOfKnownGlobal)                      \
108
  V(InstanceSize)                               \
109 108
  V(InstructionGap)                             \
110 109
  V(Integer32ToDouble)                          \
111 110
  V(Integer32ToSmi)                             \
......
113 112
  V(IsConstructCallAndBranch)                   \
114 113
  V(IsObjectAndBranch)                          \
115 114
  V(IsStringAndBranch)                          \
116
  V(IsNumberAndBranch)                          \
117 115
  V(IsSmiAndBranch)                             \
118 116
  V(IsUndetectableAndBranch)                    \
119 117
  V(Label)                                      \
120 118
  V(LazyBailout)                                \
121 119
  V(LoadContextSlot)                            \
122 120
  V(LoadExternalArrayPointer)                   \
121
  V(LoadRoot)                                   \
123 122
  V(LoadFieldByIndex)                           \
124 123
  V(LoadFunctionPrototype)                      \
125 124
  V(LoadGlobalCell)                             \
......
213 212
      : environment_(NULL),
214 213
        hydrogen_value_(NULL),
215 214
        bit_field_(IsCallBits::encode(false)) {
216
    set_position(RelocInfo::kNoPosition);
217 215
  }
218 216

  
219 217
  virtual ~LInstruction() {}
......
254 252
  LPointerMap* pointer_map() const { return pointer_map_.get(); }
255 253
  bool HasPointerMap() const { return pointer_map_.is_set(); }
256 254

  
257
  // The 31 bits PositionBits is used to store the int position value. And the
258
  // position value may be RelocInfo::kNoPosition (-1). The accessor always
259
  // +1/-1 so that the encoded value of position in bit_field_ is always >= 0
260
  // and can fit into the 31 bits PositionBits.
261
  void set_position(int pos) {
262
    bit_field_ = PositionBits::update(bit_field_, pos + 1);
263
  }
264
  int position() { return PositionBits::decode(bit_field_) - 1; }
265

  
266 255
  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
267 256
  HValue* hydrogen_value() const { return hydrogen_value_; }
268 257

  
......
274 263
  // Interface to the register allocator and iterators.
275 264
  bool ClobbersTemps() const { return IsCall(); }
276 265
  bool ClobbersRegisters() const { return IsCall(); }
277
  bool ClobbersDoubleRegisters() const { return IsCall(); }
266
  virtual bool ClobbersDoubleRegisters() const { return IsCall(); }
278 267

  
279 268
  // Interface to the register allocator and iterators.
280 269
  bool IsMarkedAsCall() const { return IsCall(); }
......
302 291
  virtual LOperand* TempAt(int i) = 0;
303 292

  
304 293
  class IsCallBits: public BitField<bool, 0, 1> {};
305
  class PositionBits: public BitField<int, 1, 31> {};
306 294

  
307 295
  LEnvironment* environment_;
308 296
  SetOncePointer<LPointerMap> pointer_map_;
......
401 389

  
402 390
class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> {
403 391
 public:
404
  explicit LGoto(int block_id) : block_id_(block_id) { }
392
  explicit LGoto(HBasicBlock* block) : block_(block) { }
405 393

  
406 394
  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE;
407 395
  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
408 396
  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
409 397
  virtual bool IsControl() const V8_OVERRIDE { return true; }
410 398

  
411
  int block_id() const { return block_id_; }
399
  int block_id() const { return block_->block_id(); }
412 400

  
413 401
 private:
414
  int block_id_;
402
  HBasicBlock* block_;
415 403
};
416 404

  
417 405

  
......
482 470
};
483 471

  
484 472

  
485
class LCallStub V8_FINAL : public LTemplateInstruction<1, 0, 0> {
473
class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> {
486 474
 public:
475
  explicit LCallStub(LOperand* context) {
476
    inputs_[0] = context;
477
  }
478

  
479
  LOperand* context() { return inputs_[0]; }
480

  
487 481
  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
488 482
  DECLARE_HYDROGEN_ACCESSOR(CallStub)
489 483

  
......
688 682
};
689 683

  
690 684

  
691
class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
685
class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
692 686
 public:
693
  LMulI(LOperand* left, LOperand* right, LOperand* temp) {
687
  LMulI(LOperand* left, LOperand* right) {
694 688
    inputs_[0] = left;
695 689
    inputs_[1] = right;
696
    temps_[0] = temp;
697 690
  }
698 691

  
699 692
  LOperand* left() { return inputs_[0]; }
700 693
  LOperand* right() { return inputs_[1]; }
701
  LOperand* temp() { return temps_[0]; }
702 694

  
703 695
  DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
704 696
  DECLARE_HYDROGEN_ACCESSOR(Mul)
......
782 774
};
783 775

  
784 776

  
785
class LMathAbs V8_FINAL : public LTemplateInstruction<1, 1, 0> {
777
class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
786 778
 public:
787
  explicit LMathAbs(LOperand* value) {
779
  LMathAbs(LOperand* context, LOperand* value) {
780
    inputs_[1] = context;
788 781
    inputs_[0] = value;
789 782
  }
790 783

  
784
  LOperand* context() { return inputs_[1]; }
791 785
  LOperand* value() { return inputs_[0]; }
792 786

  
793 787
  DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
......
936 930
};
937 931

  
938 932

  
939
class LIsNumberAndBranch V8_FINAL : public LControlInstruction<1, 0> {
940
 public:
941
  explicit LIsNumberAndBranch(LOperand* value) {
942
    inputs_[0] = value;
943
  }
944

  
945
  LOperand* value() { return inputs_[0]; }
946

  
947
  DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch")
948
  DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch)
949
};
950

  
951

  
952 933
class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
953 934
 public:
954 935
  LIsStringAndBranch(LOperand* value, LOperand* temp) {
......
999 980
};
1000 981

  
1001 982

  
1002
class LStringCompareAndBranch V8_FINAL : public LControlInstruction<2, 0> {
983
class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
1003 984
 public:
1004
  LStringCompareAndBranch(LOperand* left, LOperand* right) {
1005
    inputs_[0] = left;
1006
    inputs_[1] = right;
985
  LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
986
    inputs_[0] = context;
987
    inputs_[1] = left;
988
    inputs_[2] = right;
1007 989
  }
1008 990

  
1009
  LOperand* left() { return inputs_[0]; }
1010
  LOperand* right() { return inputs_[1]; }
991
  LOperand* context() { return inputs_[0]; }
992
  LOperand* left() { return inputs_[1]; }
993
  LOperand* right() { return inputs_[2]; }
1011 994

  
1012 995
  DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1013 996
                               "string-compare-and-branch")
......
1083 1066
};
1084 1067

  
1085 1068

  
1086
class LCmpT V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1069
class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1087 1070
 public:
1088
  LCmpT(LOperand* left, LOperand* right) {
1089
    inputs_[0] = left;
1090
    inputs_[1] = right;
1071
  LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1072
    inputs_[0] = context;
1073
    inputs_[1] = left;
1074
    inputs_[2] = right;
1091 1075
  }
1092 1076

  
1093
  LOperand* left() { return inputs_[0]; }
1094
  LOperand* right() { return inputs_[1]; }
1077
  LOperand* context() { return inputs_[0]; }
1078
  LOperand* left() { return inputs_[1]; }
1079
  LOperand* right() { return inputs_[2]; }
1095 1080

  
1096 1081
  DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
1097 1082
  DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
......
1100 1085
};
1101 1086

  
1102 1087

  
1103
class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1088
class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1104 1089
 public:
1105
  LInstanceOf(LOperand* left, LOperand* right) {
1106
    inputs_[0] = left;
1107
    inputs_[1] = right;
1090
  LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1091
    inputs_[0] = context;
1092
    inputs_[1] = left;
1093
    inputs_[2] = right;
1108 1094
  }
1109 1095

  
1110
  LOperand* left() { return inputs_[0]; }
1111
  LOperand* right() { return inputs_[1]; }
1096
  LOperand* context() { return inputs_[0]; }
1097
  LOperand* left() { return inputs_[1]; }
1098
  LOperand* right() { return inputs_[2]; }
1112 1099

  
1113 1100
  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1114 1101
};
1115 1102

  
1116 1103

  
1117
class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 1, 1> {
1104
class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 2, 1> {
1118 1105
 public:
1119
  LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
1120
    inputs_[0] = value;
1106
  LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) {
1107
    inputs_[0] = context;
1108
    inputs_[1] = value;
1121 1109
    temps_[0] = temp;
1122 1110
  }
1123 1111

  
1124
  LOperand* value() { return inputs_[0]; }
1112
  LOperand* context() { return inputs_[0]; }
1113
  LOperand* value() { return inputs_[1]; }
1125 1114
  LOperand* temp() { return temps_[0]; }
1126 1115

  
1127 1116
  DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
......
1142 1131
};
1143 1132

  
1144 1133

  
1145
class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1146
 public:
1147
  explicit LInstanceSize(LOperand* object) {
1148
    inputs_[0] = object;
1149
  }
1150

  
1151
  LOperand* object() { return inputs_[0]; }
1152

  
1153
  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
1154
  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
1155
};
1156

  
1157

  
1158 1134
class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1159 1135
 public:
1160 1136
  LBoundsCheck(LOperand* index, LOperand* length) {
......
1300 1276
  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1301 1277
  DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1302 1278

  
1303
  Handle<Map> map() const { return hydrogen()->map(); }
1279
  Handle<Map> map() const { return hydrogen()->map().handle(); }
1304 1280
};
1305 1281

  
1306 1282

  
......
1355 1331
  LOperand* temp() { return temps_[0]; }
1356 1332
  Smi* index() const { return index_; }
1357 1333

  
1358
  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1359
  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1334
  DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1335
  DECLARE_HYDROGEN_ACCESSOR(DateField)
1360 1336

  
1361 1337
 private:
1362 1338
  Smi* index_;
......
1387 1363
};
1388 1364

  
1389 1365

  
1390
class LThrow V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1366
class LThrow V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1391 1367
 public:
1392
  explicit LThrow(LOperand* value) {
1393
    inputs_[0] = value;
1368
  LThrow(LOperand* context, LOperand* value) {
1369
    inputs_[0] = context;
1370
    inputs_[1] = value;
1394 1371
  }
1395 1372

  
1396
  LOperand* value() { return inputs_[0]; }
1373
  LOperand* context() { return inputs_[0]; }
1374
  LOperand* value() { return inputs_[1]; }
1397 1375

  
1398 1376
  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1399 1377
};
......
1489 1467
};
1490 1468

  
1491 1469

  
1492
class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1470
class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1493 1471
 public:
1494
  LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1472
  LArithmeticT(Token::Value op,
1473
               LOperand* context,
1474
               LOperand* left,
1475
               LOperand* right)
1495 1476
      : op_(op) {
1496
    inputs_[0] = left;
1497
    inputs_[1] = right;
1477
    inputs_[0] = context;
1478
    inputs_[1] = left;
1479
    inputs_[2] = right;
1498 1480
  }
1499 1481

  
1500
  LOperand* left() { return inputs_[0]; }
1501
  LOperand* right() { return inputs_[1]; }
1482
  LOperand* context() { return inputs_[0]; }
1483
  LOperand* left() { return inputs_[1]; }
1484
  LOperand* right() { return inputs_[2]; }
1502 1485
  Token::Value op() const { return op_; }
1503 1486

  
1504 1487
  virtual Opcode opcode() const V8_FINAL  { return LInstruction::kArithmeticT; }
......
1510 1493
};
1511 1494

  
1512 1495

  
1513
class LReturn V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1496
class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> {
1514 1497
 public:
1515
  explicit LReturn(LOperand* value, LOperand* parameter_count) {
1498
  LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
1516 1499
    inputs_[0] = value;
1517
    inputs_[1] = parameter_count;
1500
    inputs_[1] = context;
1501
    inputs_[2] = parameter_count;
1518 1502
  }
1519 1503

  
1520 1504
  LOperand* value() { return inputs_[0]; }
......
1526 1510
    ASSERT(has_constant_parameter_count());
1527 1511
    return LConstantOperand::cast(parameter_count());
1528 1512
  }
1529
  LOperand* parameter_count() { return inputs_[1]; }
1513
  LOperand* parameter_count() { return inputs_[2]; }
1530 1514

  
1531 1515
  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1532 1516
};
......
1545 1529
};
1546 1530

  
1547 1531

  
1548
class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1532
class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1549 1533
 public:
1550
  explicit LLoadNamedGeneric(LOperand* object) {
1551
    inputs_[0] = object;
1534
  LLoadNamedGeneric(LOperand* context, LOperand* object) {
1535
    inputs_[0] = context;
1536
    inputs_[1] = object;
1552 1537
  }
1553 1538

  
1554
  LOperand* object() { return inputs_[0]; }
1539
  LOperand* context() { return inputs_[0]; }
1540
  LOperand* object() { return inputs_[1]; }
1555 1541

  
1556 1542
  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1557 1543
  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
......
1573 1559
};
1574 1560

  
1575 1561

  
1562
class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1563
 public:
1564
  DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1565
  DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1566

  
1567
  Heap::RootListIndex index() const { return hydrogen()->index(); }
1568
};
1569

  
1570

  
1576 1571
class LLoadExternalArrayPointer V8_FINAL
1577 1572
    : public LTemplateInstruction<1, 1, 0> {
1578 1573
 public:
......
1611 1606
};
1612 1607

  
1613 1608

  
1614
class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1609
class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1615 1610
 public:
1616
  LLoadKeyedGeneric(LOperand* object, LOperand* key) {
1617
    inputs_[0] = object;
1618
    inputs_[1] = key;
1611
  LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key) {
1612
    inputs_[0] = context;
1613
    inputs_[1] = object;
1614
    inputs_[2] = key;
1619 1615
  }
1620 1616

  
1621
  LOperand* object() { return inputs_[0]; }
1622
  LOperand* key() { return inputs_[1]; }
1617
  LOperand* context() { return inputs_[0]; }
1618
  LOperand* object() { return inputs_[1]; }
1619
  LOperand* key() { return inputs_[2]; }
1623 1620

  
1624 1621
  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1625 1622
};
......
1632 1629
};
1633 1630

  
1634 1631

  
1635
class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1632
class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1636 1633
 public:
1637
  explicit LLoadGlobalGeneric(LOperand* global_object) {
1638
    inputs_[0] = global_object;
1634
  LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
1635
    inputs_[0] = context;
1636
    inputs_[1] = global_object;
1639 1637
  }
1640 1638

  
1641
  LOperand* global_object() { return inputs_[0]; }
1639
  LOperand* context() { return inputs_[0]; }
1640
  LOperand* global_object() { return inputs_[1]; }
1642 1641

  
1643 1642
  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1644 1643
  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
......
1663 1662
};
1664 1663

  
1665 1664

  
1666
class LStoreGlobalGeneric V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1665
class LStoreGlobalGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
1667 1666
 public:
1668
  explicit LStoreGlobalGeneric(LOperand* global_object,
1669
                               LOperand* value) {
1670
    inputs_[0] = global_object;
1671
    inputs_[1] = value;
1667
  LStoreGlobalGeneric(LOperand* context,
1668
                      LOperand* global_object,
1669
                      LOperand* value) {
1670
    inputs_[0] = context;
1671
    inputs_[1] = global_object;
1672
    inputs_[2] = value;
1672 1673
  }
1673 1674

  
1674
  LOperand* global_object() { return inputs_[0]; }
1675
  LOperand* value() { return inputs_[1]; }
1675
  LOperand* context() { return inputs_[0]; }
1676
  LOperand* global_object() { return inputs_[1]; }
1677
  LOperand* value() { return inputs_[2]; }
1676 1678

  
1677 1679
  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1678 1680
  DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
......
1802 1804
};
1803 1805

  
1804 1806

  
1805
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 0, 0> {
1807
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1806 1808
 public:
1809
  explicit LDeclareGlobals(LOperand* context) {
1810
    inputs_[0] = context;
1811
  }
1812

  
1813
  LOperand* context() { return inputs_[0]; }
1814

  
1807 1815
  DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1808 1816
  DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1809 1817
};
......
1845 1853
};
1846 1854

  
1847 1855

  
1848
class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1856
class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1849 1857
 public:
1850
  explicit LInvokeFunction(LOperand* function) {
1851
    inputs_[0] = function;
1858
  LInvokeFunction(LOperand* context, LOperand* function) {
1859
    inputs_[0] = context;
1860
    inputs_[1] = function;
1852 1861
  }
1853 1862

  
1854
  LOperand* function() { return inputs_[0]; }
1863
  LOperand* context() { return inputs_[0]; }
1864
  LOperand* function() { return inputs_[1]; }
1855 1865

  
1856 1866
  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1857 1867
  DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
......
1862 1872
};
1863 1873

  
1864 1874

  
1865
class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1875
class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1866 1876
 public:
1867
  explicit LCallKeyed(LOperand* key) {
1868
    inputs_[0] = key;
1877
  LCallKeyed(LOperand* context, LOperand* key) {
1878
    inputs_[0] = context;
1879
    inputs_[1] = key;
1869 1880
  }
1870 1881

  
1871
  LOperand* key() { return inputs_[0]; }
1882
  LOperand* context() { return inputs_[0]; }
1883
  LOperand* key() { return inputs_[1]; }
1872 1884

  
1873 1885
  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1874 1886
  DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
......
1880 1892

  
1881 1893

  
1882 1894

  
1883
class LCallNamed V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1895
class LCallNamed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1884 1896
 public:
1897
  explicit LCallNamed(LOperand* context) {
1898
    inputs_[0] = context;
1899
  }
1900

  
1901
  LOperand* context() { return inputs_[0]; }
1902

  
1885 1903
  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1886 1904
  DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1887 1905

  
......
1892 1910
};
1893 1911

  
1894 1912

  
1895
class LCallFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1913
class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1896 1914
 public:
1897
  explicit LCallFunction(LOperand* function) {
1898
    inputs_[0] = function;
1915
  LCallFunction(LOperand* context, LOperand* function) {
1916
    inputs_[0] = context;
1917
    inputs_[1] = function;
1899 1918
  }
1900 1919

  
1901
  LOperand* function() { return inputs_[0]; }
1920
  LOperand* context() { return inputs_[0]; }
1921
  LOperand* function() { return inputs_[1]; }
1902 1922

  
1903 1923
  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1904 1924
  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
......
1907 1927
};
1908 1928

  
1909 1929

  
1910
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1930
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1911 1931
 public:
1932
  explicit LCallGlobal(LOperand* context) {
1933
    inputs_[0] = context;
1934
  }
1935

  
1936
  LOperand* context() { return inputs_[0]; }
1937

  
1912 1938
  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1913 1939
  DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1914 1940

  
......
1930 1956
};
1931 1957

  
1932 1958

  
1933
class LCallNew V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1959
class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1934 1960
 public:
1935
  explicit LCallNew(LOperand* constructor) {
1936
    inputs_[0] = constructor;
1961
  LCallNew(LOperand* context, LOperand* constructor) {
1962
    inputs_[0] = context;
1963
    inputs_[1] = constructor;
1937 1964
  }
1938 1965

  
1939
  LOperand* constructor() { return inputs_[0]; }
1966
  LOperand* context() { return inputs_[0]; }
1967
  LOperand* constructor() { return inputs_[1]; }
1940 1968

  
1941 1969
  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1942 1970
  DECLARE_HYDROGEN_ACCESSOR(CallNew)
......
1947 1975
};
1948 1976

  
1949 1977

  
1950
class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1978
class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1951 1979
 public:
1952
  explicit LCallNewArray(LOperand* constructor) {
1953
    inputs_[0] = constructor;
1980
  LCallNewArray(LOperand* context, LOperand* constructor) {
1981
    inputs_[0] = context;
1982
    inputs_[1] = constructor;
1954 1983
  }
1955 1984

  
1956
  LOperand* constructor() { return inputs_[0]; }
1985
  LOperand* context() { return inputs_[0]; }
1986
  LOperand* constructor() { return inputs_[1]; }
1957 1987

  
1958 1988
  DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
1959 1989
  DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
......
1964 1994
};
1965 1995

  
1966 1996

  
1967
class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1997
class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1968 1998
 public:
1999
  explicit LCallRuntime(LOperand* context) {
2000
    inputs_[0] = context;
2001
  }
2002

  
2003
  LOperand* context() { return inputs_[0]; }
2004

  
1969 2005
  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1970 2006
  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1971 2007

  
2008
  virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
2009
    return save_doubles() == kDontSaveFPRegs;
2010
  }
2011

  
1972 2012
  const Runtime::Function* function() const { return hydrogen()->function(); }
1973 2013
  int arity() const { return hydrogen()->argument_count(); }
2014
  SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1974 2015
};
1975 2016

  
1976 2017

  
......
2099 2140
  LOperand* temp2() { return temps_[1]; }
2100 2141

  
2101 2142
  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2102
  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2143
  DECLARE_HYDROGEN_ACCESSOR(Change)
2103 2144

  
2104 2145
  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2105 2146
};
......
2171 2212
};
2172 2213

  
2173 2214

  
2174
class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 2, 0> {
2215
class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2175 2216
 public:
2176
  LStoreNamedGeneric(LOperand* object, LOperand* value) {
2177
    inputs_[0] = object;
2178
    inputs_[1] = value;
2217
  LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
2218
    inputs_[0] = context;
2219
    inputs_[1] = object;
2220
    inputs_[2] = value;
2179 2221
  }
2180 2222

  
2181
  LOperand* object() { return inputs_[0]; }
2182
  LOperand* value() { return inputs_[1]; }
2223
  LOperand* context() { return inputs_[0]; }
2224
  LOperand* object() { return inputs_[1]; }
2225
  LOperand* value() { return inputs_[2]; }
2183 2226

  
2184 2227
  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2185 2228
  DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
......
2216 2259
};
2217 2260

  
2218 2261

  
2219
class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2262
class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> {
2220 2263
 public:
2221
  LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* value) {
2222
    inputs_[0] = obj;
2223
    inputs_[1] = key;
2224
    inputs_[2] = value;
2264
  LStoreKeyedGeneric(LOperand* context,
2265
                     LOperand* obj,
2266
                     LOperand* key,
2267
                     LOperand* value) {
2268
    inputs_[0] = context;
2269
    inputs_[1] = obj;
2270
    inputs_[2] = key;
2271
    inputs_[3] = value;
2225 2272
  }
2226 2273

  
2227
  LOperand* object() { return inputs_[0]; }
2228
  LOperand* key() { return inputs_[1]; }
2229
  LOperand* value() { return inputs_[2]; }
2274
  LOperand* context() { return inputs_[0]; }
2275
  LOperand* object() { return inputs_[1]; }
2276
  LOperand* key() { return inputs_[2]; }
2277
  LOperand* value() { return inputs_[3]; }
2230 2278

  
2231 2279
  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2232 2280
  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
......
2237 2285
};
2238 2286

  
2239 2287

  
2240
class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 1, 1> {
2288
class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> {
2241 2289
 public:
2242 2290
  LTransitionElementsKind(LOperand* object,
2291
                          LOperand* context,
2243 2292
                          LOperand* new_map_temp) {
2244 2293
    inputs_[0] = object;
2294
    inputs_[1] = context;
2245 2295
    temps_[0] = new_map_temp;
2246 2296
  }
2247 2297

  
2298
  LOperand* context() { return inputs_[1]; }
2248 2299
  LOperand* object() { return inputs_[0]; }
2249 2300
  LOperand* new_map_temp() { return temps_[0]; }
2250 2301

  
......
2254 2305

  
2255 2306
  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2256 2307

  
2257
  Handle<Map> original_map() { return hydrogen()->original_map(); }
2258
  Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
2308
  Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2309
  Handle<Map> transitioned_map() {
2310
    return hydrogen()->transitioned_map().handle();
2311
  }
2259 2312
  ElementsKind from_kind() { return hydrogen()->from_kind(); }
2260 2313
  ElementsKind to_kind() { return hydrogen()->to_kind(); }
2261 2314
};
......
2277 2330
};
2278 2331

  
2279 2332

  
2280
class LStringAdd V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2333
class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2281 2334
 public:
2282
  LStringAdd(LOperand* left, LOperand* right) {
2283
    inputs_[0] = left;
2284
    inputs_[1] = right;
2335
  LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2336
    inputs_[0] = context;
2337
    inputs_[1] = left;
2338
    inputs_[2] = right;
2285 2339
  }
2286 2340

  
2287
  LOperand* left() { return inputs_[0]; }
2288
  LOperand* right() { return inputs_[1]; }
2341
  LOperand* context() { return inputs_[0]; }
2342
  LOperand* left() { return inputs_[1]; }
2343
  LOperand* right() { return inputs_[2]; }
2289 2344

  
2290 2345
  DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2291 2346
  DECLARE_HYDROGEN_ACCESSOR(StringAdd)
......
2293 2348

  
2294 2349

  
2295 2350

  
2296
class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2351
class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2297 2352
 public:
2298
  LStringCharCodeAt(LOperand* string, LOperand* index) {
2299
    inputs_[0] = string;
2300
    inputs_[1] = index;
2353
  LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2354
    inputs_[0] = context;
2355
    inputs_[1] = string;
2356
    inputs_[2] = index;
2301 2357
  }
2302 2358

  
2303
  LOperand* string() { return inputs_[0]; }
2304
  LOperand* index() { return inputs_[1]; }
2359
  LOperand* context() { return inputs_[0]; }
2360
  LOperand* string() { return inputs_[1]; }
2361
  LOperand* index() { return inputs_[2]; }
2305 2362

  
2306 2363
  DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2307 2364
  DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2308 2365
};
2309 2366

  
2310 2367

  
2311
class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2368
class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2312 2369
 public:
2313
  explicit LStringCharFromCode(LOperand* char_code) {
2314
    inputs_[0] = char_code;
2370
  explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
2371
    inputs_[0] = context;
2372
    inputs_[1] = char_code;
2315 2373
  }
2316 2374

  
2317
  LOperand* char_code() { return inputs_[0]; }
2375
  LOperand* context() { return inputs_[0]; }
2376
  LOperand* char_code() { return inputs_[1]; }
2318 2377

  
2319 2378
  DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2320 2379
  DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
......
2427 2486

  
2428 2487
class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> {
2429 2488
 public:
2430
  LAllocate(LOperand* size, LOperand* temp1, LOperand* temp2) {
2489
  LAllocate(LOperand* context,
2490
            LOperand* size,
2491
            LOperand* temp1,
2492
            LOperand* temp2) {
2493
    inputs_[0] = context;
2431 2494
    inputs_[1] = size;
2432 2495
    temps_[0] = temp1;
2433 2496
    temps_[1] = temp2;
2434 2497
  }
2435 2498

  
2499
  LOperand* context() { return inputs_[0]; }
2436 2500
  LOperand* size() { return inputs_[1]; }
2437 2501
  LOperand* temp1() { return temps_[0]; }
2438 2502
  LOperand* temp2() { return temps_[1]; }
......
2442 2506
};
2443 2507

  
2444 2508

  
2445
class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 0, 0> {
2509
class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2446 2510
 public:
2511
  explicit LRegExpLiteral(LOperand* context) {
2512
    inputs_[0] = context;
2513
  }
2514

  
2515
  LOperand* context() { return inputs_[0]; }
2516

  
2447 2517
  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2448 2518
  DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
2449 2519
};
2450 2520

  
2451 2521

  
2452
class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 0, 0> {
2522
class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2453 2523
 public:
2524
  explicit LFunctionLiteral(LOperand* context) {
2525
    inputs_[0] = context;
2526
  }
2527

  
2528
  LOperand* context() { return inputs_[0]; }
2529

  
2454 2530
  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
2455 2531
  DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
2456 2532
};
......
2469 2545
};
2470 2546

  
2471 2547

  
2472
class LTypeof V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2548
class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2473 2549
 public:
2474
  explicit LTypeof(LOperand* value) {
2475
    inputs_[0] = value;
2550
  LTypeof(LOperand* context, LOperand* value) {
2551
    inputs_[0] = context;
2552
    inputs_[1] = value;
2476 2553
  }
2477 2554

  
2478
  LOperand* value() { return inputs_[0]; }
2555
  LOperand* context() { return inputs_[0]; }
2556
  LOperand* value() { return inputs_[1]; }
2479 2557

  
2480 2558
  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2481 2559
};
......
2522 2600
};
2523 2601

  
2524 2602

  
2525
class LStackCheck V8_FINAL : public LTemplateInstruction<0, 0, 0> {
2603
class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2526 2604
 public:
2605
  explicit LStackCheck(LOperand* context) {
2606
    inputs_[0] = context;
2607
  }
2608

  
2609
  LOperand* context() { return inputs_[0]; }
2610

  
2527 2611
  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2528 2612
  DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2529 2613

  
......
2534 2618
};
2535 2619

  
2536 2620

  
2537
class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2621
class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2538 2622
 public:
2539
  explicit LForInPrepareMap(LOperand* object) {
2540
    inputs_[0] = object;
2623
  LForInPrepareMap(LOperand* context, LOperand* object) {
2624
    inputs_[0] = context;
2625
    inputs_[1] = object;
2541 2626
  }
2542 2627

  
2543
  LOperand* object() { return inputs_[0]; }
2628
  LOperand* context() { return inputs_[0]; }
2629
  LOperand* object() { return inputs_[1]; }
2544 2630

  
2545 2631
  DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2546 2632
};
......
2596 2682
  LPlatformChunk(CompilationInfo* info, HGraph* graph)
2597 2683
      : LChunk(info, graph) { }
2598 2684

  
2599
  int GetNextSpillIndex(bool is_double);
2600
  LOperand* GetNextSpillSlot(bool is_double);
2685
  int GetNextSpillIndex(RegisterKind kind);
2686
  LOperand* GetNextSpillSlot(RegisterKind kind);
2601 2687
};
2602 2688

  
2603 2689

  
......
2621 2707
  // Build the sequence for the graph.
2622 2708
  LPlatformChunk* Build();
2623 2709

  
2710
  LInstruction* CheckElideControlInstruction(HControlInstruction* instr);
2711

  
2624 2712
  // Declare methods that deal with the individual node types.
2625 2713
#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2626 2714
  HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
......
2753 2841
  LInstruction* DoArithmeticD(Token::Value op,
2754 2842
                              HArithmeticBinaryOperation* instr);
2755 2843
  LInstruction* DoArithmeticT(Token::Value op,
2756
                              HArithmeticBinaryOperation* instr);
2844
                              HBinaryOperation* instr);
2757 2845

  
2758 2846
  LPlatformChunk* chunk_;
2759 2847
  CompilationInfo* info_;

Also available in: Unified diff