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

Side by Side Diff: src/property.h

Issue 9038: Create an abstraction for the string type flags so that they can be cached.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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
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 27 matching lines...) Expand all
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 Object* KeyToSymbol() { 47 Object* KeyToSymbol() {
48 if (!key_->IsSymbol()) { 48 if (!StringShape(key_).IsSymbol()) {
49 Object* result = Heap::LookupSymbol(key_); 49 Object* result = Heap::LookupSymbol(key_);
50 if (result->IsFailure()) return result; 50 if (result->IsFailure()) return result;
51 key_ = String::cast(result); 51 key_ = String::cast(result);
52 } 52 }
53 return key_; 53 return key_;
54 } 54 }
55 55
56 String* GetKey() { return key_; } 56 String* GetKey() { return key_; }
57 Object* GetValue() { return value_; } 57 Object* GetValue() { return value_; }
58 PropertyDetails GetDetails() { return details_; } 58 PropertyDetails GetDetails() { return details_; }
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698