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

Unified Diff: src/objects.h

Issue 8733: Merged bleeding_edge r599:645 into regexp2000. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
===================================================================
--- src/objects.h (revision 645)
+++ src/objects.h (working copy)
@@ -395,29 +395,30 @@
const uint32_t kStringTag = 0x0;
const uint32_t kNotStringTag = 0x80;
-// If bit 7 is clear, bits 5 and 6 are the string's size (short, medium, or
-// long).
-const uint32_t kStringSizeMask = 0x60;
-const uint32_t kShortStringTag = 0x0;
-const uint32_t kMediumStringTag = 0x20;
-const uint32_t kLongStringTag = 0x40;
-
-// If bit 7 is clear, bit 4 indicates that the string is a symbol (if set) or
+// If bit 7 is clear, bit 5 indicates that the string is a symbol (if set) or
// not (if cleared).
-const uint32_t kIsSymbolMask = 0x10;
+const uint32_t kIsSymbolMask = 0x20;
const uint32_t kNotSymbolTag = 0x0;
-const uint32_t kSymbolTag = 0x10;
+const uint32_t kSymbolTag = 0x20;
-// If bit 7 is clear, and the string representation is a sequential string,
-// then bit 3 indicates whether the string consists of two-byte characters or
-// one-byte characters.
-const uint32_t kStringEncodingMask = 0x8;
+// If bit 7 is clear, bits 3 and 4 are the string's size (short, medium or
+// long). These values are very special in that they are also used to shift
+// the length field to get the length, removing the hash value. This avoids
+// using if or switch when getting the length of a string.
+const uint32_t kStringSizeMask = 0x18;
+const uint32_t kShortStringTag = 0x18;
+const uint32_t kMediumStringTag = 0x10;
+const uint32_t kLongStringTag = 0x00;
+
+// If bit 7 is clear then bit 2 indicates whether the string consists of
+// two-byte characters or one-byte characters.
+const uint32_t kStringEncodingMask = 0x4;
const uint32_t kTwoByteStringTag = 0x0;
-const uint32_t kAsciiStringTag = 0x8;
+const uint32_t kAsciiStringTag = 0x4;
-// If bit 7 is clear, the low-order 3 bits indicate the representation
+// If bit 7 is clear, the low-order 2 bits indicate the representation
// of the string.
-const uint32_t kStringRepresentationMask = 0x07;
+const uint32_t kStringRepresentationMask = 0x03;
enum StringRepresentationTag {
kSeqStringTag = 0x0,
kConsStringTag = 0x1,
@@ -625,6 +626,7 @@
inline bool IsOddball();
inline bool IsSharedFunctionInfo();
inline bool IsJSValue();
+ inline bool IsStringWrapper();
inline bool IsProxy();
inline bool IsBoolean();
inline bool IsJSArray();
@@ -1041,7 +1043,11 @@
// object is overflowed (ie, partially restore the map pointer).
inline void ClearOverflow();
- static inline Object* GetHeapObjectField(HeapObject* obj, int index);
+ // Returns the field at offset in obj, as a read/write Object* reference.
+ // Does no checking, and is safe to use during GC, while maps are invalid.
+ // Does not update remembered sets, so should only be assigned to
+ // during marking GC.
+ static inline Object** RawField(HeapObject* obj, int offset);
// Casting.
static inline HeapObject* cast(Object* obj);
@@ -1973,9 +1979,6 @@
// Fill in details for properties into storage.
void CopyKeysTo(FixedArray* storage);
- // Returns the value at entry.
- static int ValueIndexFor(int entry) { return EntryToIndex(entry)+1; }
-
// For transforming properties of a JSObject.
Object* TransformPropertiesToFastFor(JSObject* obj,
int unused_property_fields);
@@ -2421,6 +2424,17 @@
// Removes a code object from the code cache at the given index.
void RemoveFromCodeCache(int index);
+ // For every transition in this map, makes the transition's
+ // target's prototype pointer point back to this map.
+ // This is undone in MarkCompactCollector::ClearNonLiveTransitions().
+ void CreateBackPointers();
+
+ // Set all map transitions from this map to dead maps to null.
+ // Also, restore the original prototype on the targets of these
+ // transitions, so that we do not process this map again while
+ // following back pointers.
+ void ClearNonLiveTransitions(Object* real_prototype);
+
// Dispatched behavior.
void MapIterateBody(ObjectVisitor* v);
#ifdef DEBUG
@@ -2805,7 +2819,7 @@
// [builtins]: the object holding the runtime routines written in JS.
DECL_ACCESSORS(builtins, JSBuiltinsObject)
- // [global context]: the global context corresponding to this global objet.
+ // [global context]: the global context corresponding to this global object.
DECL_ACCESSORS(global_context, Context)
// [global receiver]: the global receiver object of the context
@@ -3154,8 +3168,8 @@
static const int kSize = kLengthOffset + kIntSize;
// Limits on sizes of different types of strings.
- static const int kMaxShortStringSize = 255;
- static const int kMaxMediumStringSize = 65535;
+ static const int kMaxShortStringSize = 63;
+ static const int kMaxMediumStringSize = 16383;
static const int kMaxArrayIndexSize = 10;
@@ -3176,14 +3190,14 @@
// Array index strings this short can keep their index in the hash
// field.
- static const int kMaxCachedArrayIndexLength = 6;
+ static const int kMaxCachedArrayIndexLength = 7;
// Shift constants for retriving length and hash code from
// length/hash field.
static const int kHashShift = kNofLengthBitFields;
- static const int kShortLengthShift = 3 * kBitsPerByte;
- static const int kMediumLengthShift = 2 * kBitsPerByte;
- static const int kLongLengthShift = kHashShift;
+ static const int kShortLengthShift = kHashShift + kShortStringTag;
+ static const int kMediumLengthShift = kHashShift + kMediumStringTag;
+ static const int kLongLengthShift = kHashShift + kLongStringTag;
// Limit for truncation in short printing.
static const int kMaxShortPrintLength = 1024;
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698