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

View differences:

deps/v8/src/x64/lithium-x64.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)                             \
......
114 113
  V(IsObjectAndBranch)                          \
115 114
  V(IsStringAndBranch)                          \
116 115
  V(IsSmiAndBranch)                             \
117
  V(IsNumberAndBranch)                          \
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)                             \
......
182 181
  V(Typeof)                                     \
183 182
  V(TypeofIsAndBranch)                          \
184 183
  V(Uint32ToDouble)                             \
184
  V(Uint32ToSmi)                                \
185 185
  V(UnknownOSRValue)                            \
186 186
  V(ValueOf)                                    \
187 187
  V(WrapReceiver)
......
213 213
      : environment_(NULL),
214 214
        hydrogen_value_(NULL),
215 215
        bit_field_(IsCallBits::encode(false)) {
216
    set_position(RelocInfo::kNoPosition);
217 216
  }
218 217

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

  
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 256
  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
267 257
  HValue* hydrogen_value() const { return hydrogen_value_; }
268 258

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

  
277 267
  virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
278 268

  
......
302 292
  virtual LOperand* TempAt(int i) = 0;
303 293

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

  
307 296
  LEnvironment* environment_;
308 297
  SetOncePointer<LPointerMap> pointer_map_;
......
403 392

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

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

  
413
  int block_id() const { return block_id_; }
402
  int block_id() const { return block_->block_id(); }
414 403

  
415 404
 private:
416
  int block_id_;
405
  HBasicBlock* block_;
417 406
};
418 407

  
419 408

  
......
883 872
};
884 873

  
885 874

  
886
class LIsNumberAndBranch V8_FINAL : public LControlInstruction<1, 0> {
887
 public:
888
  explicit LIsNumberAndBranch(LOperand* value) {
889
    inputs_[0] = value;
890
  }
891

  
892
  LOperand* value() { return inputs_[0]; }
893

  
894
  DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch, "is-number-and-branch")
895
  DECLARE_HYDROGEN_ACCESSOR(IsNumberAndBranch)
896
};
897

  
898

  
899 875
class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
900 876
 public:
901 877
  explicit LIsStringAndBranch(LOperand* value, LOperand* temp) {
......
1091 1067
};
1092 1068

  
1093 1069

  
1094
class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1095
 public:
1096
  explicit LInstanceSize(LOperand* object) {
1097
    inputs_[0] = object;
1098
  }
1099

  
1100
  LOperand* object() { return inputs_[0]; }
1101

  
1102
  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
1103
  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
1104
};
1105

  
1106

  
1107 1070
class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
1108 1071
 public:
1109 1072
  LBoundsCheck(LOperand* index, LOperand* length) {
......
1259 1222
  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1260 1223
  DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1261 1224

  
1262
  Handle<Map> map() const { return hydrogen()->map(); }
1225
  Handle<Map> map() const { return hydrogen()->map().handle(); }
1263 1226
};
1264 1227

  
1265 1228

  
......
1310 1273
  LOperand* date() { return inputs_[0]; }
1311 1274
  Smi* index() const { return index_; }
1312 1275

  
1313
  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1314
  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1276
  DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1277
  DECLARE_HYDROGEN_ACCESSOR(DateField)
1315 1278

  
1316 1279
 private:
1317 1280
  Smi* index_;
......
1535 1498
};
1536 1499

  
1537 1500

  
1501
class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
1502
 public:
1503
  DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1504
  DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1505

  
1506
  Heap::RootListIndex index() const { return hydrogen()->index(); }
1507
};
1508

  
1509

  
1538 1510
class LLoadExternalArrayPointer V8_FINAL
1539 1511
    : public LTemplateInstruction<1, 1, 0> {
1540 1512
 public:
......
1923 1895
  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1924 1896
  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1925 1897

  
1898
  virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
1899
    return save_doubles() == kDontSaveFPRegs;
1900
  }
1901

  
1926 1902
  const Runtime::Function* function() const { return hydrogen()->function(); }
1927 1903
  int arity() const { return hydrogen()->argument_count(); }
1904
  SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1928 1905
};
1929 1906

  
1930 1907

  
......
1967 1944
};
1968 1945

  
1969 1946

  
1947
class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1948
 public:
1949
  explicit LUint32ToSmi(LOperand* value) {
1950
    inputs_[0] = value;
1951
  }
1952

  
1953
  LOperand* value() { return inputs_[0]; }
1954

  
1955
  DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi")
1956
  DECLARE_HYDROGEN_ACCESSOR(Change)
1957
};
1958

  
1959

  
1970 1960
class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1971 1961
 public:
1972 1962
  explicit LNumberTagI(LOperand* value) {
......
2049 2039
  LOperand* temp() { return temps_[0]; }
2050 2040

  
2051 2041
  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2052
  DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2042
  DECLARE_HYDROGEN_ACCESSOR(Change)
2053 2043

  
2054 2044
  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2055 2045
};
......
2205 2195

  
2206 2196
  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2207 2197

  
2208
  Handle<Map> original_map() { return hydrogen()->original_map(); }
2209
  Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
2198
  Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2199
  Handle<Map> transitioned_map() {
2200
    return hydrogen()->transitioned_map().handle();
2201
  }
2210 2202
  ElementsKind from_kind() { return hydrogen()->from_kind(); }
2211 2203
  ElementsKind to_kind() { return hydrogen()->to_kind(); }
2212 2204
};
......
2544 2536
  LPlatformChunk(CompilationInfo* info, HGraph* graph)
2545 2537
      : LChunk(info, graph) { }
2546 2538

  
2547
  int GetNextSpillIndex(bool is_double);
2548
  LOperand* GetNextSpillSlot(bool is_double);
2539
  int GetNextSpillIndex(RegisterKind kind);
2540
  LOperand* GetNextSpillSlot(RegisterKind kind);
2549 2541
};
2550 2542

  
2551 2543

  
......
2562 2554
        next_block_(NULL),
2563 2555
        argument_count_(0),
2564 2556
        allocator_(allocator),
2565
        position_(RelocInfo::kNoPosition),
2566 2557
        instruction_pending_deoptimization_environment_(NULL),
2567 2558
        pending_deoptimization_ast_id_(BailoutId::None()) { }
2568 2559

  
2569 2560
  // Build the sequence for the graph.
2570 2561
  LPlatformChunk* Build();
2571 2562

  
2563
  LInstruction* CheckElideControlInstruction(HControlInstruction* instr);
2564

  
2572 2565
  // Declare methods that deal with the individual node types.
2573 2566
#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2574 2567
  HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
......
2701 2694
  LInstruction* DoArithmeticD(Token::Value op,
2702 2695
                              HArithmeticBinaryOperation* instr);
2703 2696
  LInstruction* DoArithmeticT(Token::Value op,
2704
                              HArithmeticBinaryOperation* instr);
2697
                              HBinaryOperation* instr);
2705 2698

  
2706 2699
  LPlatformChunk* chunk_;
2707 2700
  CompilationInfo* info_;
......
2713 2706
  HBasicBlock* next_block_;
2714 2707
  int argument_count_;
2715 2708
  LAllocator* allocator_;
2716
  int position_;
2717 2709
  LInstruction* instruction_pending_deoptimization_environment_;
2718 2710
  BailoutId pending_deoptimization_ast_id_;
2719 2711

  

Also available in: Unified diff