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

Unified Diff: src/d8.cc

Issue 196793013: Revert "New Compilation API, part 1" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 539ebaae755534ea1bbb8050c627c1368b2f844b..564aafe0050263b5128c1693ac9a0845bd2fab1e 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -205,9 +205,7 @@ bool Shell::ExecuteString(Isolate* isolate,
// When debugging make exceptions appear to be uncaught.
try_catch.SetVerbose(true);
}
- ScriptOrigin origin(name);
- Handle<UnboundScript> script = ScriptCompiler::CompileUnbound(
- isolate, ScriptCompiler::Source(source, origin));
+ Handle<Script> script = Script::New(source, name);
if (script.IsEmpty()) {
// Print errors that happened during compilation.
if (report_exceptions && !FLAG_debugger)
@@ -218,7 +216,7 @@ bool Shell::ExecuteString(Isolate* isolate,
Local<Context> realm =
Local<Context>::New(isolate, data->realms_[data->realm_current_]);
realm->Enter();
- Handle<Value> result = script->BindToCurrentContext()->Run();
+ Handle<Value> result = script->Run();
realm->Exit();
data->realm_current_ = data->realm_switch_;
if (result.IsEmpty()) {
@@ -407,12 +405,11 @@ void Shell::RealmEval(const v8::FunctionCallbackInfo<v8::Value>& args) {
Throw(args.GetIsolate(), "Invalid argument");
return;
}
- Handle<UnboundScript> script = ScriptCompiler::CompileUnbound(
- isolate, ScriptCompiler::Source(args[1]->ToString()));
+ Handle<Script> script = Script::New(args[1]->ToString());
if (script.IsEmpty()) return;
Local<Context> realm = Local<Context>::New(isolate, data->realms_[index]);
realm->Enter();
- Handle<Value> result = script->BindToCurrentContext()->Run();
+ Handle<Value> result = script->Run();
realm->Exit();
args.GetReturnValue().Set(result);
}
@@ -809,8 +806,7 @@ void Shell::InstallUtilityScript(Isolate* isolate) {
Handle<String> name =
String::NewFromUtf8(isolate, shell_source_name.start(),
String::kNormalString, shell_source_name.length());
- ScriptOrigin origin(name);
- Handle<Script> script = Script::Compile(source, &origin);
+ Handle<Script> script = Script::Compile(source, name);
script->Run();
// Mark the d8 shell script as native to avoid it showing up as normal source
// in the debugger.
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698