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

View differences:

deps/v8/src/arm/lithium-arm.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)                             \
......
185 184
  V(Typeof)                                     \
186 185
  V(TypeofIsAndBranch)                          \
187 186
  V(Uint32ToDouble)                             \
187
  V(Uint32ToSmi)                                \
188 188
  V(UnknownOSRValue)                            \
189 189
  V(ValueOf)                                    \
190 190
  V(WrapReceiver)
......
216 216
      : environment_(NULL),
217 217
        hydrogen_value_(NULL),
218 218
        bit_field_(IsCallBits::encode(false)) {
219
    set_position(RelocInfo::kNoPosition);
220 219
  }
221 220

  
222 221
  virtual ~LInstruction() {}
......
257 256
  LPointerMap* pointer_map() const { return pointer_map_.get(); }
258 257
  bool HasPointerMap() const { return pointer_map_.is_set(); }
259 258

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

  
269 259
  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
270 260
  HValue* hydrogen_value() const { return hydrogen_value_; }
271 261

  
......
277 267
  // Interface to the register allocator and iterators.
278 268
  bool ClobbersTemps() const { return IsCall(); }
279 269
  bool ClobbersRegisters() const { return IsCall(); }
280
  bool ClobbersDoubleRegisters() const { return IsCall(); }
270
  virtual bool ClobbersDoubleRegisters() const { return IsCall(); }
281 271

  
282 272
  // Interface to the register allocator and iterators.
283 273
  bool IsMarkedAsCall() const { return IsCall(); }
......
305 295
  virtual LOperand* TempAt(int i) = 0;
306 296

  
307 297
  class IsCallBits: public BitField<bool, 0, 1> {};
308
  class PositionBits: public BitField<int, 1, 31> {};
309 298

  
310 299
  LEnvironment* environment_;
311 300
  SetOncePointer<LPointerMap> pointer_map_;
......
404 393

  
405 394
class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> {
406 395
 public:
407
  explicit LGoto(int block_id) : block_id_(block_id) { }
396
  explicit LGoto(HBasicBlock* block) : block_(block) { }
408 397

  
409 398
  virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE;
410 399
  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
411 400
  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
412 401
  virtual bool IsControl() const V8_OVERRIDE { return true; }
413 402

  
414
  int block_id() const { return block_id_; }
403
  int block_id() const { return block_->block_id(); }
415 404

  
416 405
 private:
417
  int block_id_;
406
  HBasicBlock* block_;
418 407
};
419 408

  
420 409

  
......
483 472
};
484 473

  
485 474

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

  
481
  LOperand* context() { return inputs_[0]; }
482

  
488 483
  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
489 484
  DECLARE_HYDROGEN_ACCESSOR(CallStub)
490 485

  
......
785 780
};
786 781

  
787 782

  
788
class LMathAbs V8_FINAL : public LTemplateInstruction<1, 1, 0> {
783
class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
789 784
 public:
790
  explicit LMathAbs(LOperand* value) {
785
  LMathAbs(LOperand* context, LOperand* value) {
786
    inputs_[1] = context;
791 787
    inputs_[0] = value;
792 788
  }
793 789

  
790
  LOperand* context() { return inputs_[1]; }
794 791
  LOperand* value() { return inputs_[0]; }
795 792

  
796 793
  DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
......
939 936
};
940 937

  
941 938

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

  
948
  LOperand* value() { return inputs_[0]; }
949

  
950
  DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch")
951
  DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch)
952
};
953

  
954

  
955 939
class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
956 940
 public:
957 941
  LIsStringAndBranch(LOperand* value, LOperand* temp) {
......
1002 986
};
1003 987

  
1004 988

  
1005
class LStringCompareAndBranch V8_FINAL : public LControlInstruction<2, 0> {
989
class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
1006 990
 public:
1007
  LStringCompareAndBranch(LOperand* left, LOperand* right) {
1008
    inputs_[0] = left;
1009
    inputs_[1] = right;
991
  LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
992
    inputs_[0] = context;
993
    inputs_[1] = left;
994
    inputs_[2] = right;
1010 995
  }
1011 996

  
1012
  LOperand* left() { return inputs_[0]; }
1013
  LOperand* right() { return inputs_[1]; }
997
  LOperand* context() { return inputs_[0]; }
998
  LOperand* left() { return inputs_[1]; }
999
  LOperand* right() { return inputs_[2]; }
1014 1000

  
1015 1001
  DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1016 1002
                               "string-compare-and-branch")
