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 27 matching lines...) Expand all Loading... |
38 // property index (in the actual instance-descriptor array) and | 38 // property index (in the actual instance-descriptor array) and |
39 // optionally a piece of data. | 39 // optionally a piece of data. |
40 // | 40 // |
41 | 41 |
42 class Descriptor BASE_EMBEDDED { | 42 class Descriptor BASE_EMBEDDED { |
43 public: | 43 public: |
44 static int IndexFromValue(Object* value) { | 44 static int IndexFromValue(Object* value) { |
45 return Smi::cast(value)->value(); | 45 return Smi::cast(value)->value(); |
46 } | 46 } |
47 | 47 |
48 Object* KeyToSymbol() { | 48 MUST_USE_RESULT MaybeObject* KeyToSymbol() { |
49 if (!StringShape(key_).IsSymbol()) { | 49 if (!StringShape(key_).IsSymbol()) { |
50 Object* result = Heap::LookupSymbol(key_); | 50 Object* result; |
51 if (result->IsFailure()) return result; | 51 { MaybeObject* maybe_result = Heap::LookupSymbol(key_); |
| 52 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 53 } |
52 key_ = String::cast(result); | 54 key_ = String::cast(result); |
53 } | 55 } |
54 return key_; | 56 return key_; |
55 } | 57 } |
56 | 58 |
57 String* GetKey() { return key_; } | 59 String* GetKey() { return key_; } |
58 Object* GetValue() { return value_; } | 60 Object* GetValue() { return value_; } |
59 PropertyDetails GetDetails() { return details_; } | 61 PropertyDetails GetDetails() { return details_; } |
60 | 62 |
61 #ifdef DEBUG | 63 #ifdef DEBUG |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 JSObject* holder_; | 308 JSObject* holder_; |
307 int number_; | 309 int number_; |
308 bool cacheable_; | 310 bool cacheable_; |
309 PropertyDetails details_; | 311 PropertyDetails details_; |
310 }; | 312 }; |
311 | 313 |
312 | 314 |
313 } } // namespace v8::internal | 315 } } // namespace v8::internal |
314 | 316 |
315 #endif // V8_PROPERTY_H_ | 317 #endif // V8_PROPERTY_H_ |
OLD | NEW |