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

Unified Diff: src/heap.cc

Issue 201953002: Experimental parser: small fixes (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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.h ('k') | src/lexer/lexer.cc » ('j') | src/lexer/lexer-shell.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index aa5c3a9200cdfeecfad159ed9af42970ec2dc983..14c826481b049bfe4b6ed6deac9da6e7439fe40f 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4811,13 +4811,14 @@ MaybeObject* Heap::AllocateStringFromUtf8Slow(Vector<const char> string,
MaybeObject* Heap::AllocateStringFromTwoByte(Vector<const uc16> string,
+ bool check_for_one_byte,
PretenureFlag pretenure) {
// Check if the string is an ASCII string.
Object* result;
int length = string.length();
const uc16* start = string.start();
- if (String::IsOneByte(start, length)) {
+ if (check_for_one_byte && String::IsOneByte(start, length)) {
MaybeObject* maybe_result = AllocateRawOneByteString(length, pretenure);
if (!maybe_result->ToObject(&result)) return maybe_result;
CopyChars(SeqOneByteString::cast(result)->GetChars(), start, length);
« no previous file with comments | « src/heap.h ('k') | src/lexer/lexer.cc » ('j') | src/lexer/lexer-shell.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698