......
1086 1072
};
1087 1073

  
1088 1074

  
1089
class LCmpT V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1075
class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1090 1076
 public:
1091
  LCmpT(LOperand* left, LOperand* right) {
1092
    inputs_[0] = left;
1093
    inputs_[1] = right;
1077
  LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1078
    inputs_[0] = context;
1079
    inputs_[1] = left;
1080
    inputs_[2] = right;
1094 1081
  }
1095 1082

  
1096
  LOperand* left() { return inputs_[0]; }
1097
  LOperand* right() { return inputs_[1]; }
1083
  LOperand* context() { return inputs_[0]; }
1084
  LOperand* left() { return inputs_[1]; }
1085
  LOperand* right() { return inputs_[2]; }
1098 1086

  
1099 1087
  DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
1100 1088
  DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
......
1103 1091
};
1104 1092

  
1105 1093

  
1106
class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1094
class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1107 1095
 public:
1108
  LInstanceOf(LOperand* left, LOperand* right) {
1109
    inputs_[0] = left;
1110
    inputs_[1] = right;
1096
  LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1097
    inputs_[0] = context;
1098
    inputs_[1] = left;
1099
    inputs_[2] = right;
1111 1100
  }
1112 1101

  
1113
  LOperand* left() { return inputs_[0]; }
1114
  LOperand* right() { return inputs_[1]; }
1102
  LOperand* context() { return inputs_[0]; }
1103
  LOperand* left() { return inputs_[1]; }
1104
  LOperand* right() { return inputs_[2]; }
1115 1105

  
1116 1106
  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1117 1107
};
1118 1108

  
1119 1109

  
1120
class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 1, 1> {
1110
class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 2, 1> {
1121 1111
 public:
1122
  LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
1123
    inputs_[0] = value;
1112
  LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) {
1113
    inputs_[0] = context;
1114
    inputs_[1] = value;
1124 1115
    temps_[0] = temp;
1125 1116
  }
1126 1117

  
1127
  LOperand* value() { return inputs_[0]; }
1118
  LOperand* context() { return inputs_[0]; }
1119
  LOperand* value() { return inputs_[1]; }
1128 1120
  LOperand* temp() { return temps_[0]; }
1129 1121

  
1130 1122
  DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
......
1145 1137
};
1146 1138

  
1147 1139

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

  
1154
  LOperand* object() { return inputs_[0]; }
1155

  
1156
  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
1157
  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
1158
};
1159

  
1160

  
1161 1140
class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1162 1141
 public:
1163 1142
  LBoundsCheck(LOperand* index, LOperand* length) {
......
1318 1297
  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1319 1298
  DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1320 1299

  
1321
  Handle<Map> map() const { return hydrogen()->map(); }
1300
  Handle<Map> map() const { return hydrogen()->map().handle(); }
1322 1301
};
1323 1302

  
1324 1303

  
......
1373 1352
  LOperand* temp() { return temps_[0]; }
1374 1353
  Smi* index() const { return index_; }
1375 1354

  
1376
  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1377
  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1355
  DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1356
  DECLARE_HYDROGEN_ACCESSOR(DateField)
1378 1357

  
1379 1358
 private:
1380 1359
  Smi* index_;
......
1405 1384
};
1406 1385

  
1407 1386

  
1408
class LThrow V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1387
class LThrow V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1409 1388
 public:
1410
  explicit LThrow(LOperand* value) {
1411
    inputs_[0] = value;
1389
  LThrow(LOperand* context, LOperand* value) {
1390
    inputs_[0] = context;
1391
    inputs_[1] = value;
1412 1392
  }
1413 1393

  
1414
  LOperand* value() { return inputs_[0]; }
1394
  LOperand* context() { return inputs_[0]; }
1395
  LOperand* value() { return inputs_[1]; }
1415 1396

  
1416 1397
  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1417 1398
};
......
1507 1488
};
1508 1489

  
1509 1490

  
1510
class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1491
class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
1511 1492
 public:
