| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4360 virtual HValue* GetKey() = 0; | 4360 virtual HValue* GetKey() = 0; |
| 4361 virtual void SetKey(HValue* key) = 0; | 4361 virtual void SetKey(HValue* key) = 0; |
| 4362 virtual void SetIndexOffset(uint32_t index_offset) = 0; | 4362 virtual void SetIndexOffset(uint32_t index_offset) = 0; |
| 4363 virtual bool IsDehoisted() = 0; | 4363 virtual bool IsDehoisted() = 0; |
| 4364 virtual void SetDehoisted(bool is_dehoisted) = 0; | 4364 virtual void SetDehoisted(bool is_dehoisted) = 0; |
| 4365 virtual ~ArrayInstructionInterface() { }; | 4365 virtual ~ArrayInstructionInterface() { }; |
| 4366 }; | 4366 }; |
| 4367 | 4367 |
| 4368 | 4368 |
| 4369 class HLoadKeyed | 4369 class HLoadKeyed |
| 4370 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 4370 : public HTemplateInstruction<4>, public ArrayInstructionInterface { |
| 4371 public: | 4371 public: |
| 4372 HLoadKeyed(HValue* obj, | 4372 HLoadKeyed(HValue* obj, |
| 4373 HValue* key, | 4373 HValue* key, |
| 4374 HValue* dependency, | 4374 HValue* dependency, |
| 4375 HValue* prefetch_distance, |
| 4375 ElementsKind elements_kind) | 4376 ElementsKind elements_kind) |
| 4376 : bit_field_(0) { | 4377 : bit_field_(0) { |
| 4377 bit_field_ = ElementsKindField::encode(elements_kind); | 4378 bit_field_ = ElementsKindField::encode(elements_kind); |
| 4378 | 4379 |
| 4379 SetOperandAt(0, obj); | 4380 SetOperandAt(0, obj); |
| 4380 SetOperandAt(1, key); | 4381 SetOperandAt(1, key); |
| 4381 SetOperandAt(2, dependency != NULL ? dependency : obj); | 4382 SetOperandAt(2, dependency != NULL ? dependency : obj); |
| 4383 SetOperandAt(3, prefetch_distance); |
| 4382 | 4384 |
| 4383 if (!is_external()) { | 4385 if (!is_external()) { |
| 4384 // I can detect the case between storing double (holey and fast) and | 4386 // I can detect the case between storing double (holey and fast) and |
| 4385 // smi/object by looking at elements_kind_. | 4387 // smi/object by looking at elements_kind_. |
| 4386 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind) || | 4388 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind) || |
| 4387 IsFastDoubleElementsKind(elements_kind)); | 4389 IsFastDoubleElementsKind(elements_kind)); |
| 4388 | 4390 |
| 4389 if (IsFastSmiOrObjectElementsKind(elements_kind)) { | 4391 if (IsFastSmiOrObjectElementsKind(elements_kind)) { |
| 4390 if (IsFastSmiElementsKind(elements_kind) && | 4392 if (IsFastSmiElementsKind(elements_kind) && |
| 4391 IsFastPackedElementsKind(elements_kind)) { | 4393 IsFastPackedElementsKind(elements_kind)) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 4417 bool is_external() const { | 4419 bool is_external() const { |
| 4418 return IsExternalArrayElementsKind(elements_kind()); | 4420 return IsExternalArrayElementsKind(elements_kind()); |
| 4419 } | 4421 } |
| 4420 HValue* elements() { return OperandAt(0); } | 4422 HValue* elements() { return OperandAt(0); } |
| 4421 HValue* key() { return OperandAt(1); } | 4423 HValue* key() { return OperandAt(1); } |
| 4422 HValue* dependency() { | 4424 HValue* dependency() { |
| 4423 ASSERT(HasDependency()); | 4425 ASSERT(HasDependency()); |
| 4424 return OperandAt(2); | 4426 return OperandAt(2); |
| 4425 } | 4427 } |
| 4426 bool HasDependency() const { return OperandAt(0) != OperandAt(2); } | 4428 bool HasDependency() const { return OperandAt(0) != OperandAt(2); } |
| 4429 HValue* prefetch_distance() { return OperandAt(3); } |
| 4430 void SetPrefetchDistance(HValue* prefetch_distance) { |
| 4431 SetOperandAt(3, prefetch_distance); |
| 4432 } |
| 4427 uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); } | 4433 uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); } |
| 4428 void SetIndexOffset(uint32_t index_offset) { | 4434 void SetIndexOffset(uint32_t index_offset) { |
| 4429 bit_field_ = IndexOffsetField::update(bit_field_, index_offset); | 4435 bit_field_ = IndexOffsetField::update(bit_field_, index_offset); |
| 4430 } | 4436 } |
| 4431 HValue* GetKey() { return key(); } | 4437 HValue* GetKey() { return key(); } |
| 4432 void SetKey(HValue* key) { SetOperandAt(1, key); } | 4438 void SetKey(HValue* key) { SetOperandAt(1, key); } |
| 4433 bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); } | 4439 bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); } |
| 4434 void SetDehoisted(bool is_dehoisted) { | 4440 void SetDehoisted(bool is_dehoisted) { |
| 4435 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); | 4441 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); |
| 4436 } | 4442 } |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5446 virtual bool IsDeletable() const { return true; } | 5452 virtual bool IsDeletable() const { return true; } |
| 5447 }; | 5453 }; |
| 5448 | 5454 |
| 5449 | 5455 |
| 5450 #undef DECLARE_INSTRUCTION | 5456 #undef DECLARE_INSTRUCTION |
| 5451 #undef DECLARE_CONCRETE_INSTRUCTION | 5457 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5452 | 5458 |
| 5453 } } // namespace v8::internal | 5459 } } // namespace v8::internal |
| 5454 | 5460 |
| 5455 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5461 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |