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

Unified Diff: src/api.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 | « no previous file | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 628a3fb3d1541c6e0c366fc7e32b8cb75dc26164..36271ca9b2e16d40285fceabf6020e6f010eefa4 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5328,9 +5328,10 @@ inline int StringLength(const uint16_t* string) {
}
-inline i::Handle<i::String> NewString(i::Factory* factory,
- String::NewStringType type,
- i::Vector<const char> string) {
+MUST_USE_RESULT
+inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
+ String::NewStringType type,
+ i::Vector<const char> string) {
if (type ==String::kInternalizedString) {
return factory->InternalizeUtf8String(string);
}
@@ -5338,9 +5339,10 @@ inline i::Handle<i::String> NewString(i::Factory* factory,
}
-inline i::Handle<i::String> NewString(i::Factory* factory,
- String::NewStringType type,
- i::Vector<const uint8_t> string) {
+MUST_USE_RESULT
+inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
+ String::NewStringType type,
+ i::Vector<const uint8_t> string) {
if (type == String::kInternalizedString) {
return factory->InternalizeOneByteString(string);
}
@@ -5348,9 +5350,10 @@ inline i::Handle<i::String> NewString(i::Factory* factory,
}
-inline i::Handle<i::String> NewString(i::Factory* factory,
- String::NewStringType type,
- i::Vector<const uint16_t> string) {
+MUST_USE_RESULT
+inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
+ String::NewStringType type,
+ i::Vector<const uint16_t> string) {
if (type == String::kInternalizedString) {
return factory->InternalizeTwoByteString(string);
}
@@ -5373,10 +5376,11 @@ inline Local<String> NewString(Isolate* v8_isolate,
}
ENTER_V8(isolate);
if (length == -1) length = StringLength(data);
- i::Handle<i::String> result = NewString(
- isolate->factory(), type, i::Vector<const Char>(data, length));
// We do not expect this to fail. Change this if it does.
- CHECK(!result.is_null());
+ i::Handle<i::String> result = NewString(
+ isolate->factory(),
+ type,
+ i::Vector<const Char>(data, length)).ToHandleChecked();
if (type == String::kUndetectableString) {
result->MarkAsUndetectable();
}
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698