1512
  LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1493
  LArithmeticT(Token::Value op,
1494
               LOperand* context,
1495
               LOperand* left,
1496
               LOperand* right)
1513 1497
      : op_(op) {
1514
    inputs_[0] = left;
1515
    inputs_[1] = right;
1498
    inputs_[0] = context;
1499
    inputs_[1] = left;
1500
    inputs_[2] = right;
1516 1501
  }
1517 1502

  
1518
  LOperand* left() { return inputs_[0]; }
1519
  LOperand* right() { return inputs_[1]; }
1503
  LOperand* context() { return inputs_[0]; }
1504
  LOperand* left() { return inputs_[1]; }
1505
  LOperand* right() { return inputs_[2]; }
1520 1506
  Token::Value op() const { return op_; }
1521 1507

  
1522 1508
  virtual Opcode opcode() const V8_OVERRIDE {
......
1530 1516
};
1531 1517

  
1532 1518

  
1533
class LReturn V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1519
class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> {
1534 1520
 public:
1535
  explicit LReturn(LOperand* value, LOperand* parameter_count) {
1521
  LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
1536 1522
    inputs_[0] = value;
1537
    inputs_[1] = parameter_count;
1523
    inputs_[1] = context;
1524
    inputs_[2] = parameter_count;
1538 1525
  }
1539 1526

  
1540 1527
  LOperand* value() { return inputs_[0]; }
......
1546 1533
    ASSERT(has_constant_parameter_count());
1547 1534
    return LConstantOperand::cast(parameter_count());
1548 1535
  }
1549
  LOperand* parameter_count() { return inputs_[1]; }
1536
  LOperand* parameter_count() { return inputs_[2]; }
1550 1537

  
1551 1538
  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1552 1539
};
......
1565 1552
};
1566 1553

  
1567 1554

  
1568
class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1555
class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1569 1556
 public:
1570
  explicit LLoadNamedGeneric(LOperand* object) {
1571
    inputs_[0] = object;
1557
  LLoadNamedGeneric(LOperand* context, LOperand* object) {
1558
    inputs_[0] = context;
1559
    inputs_[1] = object;
1572 1560
  }
1573 1561

  
1574
  LOperand* object() { return inputs_[0]; }
1562
  LOperand* context() { return inputs_[0]; }
1563
  LOperand* object() { return inputs_[1]; }
1575 1564

  
1576 1565
  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1577 1566
  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
......
1593 1582
};
1594 1583

  
1595 1584

  
1585
class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1586
 public:
1587
  DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1588
  DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1589

  
1590
  Heap::RootListIndex index() const { return hydrogen()->index(); }
1591
};
1592

  
1593

  
1596 1594
class LLoadExternalArrayPointer V8_FINAL
1597 1595
    : public LTemplateInstruction<1, 1, 0> {
1598 1596
 public:
......
1631 1629
};
1632 1630

  
1633 1631

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

  
1641
  LOperand* object() { return inputs_[0]; }
1642
  LOperand* key() { return inputs_[1]; }
1640
  LOperand* context() { return inputs_[0]; }
1641
  LOperand* object() { return inputs_[1]; }
1642
  LOperand* key() { return inputs_[2]; }
1643 1643

  
1644 1644
  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1645 1645
};
......
1652 1652
};
1653 1653

  
1654 1654

  
1655
class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1655
class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1656 1656
 public:
1657
  explicit LLoadGlobalGeneric(LOperand* global_object) {
1658
    inputs_[0] = global_object;
1657
  LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
1658
    inputs_[0] = context;
1659
    inputs_[1] = global_object;
1659 1660
  }
1660 1661

  
1661
  LOperand* global_object() { return inputs_[0]; }
1662
  LOperand* context() { return inputs_[0]; }
1663
  LOperand* global_object() { return inputs_[1]; }
1662 1664

  
1663 1665
  DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1664 1666
  DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
......
1683 1685
};
1684 1686

  
1685 1687

  
1686
class LStoreGlobalGeneric V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1688
class LStoreGlobalGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
1687 1689
 public:
