Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions .github/gbs.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[general]
profile = profile.t80std
# profile = profile.t70std
profile = profile.t90std
#profile = profile.t70std
#profile = profile.t65std
#profile = profile.t60std
#profile = profile.t55std
Expand All @@ -13,26 +13,23 @@ profile = profile.t80std
user =
passwd =

############## Tizen 8.0 ##############
[profile.t80std]
repos = repo.80base, repo.80std
buildroot = ~/GBS-ROOT/t80std
############## Tizen 9.0 ##############
[profile.t90std]
repos = repo.90base, repo.90std
buildroot = ~/GBS-ROOT/90std

[profile.t80emul]
repos = repo.80emulbase, repo.80emul
buildroot = ~/GBS-ROOT/t80emul
[profile.t90emul]
repos = repo.90base, repo.90emul
buildroot = ~/GBS-ROOT/90emul

[repo.80base]
url=https://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Base/latest/repos/standard/packages/
[repo.90base]
url=https://download.tizen.org/snapshots/TIZEN/Tizen-9.0/Tizen-9.0-Base/latest/repos/standard/packages/

[repo.80std]
url=https://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/latest/repos/standard/packages/
[repo.90std]
url=https://download.tizen.org/snapshots/TIZEN/Tizen-9.0/Tizen-9.0-Unified/latest/repos/standard/packages/

[repo.80emulbase]
url=http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Base/reference/repos/standard/packages/

[repo.80emul]
url=https://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/latest/repos/emulator/packages/
[repo.90emul]
url=https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/emulator/packages/


############## Tizen 7.0 ##############
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
export GYP=deps/node/tools/gyp/gyp
$GYP ./test/cctest.gyp --depth=. -f ninja \
--generator-output=$OUT_PATH -Dasan=$ASAN -Descargot_build_mode=debug \
-Descargot_lib_type=static_lib -Dtarget_arch=$ARCH -Dtarget_os=linux \
-Descargot_lib_type=shared_lib -Dtarget_arch=$ARCH -Dtarget_os=linux \
-Denable_experimental=true -Descargot_threading=1 \
-Descargot_debugger=0
ninja -C $OUT_PATH/out/Debug cctest
Expand All @@ -85,7 +85,7 @@ jobs:
strategy:
fail-fast: false
matrix:
profile: [t80std]
profile: [t90std]
steps:
- name: Checkout source
uses: actions/checkout@v2
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
name: tizen_std_${{ matrix.profile }}
path: /home/runner/GBS-ROOT/${{ matrix.profile }}/local/repos/${{ matrix.profile }}/armv7l/RPMS/
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def setupCLIOptions(parser):
lwnode_optgroup.add_option(
'--escargot-lib-type',
choices=['shared_lib', 'static_lib'],
default='static_lib',
default='shared_lib',
help='shared_lib | static_lib (%default)',
)

Expand Down
2 changes: 1 addition & 1 deletion deps/escargot
Submodule escargot updated 345 files
1 change: 1 addition & 0 deletions deps/node/test/skip_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ test/parallel/test-worker-nexttick-terminate.js
test/parallel/test-worker-process-cwd.js
test/parallel/test-worker-process-env.js
test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js
test/parallel/test-worker-stack-overflow.js # CI 테스트중 간헐적으로 timeout
test/parallel/test-worker-stdio.js # CI 테스트중 간헐적으로 crash. 타이밍 이슈로 추정됨
test/parallel/test-worker-syntax-error-file.js
test/parallel/test-worker-syntax-error.js
Expand Down
6 changes: 3 additions & 3 deletions escargot.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@
'output_dir': '<(SHARED_INTERMEDIATE_DIR)/escargot',
'escargot_libs': [
'<(output_dir)/libescargot<(lib_ext)',
'<(output_dir)/third_party/GCutil/libgc-lib.a',
'<(output_dir)/third_party/runtime_icu_binder/libruntime-icu-binder-static.a',
'<(output_dir)/liblibbf.a',
],
'escargot_configs': [
'-DESCARGOT_SMALL_CONFIG=1',
'-DESCARGOT_USE_CUSTOM_LOGGING=ON',
'-DESCARGOT_USE_EXTENDED_API=ON',
'-DESCARGOT_ARCH=<(target_arch)',
'-DESCARGOT_HOST=<(build_host)',
'-DESCARGOT_MODE=<(escargot_build_mode)',
Expand All @@ -73,12 +71,14 @@
'-Wl,-rpath,\$$ORIGIN/../<(output_dir)',
'-Wl,-rpath,../lib',
'-Wl,-rpath,\$$ORIGIN',
'-Wl,-rpath,\$$ORIGIN/gen/escargot',
],
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
'include_dirs': [
'<(escargot_dir)/third_party/GCutil',
'<(escargot_dir)/third_party/GCutil/bdwgc/include',
'<(escargot_dir)/third_party/GCutil/bdwgc/include/gc',
],
'configurations': {
'Debug': {
Expand Down
6 changes: 3 additions & 3 deletions include/lwnode/lwnode-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
#pragma once

#define LWNODE_VERSION_MAJOR 1
#define LWNODE_VERSION_MINOR 0
#define LWNODE_VERSION_PATCH 18
#define LWNODE_VERSION_TAG "v1.0.18"
#define LWNODE_VERSION_MINOR 1
#define LWNODE_VERSION_PATCH 0
#define LWNODE_VERSION_TAG "v1.1.0"
1 change: 1 addition & 0 deletions modules/packages/device-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ include_directories(
${PROJECT_ROOT_PATH}/deps/escargot/src/api
${PROJECT_ROOT_PATH}/deps/escargot/third_party/GCutil
${PROJECT_ROOT_PATH}/deps/escargot/third_party/GCutil/bdwgc/include
${PROJECT_ROOT_PATH}/deps/escargot/third_party/GCutil/bdwgc/include/gc
${PROJECT_ROOT_PATH}/deps/node/deps/uv/include
${PROJECT_ROOT_PATH}/src
include
Expand Down
8 changes: 4 additions & 4 deletions src/api-data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2314,14 +2314,14 @@ void String::ExternalStringResourceBase::operator delete(void* ptr) {

Local<Value> Symbol::Description() const {
auto lwIsolate = IsolateWrap::GetCurrent();
auto esDescription = CVAL(this)->value()->asSymbol()->description();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription.get());
auto esDescription = CVAL(this)->value()->asSymbol()->descriptionString();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription);
}

Local<Value> Private::Name() const {
auto lwIsolate = IsolateWrap::GetCurrent();
auto esDescription = CVAL(this)->value()->asSymbol()->description();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription.get());
auto esDescription = CVAL(this)->value()->asSymbol()->descriptionString();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription);
}

