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

Unified Diff: src/factory.cc

Issue 484703002: Make internalized string parser in JSON.parse GC-safe (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index bb5e97a34e1f09c5260c47e64f73eba6badb1324..5ecdfcfd2f4aec25c94ab22927b53363715b3b59 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -186,7 +186,7 @@ Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) {
Handle<String> Factory::InternalizeOneByteString(
Handle<SeqOneByteString> string, int from, int length) {
- SubStringKey<uint8_t> key(string, from, length);
+ SeqOneByteSubStringKey key(string, from, length);
return InternalizeStringWithKey(&key);
}
@@ -203,12 +203,6 @@ Handle<String> Factory::InternalizeStringWithKey(StringTableKey* key) {
}
-template Handle<String> Factory::InternalizeStringWithKey<
- SubStringKey<uint8_t> > (SubStringKey<uint8_t>* key);
-template Handle<String> Factory::InternalizeStringWithKey<
- SubStringKey<uint16_t> > (SubStringKey<uint16_t>* key);
-
-
MaybeHandle<String> Factory::NewStringFromOneByte(Vector<const uint8_t> string,
PretenureFlag pretenure) {
int length = string.length();
@@ -313,6 +307,17 @@ MUST_USE_RESULT Handle<String> Factory::NewOneByteInternalizedString(
}
+MUST_USE_RESULT Handle<String> Factory::NewOneByteInternalizedSubString(
+ Handle<SeqOneByteString> string, int offset, int length,
+ uint32_t hash_field) {
+ CALL_HEAP_FUNCTION(
+ isolate(), isolate()->heap()->AllocateOneByteInternalizedString(
+ Vector<const uint8_t>(string->GetChars() + offset, length),
+ hash_field),
+ String);
+}
+
+
MUST_USE_RESULT Handle<String> Factory::NewTwoByteInternalizedString(
Vector<const uc16> str,
uint32_t hash_field) {
« no previous file with comments | « src/factory.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698