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

Unified Diff: src/scanner.cc

Issue 239243018: Heap::AllocateStringFromOneByte() and major part of its callers handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comment + some cleanup Created 6 years, 8 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/runtime.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index 67211e02921988e5846b5943184fef6419a7f105..fe75010c6ade94522250be38741ece8de3c19bc3 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -1118,13 +1118,19 @@ bool Scanner::ScanRegExpFlags() {
Handle<String> Scanner::AllocateNextLiteralString(Isolate* isolate,
PretenureFlag tenured) {
+ MaybeHandle<String> maybe_result;
if (is_next_literal_one_byte()) {
- return isolate->factory()->NewStringFromOneByte(
- Vector<const uint8_t>::cast(next_literal_one_byte_string()), tenured);
+ maybe_result = isolate->factory()->NewStringFromOneByte(
+ next_literal_one_byte_string(), tenured);
} else {
- return isolate->factory()->NewStringFromTwoByte(
- next_literal_two_byte_string(), tenured);
+ maybe_result = isolate->factory()->NewStringFromTwoByte(
+ next_literal_two_byte_string(), tenured);
}
+ // TODO(ishell): Temporarily returning null handle from here. I will proceed
+ // with maybehandlification in next CLs.
+ Handle<String> result;
+ if (!maybe_result.ToHandle(&result)) return Handle<String>();
+ return result;
}
« no previous file with comments | « src/runtime.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698