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

Side by Side Diff: src/property.h

Issue 3522008: This is a little experiment to move Failure to a superclass above Object... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
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 Object* KeyToSymbol() {
49 Object* result;
50 { TryAllocation t = Heap::LookupSymbol(key_);
51 if (!t->ToObject(&result)) return t;
52 }
49 if (!StringShape(key_).IsSymbol()) { 53 if (!StringShape(key_).IsSymbol()) {
50 Object* result = Heap::LookupSymbol(key_);
51 if (result->IsFailure()) return result;
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
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_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698