| 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 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5450 static const int kUndefinedValueRootIndex = 5; | 5450 static const int kUndefinedValueRootIndex = 5; |
| 5451 static const int kNullValueRootIndex = 7; | 5451 static const int kNullValueRootIndex = 7; |
| 5452 static const int kTrueValueRootIndex = 8; | 5452 static const int kTrueValueRootIndex = 8; |
| 5453 static const int kFalseValueRootIndex = 9; | 5453 static const int kFalseValueRootIndex = 9; |
| 5454 static const int kEmptyStringRootIndex = 135; | 5454 static const int kEmptyStringRootIndex = 135; |
| 5455 | 5455 |
| 5456 static const int kNodeClassIdOffset = 1 * kApiPointerSize; | 5456 static const int kNodeClassIdOffset = 1 * kApiPointerSize; |
| 5457 static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; | 5457 static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; |
| 5458 static const int kNodeStateMask = 0xf; | 5458 static const int kNodeStateMask = 0xf; |
| 5459 static const int kNodeStateIsWeakValue = 2; | 5459 static const int kNodeStateIsWeakValue = 2; |
| 5460 static const int kNodeStateIsPendingValue = 3; |
| 5460 static const int kNodeStateIsNearDeathValue = 4; | 5461 static const int kNodeStateIsNearDeathValue = 4; |
| 5461 static const int kNodeIsIndependentShift = 4; | 5462 static const int kNodeIsIndependentShift = 4; |
| 5462 static const int kNodeIsPartiallyDependentShift = 5; | 5463 static const int kNodeIsPartiallyDependentShift = 5; |
| 5463 | 5464 |
| 5464 static const int kJSObjectType = 0xb1; | 5465 static const int kJSObjectType = 0xb1; |
| 5465 static const int kFirstNonstringType = 0x80; | 5466 static const int kFirstNonstringType = 0x80; |
| 5466 static const int kOddballType = 0x83; | 5467 static const int kOddballType = 0x83; |
| 5467 static const int kForeignType = 0x87; | 5468 static const int kForeignType = 0x87; |
| 5468 | 5469 |
| 5469 static const int kUndefinedOddballKind = 5; | 5470 static const int kUndefinedOddballKind = 5; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5665 if (this->IsEmpty()) return false; | 5666 if (this->IsEmpty()) return false; |
| 5666 return I::GetNodeFlag(reinterpret_cast<internal::Object**>(this->val_), | 5667 return I::GetNodeFlag(reinterpret_cast<internal::Object**>(this->val_), |
| 5667 I::kNodeIsIndependentShift); | 5668 I::kNodeIsIndependentShift); |
| 5668 } | 5669 } |
| 5669 | 5670 |
| 5670 | 5671 |
| 5671 template <class T> | 5672 template <class T> |
| 5672 bool Persistent<T>::IsNearDeath() const { | 5673 bool Persistent<T>::IsNearDeath() const { |
| 5673 typedef internal::Internals I; | 5674 typedef internal::Internals I; |
| 5674 if (this->IsEmpty()) return false; | 5675 if (this->IsEmpty()) return false; |
| 5675 return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)) == | 5676 uint8_t node_state = |
| 5676 I::kNodeStateIsNearDeathValue; | 5677 I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)); |
| 5678 return node_state == I::kNodeStateIsNearDeathValue || |
| 5679 node_state == I::kNodeStateIsPendingValue; |
| 5677 } | 5680 } |
| 5678 | 5681 |
| 5679 | 5682 |
| 5680 template <class T> | 5683 template <class T> |
| 5681 bool Persistent<T>::IsWeak() const { | 5684 bool Persistent<T>::IsWeak() const { |
| 5682 typedef internal::Internals I; | 5685 typedef internal::Internals I; |
| 5683 if (this->IsEmpty()) return false; | 5686 if (this->IsEmpty()) return false; |
| 5684 return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)) == | 5687 return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)) == |
| 5685 I::kNodeStateIsWeakValue; | 5688 I::kNodeStateIsWeakValue; |
| 5686 } | 5689 } |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6537 | 6540 |
| 6538 | 6541 |
| 6539 } // namespace v8 | 6542 } // namespace v8 |
| 6540 | 6543 |
| 6541 | 6544 |
| 6542 #undef V8EXPORT | 6545 #undef V8EXPORT |
| 6543 #undef TYPE_CHECK | 6546 #undef TYPE_CHECK |
| 6544 | 6547 |
| 6545 | 6548 |
| 6546 #endif // V8_H_ | 6549 #endif // V8_H_ |
| OLD | NEW |