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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 V(BackingStoreFields) \ | 204 V(BackingStoreFields) \ |
| 205 V(Calls) \ | 205 V(Calls) \ |
| 206 V(ContextSlots) \ | 206 V(ContextSlots) \ |
| 207 V(DoubleArrayElements) \ | 207 V(DoubleArrayElements) \ |
| 208 V(DoubleFields) \ | 208 V(DoubleFields) \ |
| 209 V(ElementsKind) \ | 209 V(ElementsKind) \ |
| 210 V(ElementsPointer) \ | 210 V(ElementsPointer) \ |
| 211 V(GlobalVars) \ | 211 V(GlobalVars) \ |
| 212 V(InobjectFields) \ | 212 V(InobjectFields) \ |
| 213 V(OsrEntries) \ | 213 V(OsrEntries) \ |
| 214 V(SpecializedArrayElements) | 214 V(ExternalMemory) |
| 215 | 215 |
| 216 | 216 |
| 217 #define DECLARE_ABSTRACT_INSTRUCTION(type) \ | 217 #define DECLARE_ABSTRACT_INSTRUCTION(type) \ |
| 218 virtual bool Is##type() const { return true; } \ | 218 virtual bool Is##type() const { return true; } \ |
| 219 static H##type* cast(HValue* value) { \ | 219 static H##type* cast(HValue* value) { \ |
| 220 ASSERT(value->Is##type()); \ | 220 ASSERT(value->Is##type()); \ |
| 221 return reinterpret_cast<H##type*>(value); \ | 221 return reinterpret_cast<H##type*>(value); \ |
| 222 } | 222 } |
| 223 | 223 |
| 224 | 224 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 | 345 |
| 346 private: | 346 private: |
| 347 Address raw_address_; | 347 Address raw_address_; |
| 348 }; | 348 }; |
| 349 | 349 |
| 350 | 350 |
| 351 class HType { | 351 class HType { |
| 352 public: | 352 public: |
| 353 HType() : type_(kUninitialized) { } | 353 HType() : type_(kUninitialized) { } |
| 354 | 354 |
| 355 static HType None() { return HType(kNone); } | |
| 355 static HType Tagged() { return HType(kTagged); } | 356 static HType Tagged() { return HType(kTagged); } |
| 356 static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } | 357 static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } |
| 357 static HType TaggedNumber() { return HType(kTaggedNumber); } | 358 static HType TaggedNumber() { return HType(kTaggedNumber); } |
| 358 static HType Smi() { return HType(kSmi); } | 359 static HType Smi() { return HType(kSmi); } |
| 359 static HType HeapNumber() { return HType(kHeapNumber); } | 360 static HType HeapNumber() { return HType(kHeapNumber); } |
| 360 static HType String() { return HType(kString); } | 361 static HType String() { return HType(kString); } |
| 361 static HType Boolean() { return HType(kBoolean); } | 362 static HType Boolean() { return HType(kBoolean); } |
| 362 static HType NonPrimitive() { return HType(kNonPrimitive); } | 363 static HType NonPrimitive() { return HType(kNonPrimitive); } |
| 363 static HType JSArray() { return HType(kJSArray); } | 364 static HType JSArray() { return HType(kJSArray); } |
| 364 static HType JSObject() { return HType(kJSObject); } | 365 static HType JSObject() { return HType(kJSObject); } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 440 ASSERT(type_ != kUninitialized); | 441 ASSERT(type_ != kUninitialized); |
| 441 return IsHeapNumber() || IsString() || IsBoolean() || IsNonPrimitive(); | 442 return IsHeapNumber() || IsString() || IsBoolean() || IsNonPrimitive(); |
| 442 } | 443 } |
| 443 | 444 |
| 444 static HType TypeFromValue(Handle<Object> value); | 445 static HType TypeFromValue(Handle<Object> value); |
| 445 | 446 |
| 446 const char* ToString(); | 447 const char* ToString(); |
| 447 | 448 |
| 448 private: | 449 private: |
| 449 enum Type { | 450 enum Type { |
| 451 kNone = 0x0, // 0000 0000 0000 0000 | |
| 450 kTagged = 0x1, // 0000 0000 0000 0001 | 452 kTagged = 0x1, // 0000 0000 0000 0001 |
| 451 kTaggedPrimitive = 0x5, // 0000 0000 0000 0101 | 453 kTaggedPrimitive = 0x5, // 0000 0000 0000 0101 |
| 452 kTaggedNumber = 0xd, // 0000 0000 0000 1101 | 454 kTaggedNumber = 0xd, // 0000 0000 0000 1101 |
| 453 kSmi = 0x1d, // 0000 0000 0001 1101 | 455 kSmi = 0x1d, // 0000 0000 0001 1101 |
| 454 kHeapNumber = 0x2d, // 0000 0000 0010 1101 | 456 kHeapNumber = 0x2d, // 0000 0000 0010 1101 |
| 455 kString = 0x45, // 0000 0000 0100 0101 | 457 kString = 0x45, // 0000 0000 0100 0101 |
| 456 kBoolean = 0x85, // 0000 0000 1000 0101 | 458 kBoolean = 0x85, // 0000 0000 1000 0101 |
| 457 kNonPrimitive = 0x101, // 0000 0001 0000 0001 | 459 kNonPrimitive = 0x101, // 0000 0001 0000 0001 |
| 458 kJSObject = 0x301, // 0000 0011 0000 0001 | 460 kJSObject = 0x301, // 0000 0011 0000 0001 |
| 459 kJSArray = 0x701, // 0000 0111 0000 0001 | 461 kJSArray = 0x701, // 0000 0111 0000 0001 |
| (...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3464 bool is_not_in_new_space = true, | 3466 bool is_not_in_new_space = true, |
| 3465 Handle<Object> optional_handle = Handle<Object>::null()); | 3467 Handle<Object> optional_handle = Handle<Object>::null()); |
| 3466 HConstant(Handle<Object> handle, | 3468 HConstant(Handle<Object> handle, |
| 3467 UniqueValueId unique_id, | 3469 UniqueValueId unique_id, |
| 3468 Representation r, | 3470 Representation r, |
| 3469 HType type, | 3471 HType type, |
| 3470 bool is_internalized_string, | 3472 bool is_internalized_string, |
| 3471 bool is_not_in_new_space, | 3473 bool is_not_in_new_space, |
| 3472 bool is_cell, | 3474 bool is_cell, |
| 3473 bool boolean_value); | 3475 bool boolean_value); |
| 3476 HConstant(ExternalReference reference, | |
| 3477 Representation r = Representation::External()); | |
|
danno
2013/07/25 18:35:57
r should never be settable for ExternalReferences,
Benedikt Meurer
2013/07/25 21:09:11
Done.
| |
| 3474 | 3478 |
| 3475 Handle<Object> handle() { | 3479 Handle<Object> handle() { |
| 3476 if (handle_.is_null()) { | 3480 if (handle_.is_null()) { |
| 3477 Factory* factory = Isolate::Current()->factory(); | 3481 Factory* factory = Isolate::Current()->factory(); |
| 3478 // Default arguments to is_not_in_new_space depend on this heap number | 3482 // Default arguments to is_not_in_new_space depend on this heap number |
| 3479 // to be tenured so that it's guaranteed not be be located in new space. | 3483 // to be tenured so that it's guaranteed not be be located in new space. |
| 3480 handle_ = factory->NewNumber(double_value_, TENURED); | 3484 handle_ = factory->NewNumber(double_value_, TENURED); |
| 3481 } | 3485 } |
| 3482 AllowDeferredHandleDereference smi_check; | 3486 AllowDeferredHandleDereference smi_check; |
| 3483 ASSERT(has_int32_value_ || !handle_->IsSmi()); | 3487 ASSERT(has_int32_value_ || !handle_->IsSmi()); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3528 } | 3532 } |
| 3529 | 3533 |
| 3530 virtual Representation RequiredInputRepresentation(int index) { | 3534 virtual Representation RequiredInputRepresentation(int index) { |
| 3531 return Representation::None(); | 3535 return Representation::None(); |
| 3532 } | 3536 } |
| 3533 | 3537 |
| 3534 virtual Representation KnownOptimalRepresentation() { | 3538 virtual Representation KnownOptimalRepresentation() { |
| 3535 if (HasSmiValue() && kSmiValueSize == 31) return Representation::Smi(); | 3539 if (HasSmiValue() && kSmiValueSize == 31) return Representation::Smi(); |
| 3536 if (HasInteger32Value()) return Representation::Integer32(); | 3540 if (HasInteger32Value()) return Representation::Integer32(); |
| 3537 if (HasNumberValue()) return Representation::Double(); | 3541 if (HasNumberValue()) return Representation::Double(); |
| 3542 if (HasExternalValue()) return Representation::External(); | |
| 3538 return Representation::Tagged(); | 3543 return Representation::Tagged(); |
| 3539 } | 3544 } |
| 3540 | 3545 |
| 3541 virtual bool EmitAtUses(); | 3546 virtual bool EmitAtUses(); |
| 3542 virtual void PrintDataTo(StringStream* stream); | 3547 virtual void PrintDataTo(StringStream* stream); |
| 3543 virtual HType CalculateInferredType(); | 3548 virtual HType CalculateInferredType(); |
| 3544 bool IsInteger() { return handle()->IsSmi(); } | 3549 bool IsInteger() { return handle()->IsSmi(); } |
| 3545 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; | 3550 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; |
| 3546 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); | 3551 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); |
| 3547 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); | 3552 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3579 ASSERT(!handle_.is_null()); | 3584 ASSERT(!handle_.is_null()); |
| 3580 return type_from_value_.IsString(); | 3585 return type_from_value_.IsString(); |
| 3581 } | 3586 } |
| 3582 Handle<String> StringValue() const { | 3587 Handle<String> StringValue() const { |
| 3583 ASSERT(HasStringValue()); | 3588 ASSERT(HasStringValue()); |
| 3584 return Handle<String>::cast(handle_); | 3589 return Handle<String>::cast(handle_); |
| 3585 } | 3590 } |
| 3586 bool HasInternalizedStringValue() const { | 3591 bool HasInternalizedStringValue() const { |
| 3587 return HasStringValue() && is_internalized_string_; | 3592 return HasStringValue() && is_internalized_string_; |
| 3588 } | 3593 } |
| 3594 bool HasExternalValue() const { return has_external_value_; } | |
|
danno
2013/07/25 18:35:57
Call this HasExternalReferenceValue, it's more con
Benedikt Meurer
2013/07/25 21:09:11
Done.
| |
| 3595 ExternalReference ExternalValue() const { return external_value_; } | |
|
danno
2013/07/25 18:35:57
Call this ExternalReferenceValue, it's more consis
danno
2013/07/25 18:35:57
Call this ExternalReferenceValue, it's more consis
Benedikt Meurer
2013/07/25 21:09:11
Done.
Benedikt Meurer
2013/07/25 21:09:11
Done.
| |
| 3589 | 3596 |
| 3590 bool BooleanValue() const { return boolean_value_; } | 3597 bool BooleanValue() const { return boolean_value_; } |
| 3591 | 3598 |
| 3592 virtual intptr_t Hashcode() { | 3599 virtual intptr_t Hashcode() { |
| 3593 if (has_int32_value_) { | 3600 if (has_int32_value_) { |
| 3594 return static_cast<intptr_t>(int32_value_); | 3601 return static_cast<intptr_t>(int32_value_); |
| 3595 } else if (has_double_value_) { | 3602 } else if (has_double_value_) { |
| 3596 return static_cast<intptr_t>(BitCast<int64_t>(double_value_)); | 3603 return static_cast<intptr_t>(BitCast<int64_t>(double_value_)); |
| 3604 } else if (has_external_value_) { | |
| 3605 return reinterpret_cast<intptr_t>(external_value_.address()); | |
| 3597 } else { | 3606 } else { |
| 3598 ASSERT(!handle_.is_null()); | 3607 ASSERT(!handle_.is_null()); |
| 3599 return unique_id_.Hashcode(); | 3608 return unique_id_.Hashcode(); |
| 3600 } | 3609 } |
| 3601 } | 3610 } |
| 3602 | 3611 |
| 3603 virtual void FinalizeUniqueValueId() { | 3612 virtual void FinalizeUniqueValueId() { |
| 3604 if (!has_double_value_) { | 3613 if (!has_double_value_ && !has_external_value_) { |
| 3605 ASSERT(!handle_.is_null()); | 3614 ASSERT(!handle_.is_null()); |
| 3606 unique_id_ = UniqueValueId(handle_); | 3615 unique_id_ = UniqueValueId(handle_); |
| 3607 } | 3616 } |
| 3608 } | 3617 } |
| 3609 | 3618 |
| 3610 bool UniqueValueIdsMatch(UniqueValueId other) { | 3619 bool UniqueValueIdsMatch(UniqueValueId other) { |
| 3611 return !has_double_value_ && unique_id_ == other; | 3620 return !has_double_value_ && !has_external_value_ && unique_id_ == other; |
| 3612 } | 3621 } |
| 3613 | 3622 |
| 3614 #ifdef DEBUG | 3623 #ifdef DEBUG |
| 3615 virtual void Verify() { } | 3624 virtual void Verify() { } |
| 3616 #endif | 3625 #endif |
| 3617 | 3626 |
| 3618 DECLARE_CONCRETE_INSTRUCTION(Constant) | 3627 DECLARE_CONCRETE_INSTRUCTION(Constant) |
| 3619 | 3628 |
| 3620 protected: | 3629 protected: |
| 3621 virtual Range* InferRange(Zone* zone); | 3630 virtual Range* InferRange(Zone* zone); |
| 3622 | 3631 |
| 3623 virtual bool DataEquals(HValue* other) { | 3632 virtual bool DataEquals(HValue* other) { |
| 3624 HConstant* other_constant = HConstant::cast(other); | 3633 HConstant* other_constant = HConstant::cast(other); |
| 3625 if (has_int32_value_) { | 3634 if (has_int32_value_) { |
| 3626 return other_constant->has_int32_value_ && | 3635 return other_constant->has_int32_value_ && |
| 3627 int32_value_ == other_constant->int32_value_; | 3636 int32_value_ == other_constant->int32_value_; |
| 3628 } else if (has_double_value_) { | 3637 } else if (has_double_value_) { |
| 3629 return other_constant->has_double_value_ && | 3638 return other_constant->has_double_value_ && |
| 3630 BitCast<int64_t>(double_value_) == | 3639 BitCast<int64_t>(double_value_) == |
| 3631 BitCast<int64_t>(other_constant->double_value_); | 3640 BitCast<int64_t>(other_constant->double_value_); |
| 3641 } else if (has_external_value_) { | |
| 3642 return other_constant->has_external_value_ && | |
| 3643 external_value_ == other_constant->external_value_; | |
| 3632 } else { | 3644 } else { |
| 3633 ASSERT(!handle_.is_null()); | 3645 ASSERT(!handle_.is_null()); |
| 3634 return !other_constant->handle_.is_null() && | 3646 return !other_constant->handle_.is_null() && |
| 3635 unique_id_ == other_constant->unique_id_; | 3647 unique_id_ == other_constant->unique_id_; |
| 3636 } | 3648 } |
| 3637 } | 3649 } |
| 3638 | 3650 |
| 3639 private: | 3651 private: |
| 3640 void Initialize(Representation r); | 3652 void Initialize(Representation r); |
| 3641 | 3653 |
| 3642 virtual bool IsDeletable() const { return true; } | 3654 virtual bool IsDeletable() const { return true; } |
| 3643 | 3655 |
| 3644 // If this is a numerical constant, handle_ either points to to the | 3656 // If this is a numerical constant, handle_ either points to to the |
| 3645 // HeapObject the constant originated from or is null. If the | 3657 // HeapObject the constant originated from or is null. If the |
| 3646 // constant is non-numeric, handle_ always points to a valid | 3658 // constant is non-numeric, handle_ always points to a valid |
| 3647 // constant HeapObject. | 3659 // constant HeapObject. |
| 3648 Handle<Object> handle_; | 3660 Handle<Object> handle_; |
| 3649 UniqueValueId unique_id_; | 3661 UniqueValueId unique_id_; |
| 3650 | 3662 |
| 3651 // We store the HConstant in the most specific form safely possible. | 3663 // We store the HConstant in the most specific form safely possible. |
| 3652 // The two flags, has_int32_value_ and has_double_value_ tell us if | 3664 // The two flags, has_int32_value_ and has_double_value_ tell us if |
| 3653 // int32_value_ and double_value_ hold valid, safe representations | 3665 // int32_value_ and double_value_ hold valid, safe representations |
| 3654 // of the constant. has_int32_value_ implies has_double_value_ but | 3666 // of the constant. has_int32_value_ implies has_double_value_ but |
| 3655 // not the converse. | 3667 // not the converse. |
| 3656 bool has_smi_value_ : 1; | 3668 bool has_smi_value_ : 1; |
| 3657 bool has_int32_value_ : 1; | 3669 bool has_int32_value_ : 1; |
| 3658 bool has_double_value_ : 1; | 3670 bool has_double_value_ : 1; |
| 3671 bool has_external_value_ : 1; | |
|
danno
2013/07/25 18:35:57
has_external_reference_value_
Benedikt Meurer
2013/07/25 21:09:11
Done.
| |
| 3659 bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. | 3672 bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. |
| 3660 bool is_not_in_new_space_ : 1; | 3673 bool is_not_in_new_space_ : 1; |
| 3661 bool is_cell_ : 1; | 3674 bool is_cell_ : 1; |
| 3662 bool boolean_value_ : 1; | 3675 bool boolean_value_ : 1; |
| 3663 int32_t int32_value_; | 3676 int32_t int32_value_; |
| 3664 double double_value_; | 3677 double double_value_; |
| 3678 ExternalReference external_value_; | |
|
danno
2013/07/25 18:35:57
external_reference_value_
Benedikt Meurer
2013/07/25 21:09:11
Done.
| |
| 3665 HType type_from_value_; | 3679 HType type_from_value_; |
| 3666 }; | 3680 }; |
| 3667 | 3681 |
| 3668 | 3682 |
| 3669 class HBinaryOperation: public HTemplateInstruction<3> { | 3683 class HBinaryOperation: public HTemplateInstruction<3> { |
| 3670 public: | 3684 public: |
| 3671 HBinaryOperation(HValue* context, HValue* left, HValue* right) | 3685 HBinaryOperation(HValue* context, HValue* left, HValue* right) |
| 3672 : observed_output_representation_(Representation::None()) { | 3686 : observed_output_representation_(Representation::None()) { |
| 3673 ASSERT(left != NULL && right != NULL); | 3687 ASSERT(left != NULL && right != NULL); |
| 3674 SetOperandAt(0, context); | 3688 SetOperandAt(0, context); |
| (...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5620 } | 5634 } |
| 5621 | 5635 |
| 5622 static HObjectAccess ForCellValue() { | 5636 static HObjectAccess ForCellValue() { |
| 5623 return HObjectAccess(kInobject, Cell::kValueOffset); | 5637 return HObjectAccess(kInobject, Cell::kValueOffset); |
| 5624 } | 5638 } |
| 5625 | 5639 |
| 5626 static HObjectAccess ForAllocationMementoSite() { | 5640 static HObjectAccess ForAllocationMementoSite() { |
| 5627 return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); | 5641 return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); |
| 5628 } | 5642 } |
| 5629 | 5643 |
| 5644 static HObjectAccess ForCounter() { | |
| 5645 return HObjectAccess(kExternalMemory, 0, Representation::Integer32()); | |
| 5646 } | |
| 5647 | |
| 5630 // Create an access to an offset in a fixed array header. | 5648 // Create an access to an offset in a fixed array header. |
| 5631 static HObjectAccess ForFixedArrayHeader(int offset); | 5649 static HObjectAccess ForFixedArrayHeader(int offset); |
| 5632 | 5650 |
| 5633 // Create an access to an in-object property in a JSObject. | 5651 // Create an access to an in-object property in a JSObject. |
| 5634 static HObjectAccess ForJSObjectOffset(int offset, | 5652 static HObjectAccess ForJSObjectOffset(int offset, |
| 5635 Representation representation = Representation::Tagged()); | 5653 Representation representation = Representation::Tagged()); |
| 5636 | 5654 |
| 5637 // Create an access to an in-object property in a JSArray. | 5655 // Create an access to an in-object property in a JSArray. |
| 5638 static HObjectAccess ForJSArrayOffset(int offset); | 5656 static HObjectAccess ForJSArrayOffset(int offset); |
| 5639 | 5657 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 5658 void SetGVNFlags(HValue *instr, bool is_store); | 5676 void SetGVNFlags(HValue *instr, bool is_store); |
| 5659 | 5677 |
| 5660 private: | 5678 private: |
| 5661 // internal use only; different parts of an object or array | 5679 // internal use only; different parts of an object or array |
| 5662 enum Portion { | 5680 enum Portion { |
| 5663 kMaps, // map of an object | 5681 kMaps, // map of an object |
| 5664 kArrayLengths, // the length of an array | 5682 kArrayLengths, // the length of an array |
| 5665 kElementsPointer, // elements pointer | 5683 kElementsPointer, // elements pointer |
| 5666 kBackingStore, // some field in the backing store | 5684 kBackingStore, // some field in the backing store |
| 5667 kDouble, // some double field | 5685 kDouble, // some double field |
| 5668 kInobject // some other in-object field | 5686 kInobject, // some other in-object field |
| 5687 kExternalMemory // some field in external memory | |
| 5669 }; | 5688 }; |
| 5670 | 5689 |
| 5671 HObjectAccess(Portion portion, int offset, | 5690 HObjectAccess(Portion portion, int offset, |
| 5672 Representation representation = Representation::Tagged(), | 5691 Representation representation = Representation::Tagged(), |
| 5673 Handle<String> name = Handle<String>::null()) | 5692 Handle<String> name = Handle<String>::null()) |
| 5674 : value_(PortionField::encode(portion) | | 5693 : value_(PortionField::encode(portion) | |
| 5675 RepresentationField::encode(representation.kind()) | | 5694 RepresentationField::encode(representation.kind()) | |
| 5676 OffsetField::encode(offset)), | 5695 OffsetField::encode(offset)), |
| 5677 name_(name) { | 5696 name_(name) { |
| 5678 // assert that the fields decode correctly | 5697 // assert that the fields decode correctly |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5935 SetGVNFlag(kDependsOnDoubleArrayElements); | 5954 SetGVNFlag(kDependsOnDoubleArrayElements); |
| 5936 } | 5955 } |
| 5937 } else { | 5956 } else { |
| 5938 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || | 5957 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || |
| 5939 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 5958 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
| 5940 set_representation(Representation::Double()); | 5959 set_representation(Representation::Double()); |
| 5941 } else { | 5960 } else { |
| 5942 set_representation(Representation::Integer32()); | 5961 set_representation(Representation::Integer32()); |
| 5943 } | 5962 } |
| 5944 | 5963 |
| 5945 SetGVNFlag(kDependsOnSpecializedArrayElements); | 5964 SetGVNFlag(kDependsOnExternalMemory); |
| 5946 // Native code could change the specialized array. | 5965 // Native code could change the specialized array. |
| 5947 SetGVNFlag(kDependsOnCalls); | 5966 SetGVNFlag(kDependsOnCalls); |
| 5948 } | 5967 } |
| 5949 | 5968 |
| 5950 SetFlag(kUseGVN); | 5969 SetFlag(kUseGVN); |
| 5951 } | 5970 } |
| 5952 | 5971 |
| 5953 bool is_external() const { | 5972 bool is_external() const { |
| 5954 return IsExternalArrayElementsKind(elements_kind()); | 5973 return IsExternalArrayElementsKind(elements_kind()); |
| 5955 } | 5974 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6212 new_space_dominator_(NULL) { | 6231 new_space_dominator_(NULL) { |
| 6213 SetOperandAt(0, obj); | 6232 SetOperandAt(0, obj); |
| 6214 SetOperandAt(1, key); | 6233 SetOperandAt(1, key); |
| 6215 SetOperandAt(2, val); | 6234 SetOperandAt(2, val); |
| 6216 | 6235 |
| 6217 if (IsFastObjectElementsKind(elements_kind)) { | 6236 if (IsFastObjectElementsKind(elements_kind)) { |
| 6218 SetFlag(kTrackSideEffectDominators); | 6237 SetFlag(kTrackSideEffectDominators); |
| 6219 SetGVNFlag(kDependsOnNewSpacePromotion); | 6238 SetGVNFlag(kDependsOnNewSpacePromotion); |
| 6220 } | 6239 } |
| 6221 if (is_external()) { | 6240 if (is_external()) { |
| 6222 SetGVNFlag(kChangesSpecializedArrayElements); | 6241 SetGVNFlag(kChangesExternalMemory); |
| 6223 SetFlag(kAllowUndefinedAsNaN); | 6242 SetFlag(kAllowUndefinedAsNaN); |
| 6224 } else if (IsFastDoubleElementsKind(elements_kind)) { | 6243 } else if (IsFastDoubleElementsKind(elements_kind)) { |
| 6225 SetGVNFlag(kChangesDoubleArrayElements); | 6244 SetGVNFlag(kChangesDoubleArrayElements); |
| 6226 } else if (IsFastSmiElementsKind(elements_kind)) { | 6245 } else if (IsFastSmiElementsKind(elements_kind)) { |
| 6227 SetGVNFlag(kChangesArrayElements); | 6246 SetGVNFlag(kChangesArrayElements); |
| 6228 } else { | 6247 } else { |
| 6229 SetGVNFlag(kChangesArrayElements); | 6248 SetGVNFlag(kChangesArrayElements); |
| 6230 } | 6249 } |
| 6231 | 6250 |
| 6232 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. | 6251 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6947 virtual bool IsDeletable() const { return true; } | 6966 virtual bool IsDeletable() const { return true; } |
| 6948 }; | 6967 }; |
| 6949 | 6968 |
| 6950 | 6969 |
| 6951 #undef DECLARE_INSTRUCTION | 6970 #undef DECLARE_INSTRUCTION |
| 6952 #undef DECLARE_CONCRETE_INSTRUCTION | 6971 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6953 | 6972 |
| 6954 } } // namespace v8::internal | 6973 } } // namespace v8::internal |
| 6955 | 6974 |
| 6956 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6975 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |