Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
48d4c68
enabling jsc build in travis
madanagopaltcomcast Apr 9, 2020
bdeb0c2
Update execute_osx.sh
madanagopalt Apr 9, 2020
8ef1bb7
Update rtScriptJSC.cpp
madanagopalt Apr 9, 2020
9fd23a2
Update Spark.cpp
madanagopalt Apr 9, 2020
5ebe1c6
Update script.sh
madanagopalt Apr 9, 2020
23962e3
Update script.sh
madanagopalt Apr 10, 2020
536e5dc
Update rtJSCBindings.cpp
madanagopalt Apr 10, 2020
4d9a03b
Update Spark.cpp
madanagopalt Apr 10, 2020
f8de396
Update CMakeLists.txt
madanagopalt Apr 10, 2020
ae96269
Update unittests_osx.sh
madanagopalt Apr 10, 2020
55e64dd
Update tests.json
madanagopalt Apr 10, 2020
0b7e52d
fix leaks with lightning apps
madanagopaltcomcast Apr 10, 2020
ccbcbd8
Update Spark.cpp
madanagopalt Apr 10, 2020
2da879f
Update Spark.cpp
madanagopalt Apr 10, 2020
b34c27e
Update Spark.cpp
madanagopalt Apr 10, 2020
9124f98
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 10, 2020
aa1a5de
Update execute_osx.sh
madanagopalt Apr 10, 2020
717efc0
Update rtJSCWrappers.cpp
madanagopalt Apr 10, 2020
fba5f0f
Test
madanagopalt Apr 10, 2020
a21464b
Test
madanagopalt Apr 10, 2020
ba10bb4
Update execute_osx.sh
madanagopalt Apr 10, 2020
e6e118b
Update execute_osx.sh
madanagopalt Apr 10, 2020
883ea8c
Update rtJSCWrappers.cpp
madanagopalt Apr 10, 2020
9d2fbdb
Update rtJSCWrappers.cpp
madanagopalt Apr 10, 2020
04a70c3
Update execute_osx.sh
madanagopalt Apr 10, 2020
8157417
Update execute_osx.sh
madanagopalt Apr 10, 2020
65d5c4d
Update rtJSCWrappers.cpp
madanagopalt Apr 10, 2020
db6ca09
Update rtJSCWrappers.cpp
madanagopalt Apr 10, 2020
af8d70a
Update rtJSCWrappers.cpp
madanagopalt Apr 10, 2020
a14935c
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
9f4d62a
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
be9d5ce
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
516a056
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
2ff5665
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
72d8c19
Tt
madanagopalt Apr 11, 2020
b7eceac
Tt
madanagopalt Apr 11, 2020
f970f4f
Tt
madanagopalt Apr 11, 2020
c7007bd
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
53e4ea1
Update execute_osx.sh
madanagopalt Apr 11, 2020
5ffd3ad
Update execute_osx.sh
madanagopalt Apr 11, 2020
03492b8
Update rtJSCMisc.cpp
madanagopalt Apr 11, 2020
c0d0571
Update rtJSCMisc.cpp
madanagopalt Apr 11, 2020
1c5dd21
Update rtJSCWrappers.cpp
madanagopalt Apr 11, 2020
1e573fd
Tt
madanagopalt Apr 11, 2020
2a775f5
Tt
madanagopalt Apr 11, 2020
28d4fb7
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
db0dd99
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
4db6aeb
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 11, 2020
5eb1252
Hg
madanagopalt Apr 11, 2020
fd70d3a
Tt
madanagopalt Apr 11, 2020
7fbd7de
Update rtJSCWrappers.cpp
madanagopalt Apr 12, 2020
0dec60e
Update rtJSCWrappers.cpp
madanagopalt Apr 12, 2020
165b626
Update rtJSCWrappers.cpp
madanagopalt Apr 12, 2020
c7a4416
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
6d4a1b4
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
c3c6e0c
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
d853063
Update before_install.sh
madanagopalt Apr 12, 2020
1508f18
Update before_install.sh
madanagopalt Apr 12, 2020
cdbd789
Update before_install.sh
madanagopalt Apr 12, 2020
0156932
Update .travis.yml
madanagopalt Apr 12, 2020
23956c4
Update .travis.yml
madanagopalt Apr 12, 2020
06fc3a6
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
fa10994
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
cecb9ed
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
aead7d8
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
626e460
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
931dfbf
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
196ad51
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
9e19ffc
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
2d7da4c
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
a53a230
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 12, 2020
a809b16
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
e23b49c
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
233b005
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
adde19b
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
66ab409
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
993927d
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
7d92a36
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
cacdbef
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
a3635a3
Merge branch 'travis_change' of https://github.com/madanagopalt/pxCor…
madanagopaltcomcast Apr 13, 2020
3b42877
Update rtJSCMisc.cpp
madanagopalt Apr 14, 2020
640dffd
Update rtJSCMisc.cpp
madanagopalt Apr 14, 2020
8293273
Update rtJSCWrappers.cpp
madanagopalt Apr 14, 2020
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
2 changes: 2 additions & 0 deletions ci/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ then
lldb --help
cmake --version
man lldb
cat /System/Library/Frameworks/JavaScriptCore.framework/Resources/Info.plist
cat /System/Library/Frameworks/JavaScriptCore.framework/Resources/version.plist
fi

#install lighttpd, code coverage binaries for mac
Expand Down
4 changes: 2 additions & 2 deletions ci/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PKG_CONFIG_PATH=$TRAVIS_BUILD_DIR/examples/pxScene2d/external/extlibs/lib
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "************************* Generating config files *************************" >> $BUILDLOGS
cmake -DPREFER_SYSTEM_LIBRARIES=ON -DPREFER_PKGCONFIG=ON -DPREFER_EXTERNAL_GIF=ON -DSPARK_ENABLE_VIDEO=ON -DBUILD_PX_TESTS=ON -DBUILD_PXSCENE_STATIC_LIB=ON -DBUILD_DEBUG_METRICS=ON -DPXSCENE_TEST_HTTP_CACHE=ON .. >>$BUILDLOGS 2>&1;
cmake -DSUPPORT_JSC=OFF -DPREFER_SYSTEM_LIBRARIES=ON -DPREFER_PKGCONFIG=ON -DPREFER_EXTERNAL_GIF=ON -DSPARK_ENABLE_VIDEO=ON -DBUILD_PX_TESTS=ON -DBUILD_PXSCENE_STATIC_LIB=ON -DBUILD_DEBUG_METRICS=ON -DPXSCENE_TEST_HTTP_CACHE=ON .. >>$BUILDLOGS 2>&1;
checkError $? "cmake config failed" "Config error" "Check the error in $BUILDLOGS"

echo "************************* Building pxcore,rtcore,pxscene app,libpxscene, unitttests ****" >> $BUILDLOGS
Expand All @@ -36,7 +36,7 @@ then

else
echo "************************* Generating config files ****"
cmake -DPREFER_SYSTEM_LIBRARIES=ON -DPREFER_PKGCONFIG=ON -DPREFER_EXTERNAL_GIF=ON -DSPARK_ENABLE_VIDEO=ON -DBUILD_PX_TESTS=ON -DBUILD_PXSCENE_STATIC_LIB=ON -DBUILD_DEBUG_METRICS=ON -DPXSCENE_TEST_HTTP_CACHE=ON .. 1>>$BUILDLOGS;
cmake -DSUPPORT_JSC=OFF -DPREFER_SYSTEM_LIBRARIES=ON -DPREFER_PKGCONFIG=ON -DPREFER_EXTERNAL_GIF=ON -DSPARK_ENABLE_VIDEO=ON -DBUILD_PX_TESTS=ON -DBUILD_PXSCENE_STATIC_LIB=ON -DBUILD_DEBUG_METRICS=ON -DPXSCENE_TEST_HTTP_CACHE=ON .. 1>>$BUILDLOGS;
checkError $? "cmake config failed" "Config error" "Check the errors displayed in this window"

echo "************************* Building pxcore,rtcore,pxscene app,libpxscene, unitttests ********"
Expand Down
8 changes: 8 additions & 0 deletions ci/execute_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ printExecLogs()
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Start testRunner ...
sparkPlatform=$1
if [ "$sparkPlatform" = "jsc" ]; then
export SPARK_USE_JSC=1
echo "Running under JSC Platform"
else
echo "Running under Node Platform"
fi
rm -rf /var/tmp/spark.log
cd $TRAVIS_BUILD_DIR/examples/pxScene2d/src/spark.app/Contents/MacOS
./spark.sh -enableVideo=false $TESTRUNNERURL?tests=$TESTS &
Expand Down Expand Up @@ -155,6 +162,7 @@ fi
echo "Sleeping to make terminate complete ...";
sleep 90s
pkill -9 -f spark.sh
pkill -9 -f Spark

cp /var/tmp/spark.log $EXECLOGS
if [ "$dumped_core" -eq 1 ]
Expand Down
10 changes: 8 additions & 2 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ then
sh "unittests_$TRAVIS_OS_NAME.sh"
checkError $? "#### Build/unittests/execution [unittests_$TRAVIS_OS_NAME.sh] failed" "Either build problem/execution problem" "Analyze corresponding log file"

sh "execute_$TRAVIS_OS_NAME.sh"
checkError $? "#### Build/unittests/execution [execute_$TRAVIS_OS_NAME.sh] failed" "Either build problem/execution problem" "Analyze corresponding log file"
if [ "$TRAVIS_OS_NAME" = "osx" ]
then
sh "execute_$TRAVIS_OS_NAME.sh" "jsc"
checkError $? "#### Build/unittests/execution jsc platform [execute_$TRAVIS_OS_NAME.sh] failed" "Either build problem/execution problem" "Analyze corresponding log file"
fi

sh "execute_$TRAVIS_OS_NAME.sh" "node"
checkError $? "#### Build/unittests/execution node platform [execute_$TRAVIS_OS_NAME.sh] failed" "Either build problem/execution problem" "Analyze corresponding log file"

sh "code_coverage_$TRAVIS_OS_NAME.sh"
checkError $? "#### Build/unittests/execution [code_coverage_$TRAVIS_OS_NAME.sh] failed" "Either build problem/execution problem" "Analyze corresponding log file"

Expand Down
4 changes: 2 additions & 2 deletions examples/pxScene2d/src/pxResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,15 @@ void rtImageResource::textureReady()
int32_t rtImageResource::w() const
{
//rtLogDebug("tImageResource::w()\n");
if(mTexture.getPtr())
if(!downloadInProgress() && mTexture.getPtr())
return mTexture->width();
else
return 0;
}
rtError rtImageResource::w(int32_t& v) const
{
//rtLogDebug("tImageResource::w(int32_t)\n");
if(mTexture.getPtr())
if(!downloadInProgress() && mTexture.getPtr())
v = mTexture->width();
else
v = 0;
Expand Down
15 changes: 12 additions & 3 deletions examples/pxScene2d/src/rcvrcore/initGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,18 @@ function onSceneTerminate() {
// memory leak fix
this.sandbox.sparkscene.api = null;

for (var k in this.sandbox)
{
delete this.sandbox[k];
if (isJSC) {
var script = new vm.Script(
"for (var key in this) { delete this[key]; }"
);
script.runInContext(this.sandbox);
script = null;
}
else {
for (var k in this.sandbox)
{
delete this.sandbox[k];
}
}

this.contextifiedSandbox = null;
Expand Down
2 changes: 1 addition & 1 deletion src/rtScriptJSC/rtJSCBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static JSValueRef requireCallback(JSContextRef ctx, JSObjectRef, JSObjectRef thi
return moduleObj;
}

rtLogInfo("Loading %s", path.cString());
rtLogDebug("Loading %s", path.cString());
std::string codeStr = readFile(path.cString());
if (codeStr.empty()) {
JSStringRelease(reqArgStr);
Expand Down
13 changes: 9 additions & 4 deletions src/rtScriptJSC/rtJSCWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ static bool rtObjectWrapper_setProperty(JSContextRef context, JSObjectRef thisOb
}

rtValue val;
rtString name = jsToRtString(propertyName);
if (jsToRt(context, value, val, exception) != RT_OK) {
printException(context, *exception);
return false;
}

rtString name = jsToRtString(propertyName);
rtError e = objectRef.set(name, val);
if (e != RT_OK) {
rtLogDebug("Failed to set property: %s", name.cString());
Expand Down Expand Up @@ -351,7 +351,6 @@ static bool rtObjectWrapper_hasProperty(JSContextRef ctx, JSObjectRef object, JS
{
rtMethodMap* objMap = objectRef->getMap();
const char* className = objMap ? objMap->className : "<unknown>";
printf("rtObjectWrapper_hasProperty class=%s prop=%s\n", className, propName.cString());
}

if ( !strcmp(propName.cString(), "Symbol.iterator") ||
Expand Down Expand Up @@ -973,6 +972,11 @@ rtError JSObjectWrapper::Get(uint32_t i, rtValue* value) const
return RT_ERROR_INVALID_ARG;
JSValueRef exc = nullptr;
JSValueRef valueRef = JSObjectGetPropertyAtIndex(context(), wrapped(), i, &exc);

if (JSValueGetType(context(), valueRef) == kJSTypeUndefined)
{
return RT_PROPERTY_NOT_FOUND;
}
if (exc) {
printException(context(), exc);
return RT_FAIL;
Expand All @@ -993,7 +997,8 @@ rtError JSObjectWrapper::Set(const char* name, const rtValue* value)
return RT_FAIL;
}
if (!name || !value)
return RT_FAIL;
return RT_ERROR_INVALID_ARG;

if (m_isArray)
return RT_PROP_NOT_FOUND;
JSValueRef valueRef = rtToJs(context(), *value);
Expand All @@ -1012,7 +1017,7 @@ rtError JSObjectWrapper::Set(uint32_t i, const rtValue* value)
{
RtJSC::assertIsMainThread();
if (!value)
return RT_FAIL;
return RT_ERROR_INVALID_ARG;
JSValueRef valueRef = rtToJs(context(), *value);
JSValueRef exc = nullptr;
JSObjectSetPropertyAtIndex(context(), wrapped(), i, valueRef, &exc);
Expand Down
14 changes: 9 additions & 5 deletions src/rtScriptJSC/rtScriptJSC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class rtJSCContext: public RefCounted<rtIScriptContext>

rtJSCContext::rtJSCContext()
{
rtLogInfo("%s", __FUNCTION__);
rtLogInfo("%s %p\n", __FUNCTION__, this);
m_contextGroup = JSContextGroupRetain(globalContextGroup());
m_context = JSGlobalContextCreateInGroup(m_contextGroup, nullptr);
m_priv = rtJSCContextPrivate::create(m_context);
Expand All @@ -294,11 +294,16 @@ rtJSCContext::rtJSCContext()

rtJSCContext::~rtJSCContext()
{
rtLogInfo("%s begin", __FUNCTION__);
rtLogInfo("%s %p begin", __FUNCTION__, this);

if (gTopLevelContext == m_context)
{
if (gTopLevelContext != nullptr) {
JSSynchronousGarbageCollectForDebugging(gTopLevelContext);
}
gTopLevelContext = nullptr;

}

// RtJSC::dispatchOnMainLoop([m_priv=m_priv,m_context=m_context,m_contextGroup=m_contextGroup] {
// static JSStringRef codeStr = JSStringCreateWithUTF8CString("console.clear(); delete global.console");
// JSEvaluateScript(m_context, codeStr, nullptr, nullptr, 0, nullptr);
Expand Down Expand Up @@ -476,8 +481,7 @@ rtError rtScriptJSC::pump()
rtError rtScriptJSC::collectGarbage()
{
if (gTopLevelContext) {
JSGarbageCollect(gTopLevelContext);
// JSSynchronousGarbageCollectForDebugging(gTopLevelContext);
JSSynchronousGarbageCollectForDebugging(gTopLevelContext);
}
return RT_OK;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/pxScene2d/pxscene2dtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export SPARK_PERMISSIONS_ENABLED=true
ln -s ../../examples/pxScene2d/src/shell.js shell.js
ln -s ../../examples/pxScene2d/src/init.js init.js
ln -s ../../examples/pxScene2d/src/node_modules/ node_modules
ln -s ../../examples/pxScene2d/src/jsc_modules/ jsc_modules
ln -s ../../examples/pxScene2d/src/v8_modules/ v8_modules
ln -s ../../examples/pxScene2d/src/rcvrcore/ rcvrcore
ln -s ../../examples/pxScene2d/src/FreeSans.ttf FreeSans.ttf
ln -s ../../examples/pxScene2d/src/package.json package.json
Expand All @@ -66,6 +68,8 @@ ${DBG} ./pxscene2dtests "$@"
rm -rf shell.js
rm -rf init.js
rm -rf node_modules
rm -rf jsc_modules
rm -rf v8_modules
rm -rf rcvrcore
rm -rf FreeSans.ttf
rm -rf package.json
Expand Down
1 change: 1 addition & 0 deletions tests/pxScene2d/test_memoryleak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class pxSceneContainerLeakTest : public testing::Test
sceneContainer->AddRef();
sceneContainer->remove();
script.collectGarbage();
process();
EXPECT_TRUE (sceneptr->isObjectTracked(sceneContainer) == false);
sceneContainer->Release();
}
Expand Down
6 changes: 5 additions & 1 deletion tests/pxScene2d/test_rtnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST(pxScene2dTests, rtNodeTests)
{
// Create rtNode
extern rtScript script;

if (script.engine().compare("node/v8") == 0) {
//v8::Isolate *isolate = script.getIsolate();

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -210,4 +210,8 @@ TEST(pxScene2dTests, rtNodeTests)
EXPECT_TRUE((t2 < (t1 / 4)) == true);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
else {
EXPECT_TRUE(true);
}
}