From e70a4cb7cb7770abdeab5f85fe42b674ee49eb17 Mon Sep 17 00:00:00 2001 From: Jerry Sievert Date: Wed, 3 Oct 2018 20:59:21 -0700 Subject: [PATCH 1/8] 3.0 alpha compiling against 7.0.276.20 --- META.json | 14 +++++++------- Makefile | 4 ++-- Makefile.shared | 2 +- plv8.cc | 49 +++++++++++++++++++++++++++++-------------------- plv8_func.cc | 38 +++++++++++++++++++------------------- plv8_type.cc | 29 ++++++++++++++++------------- 6 files changed, 74 insertions(+), 62 deletions(-) diff --git a/META.json b/META.json index 9344f938..ef509c66 100644 --- a/META.json +++ b/META.json @@ -2,7 +2,7 @@ "name": "plv8", "abstract": "A procedural language in JavaScript powered by V8", "description": "plv8 is a trusted procedural language that is safe to use, fast to run and easy to develop.", - "version": "2.3.8", + "version": "3.0alpha", "maintainer": [ "Jerry Sievert " ], @@ -23,21 +23,21 @@ }, "provides": { "plv8": { - "file": "plv8--2.3.8.sql", + "file": "plv8--3.0alpha.sql", "docfile": "docs/PGXN.md", - "version": "2.3.8", + "version": "3.0alpha", "abstract": "A procedural language in JavaScript" }, "plcoffee": { - "file": "plcoffee--2.3.8.sql", + "file": "plcoffee--3.0alpha.sql", "docfile": "docs/PGXN.md", - "version": "2.3.8", + "version": "3.0alpha", "abstract": "A procedural language in CoffeeScript" }, "plls": { - "file": "plls--2.3.8.sql", + "file": "plls--3.0alpha.sql", "docfile": "docs/PGXN.md", - "version": "2.3.8", + "version": "3.0alpha", "abstract": "A procedural language in LiveScript" } }, diff --git a/Makefile b/Makefile index d2870eb5..df837a6c 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ # structure in v8 which may be different from version to another, but user # can specify the v8 version by AUTOV8_VERSION, too. #-----------------------------------------------------------------------------# -AUTOV8_VERSION = 6.4.388.40 +AUTOV8_VERSION = 7.0.276.20 AUTOV8_DIR = build/v8 AUTOV8_OUT = build/v8/out.gn/x64.release/obj AUTOV8_DEPOT_TOOLS = build/depot_tools @@ -32,7 +32,7 @@ $(AUTOV8_DEPOT_TOOLS): cd build; git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $(AUTOV8_DIR): $(AUTOV8_DEPOT_TOOLS) - cd build; fetch v8; cd v8; git checkout $(AUTOV8_VERSION); gclient sync ; cd build/config ; git cherry-pick 4287a0d364541583a50cc91465330251460d489a ; cd ../.. ; tools/dev/v8gen.py $(PLATFORM) -- $(V8_OPTIONS) + cd build; fetch v8; cd v8; git checkout $(AUTOV8_VERSION); gclient sync ; cd ../.. ; tools/dev/v8gen.py $(PLATFORM) -- $(V8_OPTIONS) $(AUTOV8_OUT)/third_party/icu/common/icudtb.dat: diff --git a/Makefile.shared b/Makefile.shared index c836bddb..8cb07d52 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -12,7 +12,7 @@ # 'make' will download v8 and build, then statically link to it. # #-----------------------------------------------------------------------------# -PLV8_VERSION = 2.3.8 +PLV8_VERSION = 3.0alpha PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/plv8.cc b/plv8.cc index 95e9d8d1..aeab3246 100644 --- a/plv8.cc +++ b/plv8.cc @@ -495,7 +495,7 @@ void *term_handler = NULL; void signal_handler (int sig) { elog(DEBUG1, "cancelling execution"); - v8::V8::TerminateExecution(plv8_isolate); + plv8_isolate->TerminateExecution(); } /* @@ -507,7 +507,7 @@ static Local DoCall(Handle fn, Handle receiver, int nargs, Handle args[]) { - TryCatch try_catch; + TryCatch try_catch(plv8_isolate); #ifdef EXECUTION_TIMEOUT #ifdef _MSC_VER HANDLE hThread; @@ -825,7 +825,7 @@ CallTrigger(PG_FUNCTION_ARGS, plv8_exec_env *xenv) tgargs->Set(i, ToString(trig->tg_trigger->tgargs[i])); args[9] = tgargs; - TryCatch try_catch; + TryCatch try_catch(plv8_isolate); Local recv = Local::New(plv8_isolate, xenv->recv); Local fn = Local::Cast(recv->GetInternalField(0)); @@ -1168,7 +1168,7 @@ CompileDialect(const char *src, Dialect dialect) } Local ctx = Local::New(plv8_isolate, context); Context::Scope context_scope(ctx); - TryCatch try_catch; + TryCatch try_catch(plv8_isolate); Local key; char *cresult; const char *dialect_binary_data; @@ -1194,11 +1194,15 @@ CompileDialect(const char *src, Dialect dialect) if (ctx->Global()->Get(key)->IsUndefined()) { HandleScope handle_scope(plv8_isolate); - Local