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 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2251 } | 2251 } |
| 2252 | 2252 |
| 2253 virtual Representation RequiredInputRepresentation(int index) { | 2253 virtual Representation RequiredInputRepresentation(int index) { |
| 2254 return Representation::Tagged(); | 2254 return Representation::Tagged(); |
| 2255 } | 2255 } |
| 2256 | 2256 |
| 2257 virtual void PrintDataTo(StringStream* stream); | 2257 virtual void PrintDataTo(StringStream* stream); |
| 2258 virtual HType CalculateInferredType(); | 2258 virtual HType CalculateInferredType(); |
| 2259 | 2259 |
| 2260 HValue* value() { return OperandAt(0); } | 2260 HValue* value() { return OperandAt(0); } |
| 2261 bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); } | |
| 2262 void RemoveTypeCheck() { SetOperandAt(1, OperandAt(0)); } | |
| 2261 SmallMapList* map_set() { return &map_set_; } | 2263 SmallMapList* map_set() { return &map_set_; } |
| 2262 CompareMapMode mode() { return mode_; } | 2264 CompareMapMode mode() { return mode_; } |
| 2263 | 2265 |
| 2264 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) | 2266 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) |
| 2265 | 2267 |
| 2266 protected: | 2268 protected: |
| 2267 virtual bool DataEquals(HValue* other) { | 2269 virtual bool DataEquals(HValue* other) { |
| 2268 HCheckMaps* b = HCheckMaps::cast(other); | 2270 HCheckMaps* b = HCheckMaps::cast(other); |
| 2269 // Relies on the fact that map_set has been sorted before. | 2271 // Relies on the fact that map_set has been sorted before. |
| 2270 if (map_set()->length() != b->map_set()->length()) return false; | 2272 if (map_set()->length() != b->map_set()->length()) return false; |
| (...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4323 virtual Representation RequiredInputRepresentation(int index) { | 4325 virtual Representation RequiredInputRepresentation(int index) { |
| 4324 return Representation::Tagged(); | 4326 return Representation::Tagged(); |
| 4325 } | 4327 } |
| 4326 | 4328 |
| 4327 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype) | 4329 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype) |
| 4328 | 4330 |
| 4329 protected: | 4331 protected: |
| 4330 virtual bool DataEquals(HValue* other) { return true; } | 4332 virtual bool DataEquals(HValue* other) { return true; } |
| 4331 }; | 4333 }; |
| 4332 | 4334 |
| 4333 class ArrayInstructionInterface { | 4335 |
| 4336 class HTransitionElementsKind; | |
| 4337 class TransitionElementsBookmark BASE_EMBEDDED { | |
| 4334 public: | 4338 public: |
| 4335 virtual HValue* GetKey() = 0; | 4339 TransitionElementsBookmark(HTransitionElementsKind* transition, |
| 4336 virtual void SetKey(HValue* key) = 0; | 4340 Handle<Map> map_from, |
| 4341 Handle<Map> map_to, | |
| 4342 Isolate* isolate); | |
| 4343 ElementsKind elementskind_from() const { return from_->elements_kind(); } | |
| 4344 ElementsKind elementskind_to() const { return to_->elements_kind(); } | |
| 4345 Handle<Map> from() const { return from_; } | |
| 4346 Handle<Map>* from_pointer() { return &from_; } | |
|
danno
2012/11/28 14:42:10
I don't think you need this version. Creating a Ha
| |
| 4347 Handle<Map> to() const { return to_; } | |
| 4348 Handle<Map>* to_pointer() { return &to_; } | |
| 4349 Handle<Map> family() const { return family_; } | |
| 4350 Handle<Map>* family_pointer() { return &family_; } | |
| 4351 Handle<Map> pessimistic_holey() const { return pessimistic_holey_; } | |
| 4352 Handle<Map>* pessimistic_holey_pointer() { return &pessimistic_holey_; } | |
| 4353 HTransitionElementsKind* transition_instruction() const { | |
| 4354 return transition_; } | |
| 4355 | |
| 4356 bool Equals(const TransitionElementsBookmark& other) const { | |
| 4357 return *from() == *(other.from()) && | |
| 4358 *to() == *(other.to()) && | |
| 4359 *family() == *(other.family()); | |
|
danno
2012/11/28 14:42:10
family must be equal if from and to are equal. You
| |
| 4360 } | |
| 4361 | |
| 4362 private: | |
| 4363 HTransitionElementsKind* transition_; | |
|
danno
2012/11/28 14:42:10
Here's a radical idea. Since you need to allocate
mvstanton
2012/12/04 11:39:59
Done.
| |
| 4364 Handle<Map> from_; | |
| 4365 Handle<Map> to_; | |
| 4366 Handle<Map> family_; | |
| 4367 Handle<Map> pessimistic_holey_; | |
| 4368 }; | |
| 4369 | |
| 4370 | |
| 4371 class ArrayInstruction: public HTemplateInstruction<3> { | |
|
danno
2012/11/28 14:42:10
Maybe HArrayInstruction, it's more consistent.
mvstanton
2012/12/04 11:39:59
Done.
| |
| 4372 public: | |
| 4373 ArrayInstruction(HValue* obj, HValue* key, Zone* zone) : | |
| 4374 zone_(zone), | |
| 4375 bookmarks_(new(zone) ZoneList<TransitionElementsBookmark>(10, zone)), | |
|
danno
2012/11/28 14:42:10
Maybe TransitionElementsBookmark*, and allocate th
mvstanton
2012/12/04 11:39:59
Got rid of the Bookmarks entirely.
| |
| 4376 hoistable_(true), | |
| 4377 initialized_(false) { | |
| 4378 SetOperandAt(0, obj); | |
| 4379 SetOperandAt(1, key); | |
| 4380 } | |
| 4381 | |
| 4382 HValue* elements() { return OperandAt(0); } | |
| 4383 HValue* key() { return OperandAt(1); } | |
| 4384 | |
| 4385 HValue* GetKey() { return key(); } | |
| 4386 void SetKey(HValue* key) { SetOperandAt(1, key); } | |
| 4387 | |
| 4388 | |
| 4389 virtual ElementsKind GetElementsKind() = 0; | |
| 4337 virtual void SetIndexOffset(uint32_t index_offset) = 0; | 4390 virtual void SetIndexOffset(uint32_t index_offset) = 0; |
| 4338 virtual bool IsDehoisted() = 0; | 4391 virtual bool IsDehoisted() = 0; |
| 4339 virtual void SetDehoisted(bool is_dehoisted) = 0; | 4392 virtual void SetDehoisted(bool is_dehoisted) = 0; |
| 4340 virtual ~ArrayInstructionInterface() { }; | 4393 virtual void PerformDeferredInitialization( |
| 4394 ElementsKind new_elements_kind) = 0; | |
| 4395 virtual void PerformDeferredInitialization() = 0; | |
| 4396 virtual ~ArrayInstruction() { }; | |
| 4397 | |
| 4398 void AddBookmarks(const ZoneList<TransitionElementsBookmark>& records); | |
| 4399 bool hoistable() const { return hoistable_; } | |
| 4400 void set_hoistable(bool value) { hoistable_ = value; } | |
| 4401 | |
| 4402 int bookmarks() const { return bookmarks_->length(); } | |
| 4403 TransitionElementsBookmark* bookmark(int index) { | |
| 4404 return &(bookmarks_->at(index)); | |
| 4405 } | |
| 4406 | |
| 4407 Map* map_family(); | |
| 4408 | |
| 4409 void Finalize(ElementsKind kind) { | |
| 4410 // ElementsKind elements_kind = most_general_map()->elements_kind(); | |
|
danno
2012/11/28 14:42:10
Is this comment stale?
mvstanton
2012/12/04 11:39:59
Done.
| |
| 4411 if (!Initialized()) { | |
| 4412 PerformDeferredInitialization(kind); | |
| 4413 } | |
| 4414 | |
| 4415 // This will detect re-initialization | |
| 4416 ASSERT(Initialized() && kind == GetElementsKind()); | |
| 4417 } | |
| 4418 | |
| 4419 void Finalize() { | |
| 4420 // ElementsKind elements_kind = most_general_map()->elements_kind(); | |
| 4421 if (!Initialized()) { | |
| 4422 PerformDeferredInitialization(); | |
| 4423 } | |
| 4424 } | |
| 4425 | |
| 4426 void PrintElementPlacementTo(StringStream* stream); | |
| 4427 bool Initialized() const { return initialized_; } | |
| 4428 protected: | |
| 4429 void SetInitialized() { initialized_ = true; } | |
| 4430 | |
| 4431 private: | |
| 4432 Zone* zone_; | |
| 4433 ZoneList<TransitionElementsBookmark>* bookmarks_; | |
| 4434 bool hoistable_; | |
| 4435 bool initialized_; | |
| 4341 }; | 4436 }; |
| 4342 | 4437 |
| 4343 | 4438 |
| 4344 class HLoadKeyed | 4439 class HLoadKeyed |
| 4345 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 4440 : public ArrayInstruction { |
| 4346 public: | 4441 public: |
| 4347 HLoadKeyed(HValue* obj, | 4442 HLoadKeyed(HValue* obj, |
| 4348 HValue* key, | 4443 HValue* key, |
| 4349 HValue* dependency, | 4444 HValue* dependency, |
| 4350 ElementsKind elements_kind) | 4445 ElementsKind elements_kind, |
| 4351 : bit_field_(0) { | 4446 Zone* zone) |
| 4447 : ArrayInstruction(obj, key, zone), bit_field_(0) { | |
| 4352 bit_field_ = ElementsKindField::encode(elements_kind); | 4448 bit_field_ = ElementsKindField::encode(elements_kind); |
| 4353 | 4449 |
| 4354 SetOperandAt(0, obj); | |
| 4355 SetOperandAt(1, key); | |
| 4356 SetOperandAt(2, dependency); | 4450 SetOperandAt(2, dependency); |
| 4357 | 4451 |
| 4358 if (!is_external()) { | 4452 if (is_external()) { |
| 4359 // I can detect the case between storing double (holey and fast) and | 4453 SetInitialized(); |
| 4360 // smi/object by looking at elements_kind_. | 4454 |
| 4361 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind) || | |
| 4362 IsFastDoubleElementsKind(elements_kind)); | |
| 4363 | |
| 4364 if (IsFastSmiOrObjectElementsKind(elements_kind)) { | |
| 4365 if (IsFastSmiElementsKind(elements_kind) && | |
| 4366 IsFastPackedElementsKind(elements_kind)) { | |
| 4367 set_type(HType::Smi()); | |
| 4368 } | |
| 4369 | |
| 4370 set_representation(Representation::Tagged()); | |
| 4371 SetGVNFlag(kDependsOnArrayElements); | |
| 4372 } else { | |
| 4373 set_representation(Representation::Double()); | |
| 4374 SetGVNFlag(kDependsOnDoubleArrayElements); | |
| 4375 } | |
| 4376 } else { | |
| 4377 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || | 4455 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || |
| 4378 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 4456 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
| 4379 set_representation(Representation::Double()); | 4457 set_representation(Representation::Double()); |
| 4380 } else { | 4458 } else { |
| 4381 set_representation(Representation::Integer32()); | 4459 set_representation(Representation::Integer32()); |
| 4382 } | 4460 } |
| 4383 | 4461 |
| 4384 SetGVNFlag(kDependsOnSpecializedArrayElements); | 4462 SetGVNFlag(kDependsOnSpecializedArrayElements); |
| 4385 // Native code could change the specialized array. | 4463 // Native code could change the specialized array. |
| 4386 SetGVNFlag(kDependsOnCalls); | 4464 SetGVNFlag(kDependsOnCalls); |
| 4465 } else { | |
| 4466 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind) || | |
| 4467 IsFastDoubleElementsKind(elements_kind)); | |
| 4468 | |
| 4469 // We don't yet know what it depends on yet, so set both flags | |
| 4470 SetGVNFlag(kDependsOnArrayElements); | |
| 4471 SetGVNFlag(kDependsOnDoubleArrayElements); | |
| 4472 if (!FLAG_use_place_elements_transitions) { | |
| 4473 PerformDeferredInitialization(); | |
| 4474 } | |
| 4387 } | 4475 } |
| 4388 | 4476 |
| 4389 SetFlag(kUseGVN); | 4477 SetFlag(kUseGVN); |
| 4390 } | 4478 } |
| 4391 | 4479 |
| 4480 void PerformDeferredInitialization(ElementsKind new_elements_kind) { | |
| 4481 ASSERT(!is_external()); | |
| 4482 ASSERT(!Initialized()); | |
| 4483 SetInitialized(); | |
| 4484 | |
| 4485 if (new_elements_kind != elements_kind()) { | |
| 4486 bit_field_ = ElementsKindField::encode(new_elements_kind); | |
| 4487 } | |
| 4488 | |
| 4489 ClearGVNFlag(kDependsOnArrayElements); | |
| 4490 ClearGVNFlag(kDependsOnDoubleArrayElements); | |
| 4491 | |
| 4492 if (IsFastSmiOrObjectElementsKind(elements_kind())) { | |
| 4493 if (IsFastSmiElementsKind(elements_kind()) && | |
| 4494 IsFastPackedElementsKind(elements_kind())) { | |
| 4495 set_type(HType::Smi()); | |
| 4496 } | |
| 4497 | |
| 4498 set_representation(Representation::Tagged()); | |
| 4499 SetGVNFlag(kDependsOnArrayElements); | |
| 4500 } else { | |
| 4501 set_representation(Representation::Double()); | |
| 4502 SetGVNFlag(kDependsOnDoubleArrayElements); | |
| 4503 } | |
| 4504 } | |
| 4505 | |
| 4506 void PerformDeferredInitialization() { | |
| 4507 PerformDeferredInitialization(elements_kind()); | |
| 4508 } | |
| 4509 | |
| 4392 bool is_external() const { | 4510 bool is_external() const { |
| 4393 return IsExternalArrayElementsKind(elements_kind()); | 4511 return IsExternalArrayElementsKind(elements_kind()); |
| 4394 } | 4512 } |
| 4395 HValue* elements() { return OperandAt(0); } | |
| 4396 HValue* key() { return OperandAt(1); } | |
| 4397 HValue* dependency() { return OperandAt(2); } | 4513 HValue* dependency() { return OperandAt(2); } |
| 4514 ElementsKind GetElementsKind() { return elements_kind(); } | |
| 4515 | |
| 4398 uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); } | 4516 uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); } |
| 4399 void SetIndexOffset(uint32_t index_offset) { | 4517 void SetIndexOffset(uint32_t index_offset) { |
| 4400 bit_field_ = IndexOffsetField::update(bit_field_, index_offset); | 4518 bit_field_ = IndexOffsetField::update(bit_field_, index_offset); |
| 4401 } | 4519 } |
| 4402 HValue* GetKey() { return key(); } | |
| 4403 void SetKey(HValue* key) { SetOperandAt(1, key); } | |
| 4404 bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); } | 4520 bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); } |
| 4405 void SetDehoisted(bool is_dehoisted) { | 4521 void SetDehoisted(bool is_dehoisted) { |
| 4406 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); | 4522 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); |
| 4407 } | 4523 } |
| 4408 ElementsKind elements_kind() const { | 4524 ElementsKind elements_kind() const { |
| 4409 return ElementsKindField::decode(bit_field_); | 4525 return ElementsKindField::decode(bit_field_); |
| 4410 } | 4526 } |
| 4411 | 4527 |
| 4412 virtual Representation RequiredInputRepresentation(int index) { | 4528 virtual Representation RequiredInputRepresentation(int index) { |
| 4529 ASSERT(Initialized()); | |
| 4530 | |
| 4413 // kind_fast: tagged[int32] (none) | 4531 // kind_fast: tagged[int32] (none) |
| 4414 // kind_double: tagged[int32] (none) | 4532 // kind_double: tagged[int32] (none) |
| 4415 // kind_external: external[int32] (none) | 4533 // kind_external: external[int32] (none) |
| 4416 if (index == 0) { | 4534 if (index == 0) { |
| 4417 return is_external() ? Representation::External() | 4535 return is_external() ? Representation::External() |
| 4418 : Representation::Tagged(); | 4536 : Representation::Tagged(); |
| 4419 } | 4537 } |
| 4420 if (index == 1) return Representation::Integer32(); | 4538 if (index == 1) return Representation::Integer32(); |
| 4421 return Representation::None(); | 4539 return Representation::None(); |
| 4422 } | 4540 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4592 | 4710 |
| 4593 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) | 4711 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) |
| 4594 | 4712 |
| 4595 private: | 4713 private: |
| 4596 Handle<String> name_; | 4714 Handle<String> name_; |
| 4597 StrictModeFlag strict_mode_flag_; | 4715 StrictModeFlag strict_mode_flag_; |
| 4598 }; | 4716 }; |
| 4599 | 4717 |
| 4600 | 4718 |
| 4601 class HStoreKeyed | 4719 class HStoreKeyed |
| 4602 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 4720 : public ArrayInstruction { |
| 4603 public: | 4721 public: |
| 4604 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 4722 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
| 4605 ElementsKind elements_kind) | 4723 ElementsKind elements_kind, |
| 4606 : elements_kind_(elements_kind), index_offset_(0), is_dehoisted_(false) { | 4724 Zone* zone) |
| 4607 SetOperandAt(0, obj); | 4725 : ArrayInstruction(obj, key, zone), |
| 4608 SetOperandAt(1, key); | 4726 elements_kind_(elements_kind), |
| 4727 index_offset_(0), | |
| 4728 is_dehoisted_(false) { | |
| 4609 SetOperandAt(2, val); | 4729 SetOperandAt(2, val); |
| 4610 | 4730 |
| 4611 if (is_external()) { | 4731 if (is_external()) { |
| 4732 SetInitialized(); | |
| 4733 | |
| 4612 SetGVNFlag(kChangesSpecializedArrayElements); | 4734 SetGVNFlag(kChangesSpecializedArrayElements); |
| 4613 } else if (IsFastDoubleElementsKind(elements_kind)) { | 4735 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. |
| 4736 if (elements_kind >= EXTERNAL_BYTE_ELEMENTS && | |
| 4737 elements_kind <= EXTERNAL_UNSIGNED_INT_ELEMENTS) { | |
| 4738 SetFlag(kTruncatingToInt32); | |
| 4739 } | |
| 4740 } else { | |
| 4741 // We don't know what we'll have later. | |
| 4742 // Initialize for the worst case | |
| 4614 SetGVNFlag(kChangesDoubleArrayElements); | 4743 SetGVNFlag(kChangesDoubleArrayElements); |
| 4615 SetFlag(kDeoptimizeOnUndefined); | 4744 SetFlag(kDeoptimizeOnUndefined); |
| 4616 } else { | |
| 4617 SetGVNFlag(kChangesArrayElements); | 4745 SetGVNFlag(kChangesArrayElements); |
| 4618 } | |
| 4619 | 4746 |
| 4620 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. | 4747 if (!FLAG_use_place_elements_transitions) { |
| 4621 if (elements_kind >= EXTERNAL_BYTE_ELEMENTS && | 4748 PerformDeferredInitialization(); |
| 4622 elements_kind <= EXTERNAL_UNSIGNED_INT_ELEMENTS) { | 4749 } |
| 4623 SetFlag(kTruncatingToInt32); | |
| 4624 } | 4750 } |
| 4625 } | 4751 } |
| 4626 | 4752 |
| 4753 void PerformDeferredInitialization(ElementsKind new_elements_kind) { | |
| 4754 ASSERT(!is_external()); | |
| 4755 ASSERT(!Initialized()); | |
| 4756 SetInitialized(); | |
| 4757 | |
| 4758 if (new_elements_kind != elements_kind_) { | |
| 4759 elements_kind_ = new_elements_kind; | |
| 4760 } | |
| 4761 | |
| 4762 // Adjust flags appropriately | |
| 4763 if (IsFastDoubleElementsKind(elements_kind())) { | |
| 4764 ClearGVNFlag(kChangesArrayElements); | |
| 4765 } else { | |
| 4766 ClearGVNFlag(kChangesDoubleArrayElements); | |
| 4767 ClearFlag(kDeoptimizeOnUndefined); | |
| 4768 } | |
| 4769 } | |
| 4770 | |
| 4771 void PerformDeferredInitialization() { | |
| 4772 PerformDeferredInitialization(elements_kind()); | |
| 4773 } | |
| 4774 | |
| 4627 virtual Representation RequiredInputRepresentation(int index) { | 4775 virtual Representation RequiredInputRepresentation(int index) { |
| 4776 ASSERT(Initialized()); | |
| 4628 // kind_fast: tagged[int32] = tagged | 4777 // kind_fast: tagged[int32] = tagged |
| 4629 // kind_double: tagged[int32] = double | 4778 // kind_double: tagged[int32] = double |
| 4630 // kind_external: external[int32] = (double | int32) | 4779 // kind_external: external[int32] = (double | int32) |
| 4631 if (index == 0) { | 4780 if (index == 0) { |
| 4632 return is_external() ? Representation::External() | 4781 return is_external() ? Representation::External() |
| 4633 : Representation::Tagged(); | 4782 : Representation::Tagged(); |
| 4634 } else if (index == 1) { | 4783 } else if (index == 1) { |
| 4635 return Representation::Integer32(); | 4784 return Representation::Integer32(); |
| 4636 } | 4785 } |
| 4637 | 4786 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 4653 if (IsDoubleOrFloatElementsKind(elements_kind())) { | 4802 if (IsDoubleOrFloatElementsKind(elements_kind())) { |
| 4654 return Representation::Double(); | 4803 return Representation::Double(); |
| 4655 } | 4804 } |
| 4656 if (is_external()) { | 4805 if (is_external()) { |
| 4657 return Representation::Integer32(); | 4806 return Representation::Integer32(); |
| 4658 } | 4807 } |
| 4659 // For fast object elements kinds, don't assume anything. | 4808 // For fast object elements kinds, don't assume anything. |
| 4660 return Representation::None(); | 4809 return Representation::None(); |
| 4661 } | 4810 } |
| 4662 | 4811 |
| 4663 HValue* elements() { return OperandAt(0); } | |
| 4664 HValue* key() { return OperandAt(1); } | |
| 4665 HValue* value() { return OperandAt(2); } | 4812 HValue* value() { return OperandAt(2); } |
| 4666 bool value_is_smi() const { | 4813 bool value_is_smi() const { |
| 4667 return IsFastSmiElementsKind(elements_kind_); | 4814 return IsFastSmiElementsKind(elements_kind_); |
| 4668 } | 4815 } |
| 4669 ElementsKind elements_kind() const { return elements_kind_; } | 4816 ElementsKind elements_kind() const { return elements_kind_; } |
| 4817 ElementsKind GetElementsKind() { return elements_kind(); } | |
| 4670 uint32_t index_offset() { return index_offset_; } | 4818 uint32_t index_offset() { return index_offset_; } |
| 4671 void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; } | 4819 void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; } |
| 4672 HValue* GetKey() { return key(); } | |
| 4673 void SetKey(HValue* key) { SetOperandAt(1, key); } | |
| 4674 bool IsDehoisted() { return is_dehoisted_; } | 4820 bool IsDehoisted() { return is_dehoisted_; } |
| 4675 void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; } | 4821 void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; } |
| 4676 | 4822 |
| 4677 bool NeedsWriteBarrier() { | 4823 bool NeedsWriteBarrier() { |
| 4678 if (value_is_smi()) { | 4824 if (value_is_smi()) { |
| 4679 return false; | 4825 return false; |
| 4680 } else { | 4826 } else { |
| 4681 return StoringValueNeedsWriteBarrier(value()); | 4827 return StoringValueNeedsWriteBarrier(value()); |
| 4682 } | 4828 } |
| 4683 } | 4829 } |
| 4684 | 4830 |
| 4685 bool NeedsCanonicalization(); | 4831 bool NeedsCanonicalization(); |
| 4686 | |
| 4687 virtual void PrintDataTo(StringStream* stream); | 4832 virtual void PrintDataTo(StringStream* stream); |
| 4688 | 4833 |
| 4689 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) | 4834 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) |
| 4690 | 4835 |
| 4691 private: | 4836 private: |
| 4692 ElementsKind elements_kind_; | 4837 ElementsKind elements_kind_; |
| 4693 uint32_t index_offset_; | 4838 uint32_t index_offset_; |
| 4694 bool is_dehoisted_; | 4839 bool is_dehoisted_; |
| 4695 }; | 4840 }; |
| 4696 | 4841 |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5390 virtual bool IsDeletable() const { return true; } | 5535 virtual bool IsDeletable() const { return true; } |
| 5391 }; | 5536 }; |
| 5392 | 5537 |
| 5393 | 5538 |
| 5394 #undef DECLARE_INSTRUCTION | 5539 #undef DECLARE_INSTRUCTION |
| 5395 #undef DECLARE_CONCRETE_INSTRUCTION | 5540 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5396 | 5541 |
| 5397 } } // namespace v8::internal | 5542 } } // namespace v8::internal |
| 5398 | 5543 |
| 5399 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5544 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |