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

Unified Diff: src/objects.h

Issue 347002: Derive string size constants... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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/heap.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 3160)
+++ src/objects.h (working copy)
@@ -4070,10 +4070,8 @@
static const int kSize = kLengthOffset + kIntSize;
// Notice: kSize is not pointer-size aligned if pointers are 64-bit.
- // Limits on sizes of different types of strings.
- static const int kMaxShortStringSize = 63;
- static const int kMaxMediumStringSize = 16383;
-
+ // Maximum number of characters to consider when trying to convert a string
+ // value into an array index.
static const int kMaxArrayIndexSize = 10;
// Max ascii char code.
@@ -4097,13 +4095,17 @@
// field.
static const int kMaxCachedArrayIndexLength = 7;
- // Shift constants for retriving length and hash code from
+ // Shift constants for retrieving length and hash code from
// length/hash field.
static const int kHashShift = kNofLengthBitFields;
static const int kShortLengthShift = kHashShift + kShortStringTag;
static const int kMediumLengthShift = kHashShift + kMediumStringTag;
static const int kLongLengthShift = kHashShift + kLongStringTag;
- // Maximal string length that can be stored in the hash/length field.
+
+ // Maximal string length that can be stored in the hash/length field for
+ // different types of strings.
+ static const int kMaxShortSize = (1 << (32 - kShortLengthShift)) - 1;
+ static const int kMaxMediumSize = (1 << (32 - kMediumLengthShift)) - 1;
static const int kMaxLength = (1 << (32 - kLongLengthShift)) - 1;
// Limit for truncation in short printing.
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698