1688
  explicit LStoreGlobalGeneric(LOperand* global_object,
1689
                               LOperand* value) {
1690
    inputs_[0] = global_object;
1691
    inputs_[1] = value;
1690
  LStoreGlobalGeneric(LOperand* context,
1691
                      LOperand* global_object,
1692
                      LOperand* value) {
1693
    inputs_[0] = context;
1694
    inputs_[1] = global_object;
1695
    inputs_[2] = value;
1692 1696
  }
1693 1697

  
1694
  LOperand* global_object() { return inputs_[0]; }
1695
  LOperand* value() { return inputs_[1]; }
1698
  LOperand* context() { return inputs_[0]; }
1699
  LOperand* global_object() { return inputs_[1]; }
1700
  LOperand* value() { return inputs_[2]; }
1696 1701

  
1697 1702
  DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1698 1703
  DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
......
1822 1827
};
1823 1828

  
1824 1829

  
1825
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 0, 0> {
1830
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
1826 1831
 public:
1832
  explicit LDeclareGlobals(LOperand* context) {
1833
    inputs_[0] = context;
1834
  }
1835

  
1836
  LOperand* context() { return inputs_[0]; }
1837

  
1827 1838
  DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1828 1839
  DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1829 1840
};
......
1865 1876
};
1866 1877

  
1867 1878

  
1868
class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1879
class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1869 1880
 public:
1870
  explicit LInvokeFunction(LOperand* function) {
1871
    inputs_[0] = function;
1881
  LInvokeFunction(LOperand* context, LOperand* function) {
1882
    inputs_[0] = context;
1883
    inputs_[1] = function;
1872 1884
  }
1873 1885

  
1874
  LOperand* function() { return inputs_[0]; }
1886
  LOperand* context() { return inputs_[0]; }
1887
  LOperand* function() { return inputs_[1]; }
1875 1888

  
1876 1889
  DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1877 1890
  DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
......
1882 1895
};
1883 1896

  
1884 1897

  
1885
class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1898
class LCallKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1886 1899
 public:
1887
  explicit LCallKeyed(LOperand* key) {
1888
    inputs_[0] = key;
1900
  LCallKeyed(LOperand* context, LOperand* key) {
1901
    inputs_[0] = context;
1902
    inputs_[1] = key;
1889 1903
  }
1890 1904

  
1891
  LOperand* key() { return inputs_[0]; }
1905
  LOperand* context() { return inputs_[0]; }
1906
  LOperand* key() { return inputs_[1]; }
1892 1907

  
1893 1908
  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1894 1909
  DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
......
1900 1915

  
1901 1916

  
1902 1917

  
1903
class LCallNamed V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1918
class LCallNamed V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1904 1919
 public:
1920
  explicit LCallNamed(LOperand* context) {
1921
    inputs_[0] = context;
1922
  }
1923

  
1924
  LOperand* context() { return inputs_[0]; }
1925

  
1905 1926
  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1906 1927
  DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1907 1928

  
......
1912 1933
};
1913 1934

  
1914 1935

  
1915
class LCallFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1936
class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1916 1937
 public:
1917
  explicit LCallFunction(LOperand* function) {
1918
    inputs_[0] = function;
1938
  LCallFunction(LOperand* context, LOperand* function) {
1939
    inputs_[0] = context;
1940
    inputs_[1] = function;
1919 1941
  }
1920 1942

  
1921
  LOperand* function() { return inputs_[0]; }
1943
  LOperand* context() { return inputs_[0]; }
1944
  LOperand* function() { return inputs_[1]; }
1922 1945

  
1923 1946
  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1924 1947
  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
......
1927 1950
};
1928 1951

  
1929 1952

  
1930
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1953
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1931 1954
 public:
1955
  explicit LCallGlobal(LOperand* context) {
1956
    inputs_[0] = context;
1957
  }
1958

  
1959
  LOperand* context() { return inputs_[0]; }
1960

  
1932 1961
  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1933 1962
  DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1934 1963

  
......
1950 1979
};
1951 1980

  
1952 1981

  
1953
class LCallNew V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1982
class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1954 1983
 public:
