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

Side by Side Diff: src/objects.h

Issue 3031005: [Isolates] Avoid dereferencing Isolate::Current() to check oddball identities... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 4 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/isolate.h ('k') | src/objects.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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 4738 matching lines...) Expand 10 before | Expand all | Expand 10 after
4749 4749
4750 // The Oddball describes objects null, undefined, true, and false. 4750 // The Oddball describes objects null, undefined, true, and false.
4751 class Oddball: public HeapObject { 4751 class Oddball: public HeapObject {
4752 public: 4752 public:
4753 // [to_string]: Cached to_string computed at startup. 4753 // [to_string]: Cached to_string computed at startup.
4754 DECL_ACCESSORS(to_string, String) 4754 DECL_ACCESSORS(to_string, String)
4755 4755
4756 // [to_number]: Cached to_number computed at startup. 4756 // [to_number]: Cached to_number computed at startup.
4757 DECL_ACCESSORS(to_number, Object) 4757 DECL_ACCESSORS(to_number, Object)
4758 4758
4759 inline byte kind();
4760 inline void set_kind(byte kind);
4761
4759 // Casting. 4762 // Casting.
4760 static inline Oddball* cast(Object* obj); 4763 static inline Oddball* cast(Object* obj);
4761 4764
4762 // Dispatched behavior. 4765 // Dispatched behavior.
4763 void OddballIterateBody(ObjectVisitor* v); 4766 void OddballIterateBody(ObjectVisitor* v);
4764 #ifdef DEBUG 4767 #ifdef DEBUG
4765 void OddballVerify(); 4768 void OddballVerify();
4766 #endif 4769 #endif
4767 4770
4768 // Initialize the fields. 4771 // Initialize the fields.
4769 Object* Initialize(const char* to_string, Object* to_number); 4772 Object* Initialize(const char* to_string, Object* to_number, byte kind);
4770 4773
4771 // Layout description. 4774 // Layout description.
4772 static const int kToStringOffset = HeapObject::kHeaderSize; 4775 static const int kToStringOffset = HeapObject::kHeaderSize;
4773 static const int kToNumberOffset = kToStringOffset + kPointerSize; 4776 static const int kToNumberOffset = kToStringOffset + kPointerSize;
4774 static const int kSize = kToNumberOffset + kPointerSize; 4777 static const int kKindOffset = kToNumberOffset + kPointerSize;
4778 static const int kSize = kKindOffset + kPointerSize;
4779
4780 static const byte kFalse = 0;
4781 static const byte kTrue = 1;
4782 static const byte kNotBooleanMask = ~1;
4783 static const byte kTheHole = 2;
4784 static const byte kNull = 3;
4785 static const byte kUndefined = 4;
4786 static const byte kOther = 5;
4775 4787
4776 private: 4788 private:
4777 DISALLOW_IMPLICIT_CONSTRUCTORS(Oddball); 4789 DISALLOW_IMPLICIT_CONSTRUCTORS(Oddball);
4778 }; 4790 };
4779 4791
4780 4792
4781 class JSGlobalPropertyCell: public HeapObject { 4793 class JSGlobalPropertyCell: public HeapObject {
4782 public: 4794 public:
4783 // [value]: value of the global property. 4795 // [value]: value of the global property.
4784 DECL_ACCESSORS(value, Object) 4796 DECL_ACCESSORS(value, Object)
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
5356 } else { 5368 } else {
5357 value &= ~(1 << bit_position); 5369 value &= ~(1 << bit_position);
5358 } 5370 }
5359 return value; 5371 return value;
5360 } 5372 }
5361 }; 5373 };
5362 5374
5363 } } // namespace v8::internal 5375 } } // namespace v8::internal
5364 5376
5365 #endif // V8_OBJECTS_H_ 5377 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698