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 26 matching lines...) Expand all Loading... |
37 // property index (in the actual instance-descriptor array) and | 37 // property index (in the actual instance-descriptor array) and |
38 // optionally a piece of data. | 38 // optionally a piece of data. |
39 // | 39 // |
40 | 40 |
41 class Descriptor BASE_EMBEDDED { | 41 class Descriptor BASE_EMBEDDED { |
42 public: | 42 public: |
43 static int IndexFromValue(Object* value) { | 43 static int IndexFromValue(Object* value) { |
44 return Smi::cast(value)->value(); | 44 return Smi::cast(value)->value(); |
45 } | 45 } |
46 | 46 |
47 String* key() { return key_; } | |
48 | |
49 Object* KeyToSymbol() { | 47 Object* KeyToSymbol() { |
50 if (!key_->IsSymbol()) { | 48 if (!key_->IsSymbol()) { |
51 Object* result = Heap::LookupSymbol(key_); | 49 Object* result = Heap::LookupSymbol(key_); |
52 if (result->IsFailure()) return result; | 50 if (result->IsFailure()) return result; |
53 key_ = String::cast(result); | 51 key_ = String::cast(result); |
54 } | 52 } |
55 return key_; | 53 return key_; |
56 } | 54 } |
57 | 55 |
58 String* GetKey() { return key_; } | 56 String* GetKey() { return key_; } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 381 |
384 // Append a descriptor to this stream. | 382 // Append a descriptor to this stream. |
385 void Write(Descriptor* desc); | 383 void Write(Descriptor* desc); |
386 // Read a descriptor from the reader and append it to this stream. | 384 // Read a descriptor from the reader and append it to this stream. |
387 void WriteFrom(DescriptorReader* reader); | 385 void WriteFrom(DescriptorReader* reader); |
388 }; | 386 }; |
389 | 387 |
390 } } // namespace v8::internal | 388 } } // namespace v8::internal |
391 | 389 |
392 #endif // V8_PROPERTY_H_ | 390 #endif // V8_PROPERTY_H_ |
OLD | NEW |