1955
  explicit LCallNew(LOperand* constructor) {
1956
    inputs_[0] = constructor;
1984
  LCallNew(LOperand* context, LOperand* constructor) {
1985
    inputs_[0] = context;
1986
    inputs_[1] = constructor;
1957 1987
  }
1958 1988

  
1959
  LOperand* constructor() { return inputs_[0]; }
1989
  LOperand* context() { return inputs_[0]; }
1990
  LOperand* constructor() { return inputs_[1]; }
1960 1991

  
1961 1992
  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1962 1993
  DECLARE_HYDROGEN_ACCESSOR(CallNew)
......
1967 1998
};
1968 1999

  
1969 2000

  
1970
class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2001
class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> {
1971 2002
 public:
1972
  explicit LCallNewArray(LOperand* constructor) {
1973
    inputs_[0] = constructor;
2003
  LCallNewArray(LOperand* context, LOperand* constructor) {
2004
    inputs_[0] = context;
2005
    inputs_[1] = constructor;
1974 2006
  }
1975 2007

  
1976
  LOperand* constructor() { return inputs_[0]; }
2008
  LOperand* context() { return inputs_[0]; }
2009
  LOperand* constructor() { return inputs_[1]; }
1977 2010

  
1978 2011
  DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
1979 2012
  DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
......
1984 2017
};
1985 2018

  
1986 2019

  
1987
class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 0, 0> {
2020
class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1988 2021
 public:
2022
  explicit LCallRuntime(LOperand* context) {
2023
    inputs_[0] = context;
2024
  }
2025

  
2026
  LOperand* context() { return inputs_[0]; }
2027

  
1989 2028
  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1990 2029
  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1991 2030

  
2031
  virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
2032
    return save_doubles() == kDontSaveFPRegs;
2033
  }
2034

  
1992 2035
  const Runtime::Function* function() const { return hydrogen()->function(); }
1993 2036
  int arity() const { return hydrogen()->argument_count(); }
2037
  SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1994 2038
};
1995 2039

  
1996 2040

  
......
2031 2075
};
2032 2076

  
2033 2077

  
2078
class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2079
 public:
2080
  explicit LUint32ToSmi(LOperand* value) {
2081
    inputs_[0] = value;
2082
  }
2083

  
2084
  LOperand* value() { return inputs_[0]; }
2085

  
2086
  DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi")
2087
  DECLARE_HYDROGEN_ACCESSOR(Change)
2088
};
2089

  
2090

  
2034 2091
class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2035 2092
 public:
2036 2093
  explicit LNumberTagI(LOperand* value) {
......
2119 2176
  LOperand* temp2() { return temps_[1]; }
2120 2177

  
2121 2178
  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2122
  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2179
  DECLARE_HYDROGEN_ACCESSOR(Change)
2123 2180

  
2124 2181
  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2125 2182
};
......
2191 2248
};
2192 2249

  
2193 2250

  
2194
class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 2, 0> {
2251
class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2195 2252
 public:
2196
  LStoreNamedGeneric(LOperand* object, LOperand* value) {
2197
    inputs_[0] = object;
2198
    inputs_[1] = value;
2253
  LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
2254
    inputs_[0] = context;
2255
    inputs_[1] = object;
2256
    inputs_[2] = value;
2199 2257
  }
2200 2258

  
2201
  LOperand* object() { return inputs_[0]; }
2202
  LOperand* value() { return inputs_[1]; }
2259
  LOperand* context() { return inputs_[0]; }
2260
  LOperand* object() { return inputs_[1]; }
2261
  LOperand* value() { return inputs_[2]; }
2203 2262

  
2204 2263
  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2205 2264
  DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
......
2242 2301
};
2243 2302

  
2244 2303

  
2245
class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
2304
class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> {
2246 2305
 public:
2247
  LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* value) {
2248
    inputs_[0] = obj;
2249
    inputs_[1] = key;
2250
    inputs_[2] = value;
2306
  LStoreKeyedGeneric(LOperand* context,
2307
                     LOperand* obj,
2308
                     LOperand* key,
2309
                     LOperand* value) {
2310
    inputs_[0] = context;
2311
    inputs_[1] = obj;
2312
    inputs_[2] = key;
2313
    inputs_[3] = value;
2251 2314
  }
2252 2315

  
2253
  LOperand* object() { return inputs_[0]; }
2254
  LOperand* key() { return inputs_[1]; }
2255
  LOperand* value() { return inputs_[2]; }
2316
  LOperand* context() { return inputs_[0]; }
2317
  LOperand* object() { return inputs_[1]; }
2318
  LOperand* key() { return inputs_[2]; }
2319
  LOperand* value() { return inputs_[3]; }
2256 2320

  
2257 2321
  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2258 2322
  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
......
2263 2327
};
2264 2328

  
2265 2329

  
2266
class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 1, 1> {
2330
class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> {
2267 2331
 public:
2268 2332
  LTransitionElementsKind(LOperand* object,
2333
                          LOperand* context,
2269 2334
                          LOperand* new_map_temp) {
2270 2335
    inputs_[0] = object;
2336
    inputs_[1] = context;
2271 2337
    temps_[0] = new_map_temp;
2272 2338
  }
2273 2339

  
2340
  LOperand* context() { return inputs_[1]; }
2274 2341
  LOperand* object() { return inputs_[0]; }
2275 2342
  LOperand* new_map_temp() { return temps_[0]; }
2276 2343

  
......
2280 2347

  
2281 2348
  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2282 2349

  
2283
  Handle<Map> original_map() { return hydrogen()->original_map(); }
2284
  Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
2350
  Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2351
  Handle<Map> transitioned_map() {
2352
    return hydrogen()->transitioned_map().handle();
2353
  }
2285 2354
  ElementsKind from_kind() { return hydrogen()->from_kind(); }
2286 2355
  ElementsKind to_kind() { return hydrogen()->to_kind(); }
2287 2356
};
......
2303 2372
};
2304 2373

  
2305 2374

  
2306
class LStringAdd V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2375
class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2307 2376
 public:
