| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 // Tells whether we have reached the end of the steam. | 318 // Tells whether we have reached the end of the steam. |
| 319 bool eos() { return pos_ >= limit_; } | 319 bool eos() { return pos_ >= limit_; } |
| 320 | 320 |
| 321 int next_position() { return pos_ + 1; } | 321 int next_position() { return pos_ + 1; } |
| 322 void advance() { pos_ = next_position(); } | 322 void advance() { pos_ = next_position(); } |
| 323 | 323 |
| 324 protected: | 324 protected: |
| 325 DescriptorArray* descriptors_; | 325 DescriptorArray* descriptors_; |
| 326 int pos_; // Current position. | 326 int pos_; // Current position. |
| 327 int limit_; // Limit for posistion. | 327 int limit_; // Limit for position. |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 | 330 |
| 331 class DescriptorReader: public DescriptorStream { | 331 class DescriptorReader: public DescriptorStream { |
| 332 public: | 332 public: |
| 333 explicit DescriptorReader(DescriptorArray* descriptors, int pos = 0) | 333 explicit DescriptorReader(DescriptorArray* descriptors, int pos = 0) |
| 334 : DescriptorStream(descriptors, pos) {} | 334 : DescriptorStream(descriptors, pos) {} |
| 335 | 335 |
| 336 String* GetKey() { return descriptors_->GetKey(pos_); } | 336 String* GetKey() { return descriptors_->GetKey(pos_); } |
| 337 Object* GetValue() { return descriptors_->GetValue(pos_); } | 337 Object* GetValue() { return descriptors_->GetValue(pos_); } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 383 |
| 384 // Append a descriptor to this stream. | 384 // Append a descriptor to this stream. |
| 385 void Write(Descriptor* desc); | 385 void Write(Descriptor* desc); |
| 386 // Read a descriptor from the reader and append it to this stream. | 386 // Read a descriptor from the reader and append it to this stream. |
| 387 void WriteFrom(DescriptorReader* reader); | 387 void WriteFrom(DescriptorReader* reader); |
| 388 }; | 388 }; |
| 389 | 389 |
| 390 } } // namespace v8::internal | 390 } } // namespace v8::internal |
| 391 | 391 |
| 392 #endif // V8_PROPERTY_H_ | 392 #endif // V8_PROPERTY_H_ |
| OLD | NEW |