template <typename T, typename F>
Expand Down
140 changes: 95 additions & 45 deletions src/api-environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "api.h"
#include "api/engine.h"
#include "api/utils/cast.h"
#include "api/utils/debug.h"
#include "base.h"
#include "init/v8.h"

Expand Down Expand Up @@ -691,19 +692,73 @@ double v8::Date::ValueOf() const {
return scope.self()->asDateObject()->primitiveValue();
}

static RegExpObjectRef::RegExpObjectOption ToEsRegExpObjectOption(
v8::RegExp::Flags flags) {
int option = RegExpObjectRef::RegExpObjectOption::None;

if (flags & v8::RegExp::Flags::kGlobal) {
option |= RegExpObjectRef::RegExpObjectOption::Global;
}
if (flags & v8::RegExp::Flags::kIgnoreCase) {
option |= RegExpObjectRef::RegExpObjectOption::IgnoreCase;
}
if (flags & v8::RegExp::Flags::kMultiline) {
option |= RegExpObjectRef::RegExpObjectOption::MultiLine;
}
if (flags & v8::RegExp::Flags::kSticky) {
option |= RegExpObjectRef::RegExpObjectOption::Sticky;
}
if (flags & v8::RegExp::Flags::kUnicode) {
option |= RegExpObjectRef::RegExpObjectOption::Unicode;
}
if (flags & v8::RegExp::Flags::kDotAll) {
option |= RegExpObjectRef::RegExpObjectOption::DotAll;
}

return static_cast<RegExpObjectRef::RegExpObjectOption>(option);
}

static v8::RegExp::Flags ToV8RegExpFlags(
RegExpObjectRef::RegExpObjectOption option) {
int flags = v8::RegExp::Flags::kNone;

if (option & RegExpObjectRef::RegExpObjectOption::Global) {
flags |= v8::RegExp::Flags::kGlobal;
}
if (option & RegExpObjectRef::RegExpObjectOption::IgnoreCase) {
flags |= v8::RegExp::Flags::kIgnoreCase;
}
if (option & RegExpObjectRef::RegExpObjectOption::MultiLine) {
flags |= v8::RegExp::Flags::kMultiline;
}
if (option & RegExpObjectRef::RegExpObjectOption::Sticky) {
flags |= v8::RegExp::Flags::kSticky;
}
if (option & RegExpObjectRef::RegExpObjectOption::Unicode) {
flags |= v8::RegExp::Flags::kUnicode;
}
if (option & RegExpObjectRef::RegExpObjectOption::DotAll) {
flags |= v8::RegExp::Flags::kDotAll;
}

return static_cast<v8::RegExp::Flags>(flags);
}

MaybeLocal<v8::RegExp> v8::RegExp::New(Local<Context> context,
Local<String> pattern,
Flags flags) {
API_ENTER_WITH_CONTEXT(context, MaybeLocal<RegExp>());
auto lwContext = lwIsolate->GetCurrentContext();
auto lwPattern = CVAL(*pattern)->value();
int flagsValue = (int)flags;
RegExpObjectRef::RegExpObjectOption flagsValue =
ToEsRegExpObjectOption(flags);

auto r = Evaluator::execute(
lwContext->get(),
[](ExecutionStateRef* esState, ValueRef* source, int flags) -> ValueRef* {
return RegExpObjectRef::create(
esState, source, (RegExpObjectRef::RegExpObjectOption)flags);
[](ExecutionStateRef* esState,
ValueRef* source,
RegExpObjectRef::RegExpObjectOption flags) -> ValueRef* {
return RegExpObjectRef::create(esState, source, flags);
},
lwPattern,
flagsValue);
Expand Down Expand Up @@ -747,7 +802,7 @@ v8::RegExp::Flags v8::RegExp::GetFlags() const {
[](ExecutionStateRef* esState,
RegExpObjectRef* self,
int* flags) -> ValueRef* {
*flags = self->option();
*flags = ToV8RegExpFlags(self->option());
return ValueRef::createNull();
},
self->asRegExpObject(),
Expand Down Expand Up @@ -936,34 +991,38 @@ Maybe<bool> Map::Delete(Local<Context> context, Local<Value> key) {
Local<Array> Map::AsArray() const {
API_ENTER_NO_TERMINATION_CHECK(EsScope, nullptr);

EvalResult r = Evaluator::execute(
scope.context(),
[](ExecutionStateRef* esState, MapObjectRef* esSelf) -> ValueRef* {
auto done = StringRef::createFromASCII("done");
auto value = StringRef::createFromASCII("value");
auto zero = ValueRef::create(0);
auto one = ValueRef::create(1);
auto vector = ValueVectorRef::create();

auto itr = esSelf->entries(esState);
for (auto entry = itr->next(esState);
entry->asObject()->get(esState, done)->isFalse();
entry = itr->next(esState)) {
auto keyValueArray =
entry->asObject()->get(esState, value)->asObject();
auto key = keyValueArray->getIndexedProperty(esState, zero);
auto value = keyValueArray->getIndexedProperty(esState, one);

vector->pushBack(key);
vector->pushBack(value);
}

return ArrayObjectRef::create(esState, vector);
},
scope.self()->asMapObject());
LWNODE_CHECK(r.isSuccessful());

return Utils::NewLocal<Array>(scope.v8Isolate(), r.result);
LWNODE_UNIMPLEMENT;
return Utils::NewLocal<Array>(
scope.v8Isolate(), ArrayObjectRefHelper::create(scope.context(), 1));

// EvalResult r = Evaluator::execute(
// scope.context(),
// [](ExecutionStateRef* esState, MapObjectRef* esSelf) -> ValueRef* {
// auto done = StringRef::createFromASCII("done");
// auto value = StringRef::createFromASCII("value");
// auto zero = ValueRef::create(0);
// auto one = ValueRef::create(1);
// auto vector = ValueVectorRef::create();

// auto itr = esSelf->entries(esState);
// for (auto entry = itr->next(esState);
// entry->asObject()->get(esState, done)->isFalse();
// entry = itr->next(esState)) {
// auto keyValueArray =
// entry->asObject()->get(esState, value)->asObject();
// auto key = keyValueArray->getIndexedProperty(esState, zero);
// auto value = keyValueArray->getIndexedProperty(esState, one);

// vector->pushBack(key);
// vector->pushBack(value);
// }

// return ArrayObjectRef::create(esState, vector);
// },
// scope.self()->asMapObject());
// LWNODE_CHECK(r.isSuccessful());

// return Utils::NewLocal<Array>(scope.v8Isolate(), r.result);
}

Local<v8::Set> v8::Set::New(Isolate* isolate) {
Expand Down Expand Up @@ -2566,21 +2625,12 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)

auto esString = r.result->asString();
auto bufferData = esString->stringBufferAccessData();
std::string str;
if (bufferData.has8BitContent) {
length_ = bufferData.length;
} else {
str = esString->toStdUTF8String();
length_ = str.size();
}
std::string str = esString->toStdUTF8String();
length_ = str.size();

str_ = new char[length_ + 1];

if (bufferData.has8BitContent) {
strncpy(str_, reinterpret_cast<const char*>(bufferData.buffer), length_);
} else {
strncpy(str_, str.data(), length_);
}
strncpy(str_, str.data(), length_);

str_[length_] = '\0';
}
Expand Down
5 changes: 4 additions & 1 deletion src/api/es-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,10 @@ EvalResult ObjectRefHelper::setPrototype(ContextRef* context,
[](ExecutionStateRef* state,
ObjectRef* object,
ValueRef* prototype) -> ValueRef* {
return ValueRef::create(object->setPrototype(state, prototype));
// call ObjectRef::setObjectPrototype instead of ObjectRef::setPrototype
// here because ImmutablePrototypeObject blocks __proto__ property
// setting
return ValueRef::create(object->setObjectPrototype(state, prototype));
},
object,
prototype);
Expand Down
Loading
Loading