2308
  LStringAdd(LOperand* left, LOperand* right) {
2309
    inputs_[0] = left;
2310
    inputs_[1] = right;
2377
  LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2378
    inputs_[0] = context;
2379
    inputs_[1] = left;
2380
    inputs_[2] = right;
2311 2381
  }
2312 2382

  
2313
  LOperand* left() { return inputs_[0]; }
2314
  LOperand* right() { return inputs_[1]; }
2383
  LOperand* context() { return inputs_[0]; }
2384
  LOperand* left() { return inputs_[1]; }
2385
  LOperand* right() { return inputs_[2]; }
2315 2386

  
2316 2387
  DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2317 2388
  DECLARE_HYDROGEN_ACCESSOR(StringAdd)
......
2319 2390

  
2320 2391

  
2321 2392

  
2322
class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2393
class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
2323 2394
 public:
2324
  LStringCharCodeAt(LOperand* string, LOperand* index) {
2325
    inputs_[0] = string;
2326
    inputs_[1] = index;
2395
  LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2396
    inputs_[0] = context;
2397
    inputs_[1] = string;
2398
    inputs_[2] = index;
2327 2399
  }
2328 2400

  
2329
  LOperand* string() { return inputs_[0]; }
2330
  LOperand* index() { return inputs_[1]; }
2401
  LOperand* context() { return inputs_[0]; }
2402
  LOperand* string() { return inputs_[1]; }
2403
  LOperand* index() { return inputs_[2]; }
2331 2404

  
2332 2405
  DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2333 2406
  DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2334 2407
};
2335 2408

  
2336 2409

  
2337
class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2410
class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2338 2411
 public:
2339
  explicit LStringCharFromCode(LOperand* char_code) {
2340
    inputs_[0] = char_code;
2412
  explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
2413
    inputs_[0] = context;
2414
    inputs_[1] = char_code;
2341 2415
  }
2342 2416

  
2343
  LOperand* char_code() { return inputs_[0]; }
2417
  LOperand* context() { return inputs_[0]; }
2418
  LOperand* char_code() { return inputs_[1]; }
2344 2419

  
2345 2420
  DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2346 2421
  DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
......
2451 2526

  
2452 2527
class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> {
2453 2528
 public:
2454
  LAllocate(LOperand* size, LOperand* temp1, LOperand* temp2) {
2529
  LAllocate(LOperand* context,
2530
            LOperand* size,
2531
            LOperand* temp1,
2532
            LOperand* temp2) {
2533
    inputs_[0] = context;
2455 2534
    inputs_[1] = size;
2456 2535
    temps_[0] = temp1;
2457 2536
    temps_[1] = temp2;
2458 2537
  }
2459 2538

  
2539
  LOperand* context() { return inputs_[0]; }
2460 2540
  LOperand* size() { return inputs_[1]; }
2461 2541
  LOperand* temp1() { return temps_[0]; }
2462 2542
  LOperand* temp2() { return temps_[1]; }
......
2466 2546
};
2467 2547

  
2468 2548

  
2469
class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 0, 0> {
2549
class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2470 2550
 public:
2551
  explicit LRegExpLiteral(LOperand* context) {
2552
    inputs_[0] = context;
2553
  }
2554

  
2555
  LOperand* context() { return inputs_[0]; }
2556

  
2471 2557
  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2472 2558
  DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
2473 2559
};
2474 2560

  
2475 2561

  
2476
class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 0, 0> {
2562
class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2477 2563
 public:
2564
  explicit LFunctionLiteral(LOperand* context) {
2565
    inputs_[0] = context;
2566
  }
2567

  
2568
  LOperand* context() { return inputs_[0]; }
2569

  
2478 2570
  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
2479 2571
  DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
2480 2572
};
......
2493 2585
};
2494 2586

  
2495 2587

  
2496
class LTypeof V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2588
class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2497 2589
 public:
2498
  explicit LTypeof(LOperand* value) {
2499
    inputs_[0] = value;
2590
  LTypeof(LOperand* context, LOperand* value) {
2591
    inputs_[0] = context;
2592
    inputs_[1] = value;
2500 2593
  }
2501 2594

  
2502
  LOperand* value() { return inputs_[0]; }
2595
  LOperand* context() { return inputs_[0]; }
2596
  LOperand* value() { return inputs_[1]; }
2503 2597

  
2504 2598
  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2505 2599
};
......
2546 2640
};
2547 2641

  
2548 2642

  
2549
class LStackCheck V8_FINAL : public LTemplateInstruction<0, 0, 0> {
2643
class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> {
2550 2644
 public:
2645
  explicit LStackCheck(LOperand* context) {
2646
    inputs_[0] = context;
2647
  }
2648

  
2649
  LOperand* context() { return inputs_[0]; }
2650

  
2551 2651
  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2552 2652
  DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2553 2653

  
......
2558 2658
};
2559 2659

  
2560 2660

  
2561
class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 1, 0> {
2661
class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> {
2562 2662
 public:
2563
  explicit LForInPrepareMap(LOperand* object) {
2564
    inputs_[0] = object;
2663
  LForInPrepareMap(LOperand* context, LOperand* object) {
2664
    inputs_[0] = context;
2665
    inputs_[1] = object;
2565 2666
  }
2566 2667

  
2567
  LOperand* object() { return inputs_[0]; }
2668
  LOperand* context() { return inputs_[0]; }
2669
  LOperand* object() { return inputs_[1]; }
2568 2670

  
2569 2671
  DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2570 2672
};
......
2620 2722
  LPlatformChunk(CompilationInfo* info, HGraph* graph)
2621 2723
      : LChunk(info, graph) { }
2622 2724

  
2623
  int GetNextSpillIndex(bool is_double);
2624
  LOperand* GetNextSpillSlot(bool is_double);
2725
  int GetNextSpillIndex(RegisterKind kind);
2726
  LOperand* GetNextSpillSlot(RegisterKind kind);
2625 2727
};
2626 2728

  
2627 2729

  
......
2645 2747
  // Build the sequence for the graph.
2646 2748
  LPlatformChunk* Build();
2647 2749

  
2750
  LInstruction* CheckElideControlInstruction(HControlInstruction* instr);
2751

  
2648 2752
  // Declare methods that deal with the individual node types.
2649 2753
#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2650 2754
  HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
......
2778 2882
  LInstruction* DoArithmeticD(Token::Value op,
2779 2883
                              HArithmeticBinaryOperation* instr);
2780 2884
  LInstruction* DoArithmeticT(Token::Value op,
2781
                              HArithmeticBinaryOperation* instr);
2885
                              HBinaryOperation* instr);
2782 2886

  
2783 2887
  LPlatformChunk* chunk_;
2784 2888
  CompilationInfo* info_;

Also available in: Unified diff