Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1138)

Unified Diff: src/property.h

Issue 149458: Remove the descriptor stream abstractions.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/factory.cc ('K') | « src/objects-inl.h ('k') | src/property.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property.h
===================================================================
--- src/property.h (revision 2423)
+++ src/property.h (working copy)
@@ -324,92 +324,6 @@
};
-// The DescriptorStream is an abstraction for iterating over a map's
-// instance descriptors.
-class DescriptorStream BASE_EMBEDDED {
- public:
- explicit DescriptorStream(DescriptorArray* descriptors, int pos) {
- descriptors_ = descriptors;
- pos_ = pos;
- limit_ = descriptors_->number_of_descriptors();
- }
-
- // Tells whether we have reached the end of the steam.
- bool eos() { return pos_ >= limit_; }
-
- int next_position() { return pos_ + 1; }
- void advance() { pos_ = next_position(); }
-
- protected:
- DescriptorArray* descriptors_;
- int pos_; // Current position.
- int limit_; // Limit for position.
-};
-
-
-class DescriptorReader: public DescriptorStream {
- public:
- explicit DescriptorReader(DescriptorArray* descriptors, int pos = 0)
- : DescriptorStream(descriptors, pos) {}
-
- String* GetKey() { return descriptors_->GetKey(pos_); }
- Object* GetValue() { return descriptors_->GetValue(pos_); }
- PropertyDetails GetDetails() {
- return PropertyDetails(descriptors_->GetDetails(pos_));
- }
-
- int GetFieldIndex() { return Descriptor::IndexFromValue(GetValue()); }
-
- bool IsDontEnum() { return GetDetails().IsDontEnum(); }
-
- PropertyType type() { return GetDetails().type(); }
-
- // Tells whether the type is a transition.
- bool IsTransition() {
- PropertyType t = type();
- ASSERT(t != INTERCEPTOR);
- return t == MAP_TRANSITION || t == CONSTANT_TRANSITION;
- }
-
- bool IsNullDescriptor() {
- return type() == NULL_DESCRIPTOR;
- }
-
- bool IsProperty() {
- return type() < FIRST_PHANTOM_PROPERTY_TYPE;
- }
-
- JSFunction* GetConstantFunction() { return JSFunction::cast(GetValue()); }
-
- AccessorDescriptor* GetCallbacks() {
- ASSERT(type() == CALLBACKS);
- Proxy* p = Proxy::cast(GetCallbacksObject());
- return reinterpret_cast<AccessorDescriptor*>(p->proxy());
- }
-
- Object* GetCallbacksObject() {
- ASSERT(type() == CALLBACKS);
- return GetValue();
- }
-
- bool Equals(String* name) { return name->Equals(GetKey()); }
-
- void Get(Descriptor* desc) {
- descriptors_->Get(pos_, desc);
- }
-};
-
-class DescriptorWriter: public DescriptorStream {
- public:
- explicit DescriptorWriter(DescriptorArray* descriptors)
- : DescriptorStream(descriptors, 0) {}
-
- // Append a descriptor to this stream.
- void Write(Descriptor* desc);
- // Read a descriptor from the reader and append it to this stream.
- void WriteFrom(DescriptorReader* reader);
-};
-
} } // namespace v8::internal
#endif // V8_PROPERTY_H_
« src/factory.cc ('K') | « src/objects-inl.h ('k') | src/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698