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

Unified Diff: src/bootstrapper.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/bootstrapper.h ('k') | src/contexts.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index c373e52fcf31071cbb22f4df018fdc4d5f30dd3b..a9e9fe078e88b4fa5749794a7842d3ddd331eca3 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -493,8 +493,7 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
Builtins::kEmptyFunction));
empty_function->set_code(*code);
empty_function->shared()->set_code(*code);
- Handle<String> source =
- factory->NewStringFromOneByte(STATIC_ASCII_VECTOR("() {}"));
+ Handle<String> source = factory->NewStringFromStaticAscii("() {}");
Handle<Script> script = factory->NewScript(source);
script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
empty_function->shared()->set_script(*script);
@@ -1404,10 +1403,12 @@ bool Genesis::CompileBuiltin(Isolate* isolate, int index) {
bool Genesis::CompileExperimentalBuiltin(Isolate* isolate, int index) {
Vector<const char> name = ExperimentalNatives::GetScriptName(index);
Factory* factory = isolate->factory();
- Handle<String> source_code =
+ Handle<String> source_code;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, source_code,
factory->NewStringFromAscii(
- ExperimentalNatives::GetRawScriptSource(index));
- RETURN_IF_EMPTY_HANDLE_VALUE(isolate, source_code, false);
+ ExperimentalNatives::GetRawScriptSource(index)),
+ false);
return CompileNative(isolate, name, source_code);
}
@@ -1456,8 +1457,8 @@ bool Genesis::CompileScriptCached(Isolate* isolate,
// function and insert it into the cache.
if (cache == NULL || !cache->Lookup(name, &function_info)) {
ASSERT(source->IsOneByteRepresentation());
- Handle<String> script_name = factory->NewStringFromUtf8(name);
- ASSERT(!script_name.is_null());
+ Handle<String> script_name =
+ factory->NewStringFromUtf8(name).ToHandleChecked();
function_info = Compiler::CompileScript(
source,
script_name,
« no previous file with comments | « src/bootstrapper.h ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698