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

Unified Diff: src/factory.cc

Issue 10828229: Add basic support for Latin1 strings to the API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index a4a2be24fa82a5aa8886e6cc606b4a84d6447f71..25d7c4c3d2f2b51f4311a0cb61424dacd38a59bd 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -205,10 +205,23 @@ Handle<String> Factory::NewStringFromAscii(Vector<const char> string,
}
Handle<String> Factory::NewStringFromUtf8(Vector<const char> string,
- PretenureFlag pretenure) {
+ PretenureFlag pretenure,
+ String::AsciiHint ascii_hint) {
CALL_HEAP_FUNCTION(
isolate(),
- isolate()->heap()->AllocateStringFromUtf8(string, pretenure),
+ isolate()->heap()->AllocateStringFromUtf8(
+ string, pretenure, ascii_hint),
+ String);
+}
+
+
+Handle<String> Factory::NewStringFromLatin1(Vector<const char> string,
+ PretenureFlag pretenure,
+ String::AsciiHint ascii_hint) {
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateStringFromLatin1(
+ string, pretenure, ascii_hint),
String);
}
@@ -718,7 +731,8 @@ Handle<String> Factory::EmergencyNewError(const char* type,
} else {
buffer[kBufferSize - 1] = '\0';
}
- Handle<String> error_string = NewStringFromUtf8(CStrVector(buffer), TENURED);
+ Handle<String> error_string =
Erik Corry 2012/08/10 11:28:51 Inadvertent edit?
Yang 2012/08/10 13:14:45 Yes. Done.
+ NewStringFromUtf8(CStrVector(buffer), TENURED);
return error_string;
}

Powered by Google App Engine
This is Rietveld 408576698