Chromium Code Reviews| 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 4284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4295 uint32_t index_offset_; | 4295 uint32_t index_offset_; |
| 4296 bool is_dehoisted_; | 4296 bool is_dehoisted_; |
| 4297 }; | 4297 }; |
| 4298 | 4298 |
| 4299 | 4299 |
| 4300 class HStoreKeyedFastDoubleElement | 4300 class HStoreKeyedFastDoubleElement |
| 4301 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 4301 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
| 4302 public: | 4302 public: |
| 4303 HStoreKeyedFastDoubleElement(HValue* elements, | 4303 HStoreKeyedFastDoubleElement(HValue* elements, |
| 4304 HValue* key, | 4304 HValue* key, |
| 4305 HValue* val) | 4305 HValue* val, |
| 4306 : index_offset_(0), is_dehoisted_(false) { | 4306 ElementsKind element_kind) |
|
Jakob Kummerow
2012/06/05 09:05:40
nit: for consistency, "elements_kind" (with 's') p
| |
| 4307 : index_offset_(0), bit_field_(0) { | |
| 4308 bit_field_ = IsDehoisted::encode(false) | | |
| 4309 SkipCanonicalization::encode(IsFastPackedElementsKind(element_kind)); | |
| 4307 SetOperandAt(0, elements); | 4310 SetOperandAt(0, elements); |
| 4308 SetOperandAt(1, key); | 4311 SetOperandAt(1, key); |
| 4309 SetOperandAt(2, val); | 4312 SetOperandAt(2, val); |
| 4310 SetGVNFlag(kChangesDoubleArrayElements); | 4313 SetGVNFlag(kChangesDoubleArrayElements); |
| 4311 } | 4314 } |
| 4312 | 4315 |
| 4313 virtual Representation RequiredInputRepresentation(int index) { | 4316 virtual Representation RequiredInputRepresentation(int index) { |
| 4314 if (index == 1) { | 4317 if (index == 1) { |
| 4315 return Representation::Integer32(); | 4318 return Representation::Integer32(); |
| 4316 } else if (index == 2) { | 4319 } else if (index == 2) { |
| 4317 return Representation::Double(); | 4320 return Representation::Double(); |
| 4318 } else { | 4321 } else { |
| 4319 return Representation::Tagged(); | 4322 return Representation::Tagged(); |
| 4320 } | 4323 } |
| 4321 } | 4324 } |
| 4322 | 4325 |
| 4323 HValue* elements() { return OperandAt(0); } | 4326 HValue* elements() { return OperandAt(0); } |
| 4324 HValue* key() { return OperandAt(1); } | 4327 HValue* key() { return OperandAt(1); } |
| 4325 HValue* value() { return OperandAt(2); } | 4328 HValue* value() { return OperandAt(2); } |
| 4326 uint32_t index_offset() { return index_offset_; } | 4329 uint32_t index_offset() { return index_offset_; } |
| 4327 void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; } | 4330 void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; } |
| 4328 HValue* GetKey() { return key(); } | 4331 HValue* GetKey() { return key(); } |
| 4329 void SetKey(HValue* key) { SetOperandAt(1, key); } | 4332 void SetKey(HValue* key) { SetOperandAt(1, key); } |
| 4330 bool IsDehoisted() { return is_dehoisted_; } | 4333 bool IsDehoisted() { return IsDehoisted::decode(bit_field_); } |
| 4331 void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; } | 4334 void SetDehoisted(bool is_dehoisted) { |
| 4335 bit_field_ = IsDehoisted::update(bit_field_, is_dehoisted); | |
| 4336 } | |
| 4332 | 4337 |
| 4333 bool NeedsWriteBarrier() { | 4338 bool NeedsWriteBarrier() { |
| 4334 return StoringValueNeedsWriteBarrier(value()); | 4339 return StoringValueNeedsWriteBarrier(value()); |
| 4335 } | 4340 } |
| 4336 | 4341 |
| 4337 bool NeedsCanonicalization(); | 4342 bool NeedsCanonicalization(); |
| 4338 | 4343 |
| 4339 virtual void PrintDataTo(StringStream* stream); | 4344 virtual void PrintDataTo(StringStream* stream); |
| 4340 | 4345 |
| 4341 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement) | 4346 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement) |
| 4342 | 4347 |
| 4343 private: | 4348 private: |
| 4349 class IsDehoisted: public BitField<bool, 0, 1> {}; | |
| 4350 class SkipCanonicalization: public BitField<bool, 1, 2> {}; | |
|
Jakob Kummerow
2012/06/05 09:05:40
not that it matters, but why use two bits to store
Vyacheslav Egorov (Google)
2012/06/05 09:13:24
why not
bool is_dehoisted_ : 1;
bool skip_canoni
| |
| 4351 | |
| 4344 uint32_t index_offset_; | 4352 uint32_t index_offset_; |
| 4345 bool is_dehoisted_; | 4353 uint32_t bit_field_; |
| 4346 }; | 4354 }; |
| 4347 | 4355 |
| 4348 | 4356 |
| 4349 class HStoreKeyedSpecializedArrayElement | 4357 class HStoreKeyedSpecializedArrayElement |
| 4350 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 4358 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
| 4351 public: | 4359 public: |
| 4352 HStoreKeyedSpecializedArrayElement(HValue* external_elements, | 4360 HStoreKeyedSpecializedArrayElement(HValue* external_elements, |
| 4353 HValue* key, | 4361 HValue* key, |
| 4354 HValue* val, | 4362 HValue* val, |
| 4355 ElementsKind elements_kind) | 4363 ElementsKind elements_kind) |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5057 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 5065 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
| 5058 }; | 5066 }; |
| 5059 | 5067 |
| 5060 | 5068 |
| 5061 #undef DECLARE_INSTRUCTION | 5069 #undef DECLARE_INSTRUCTION |
| 5062 #undef DECLARE_CONCRETE_INSTRUCTION | 5070 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5063 | 5071 |
| 5064 } } // namespace v8::internal | 5072 } } // namespace v8::internal |
| 5065 | 5073 |
| 5066 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5074 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |