Refinement of project structure.

- components renaming and moving:
   - liballocator -> mem;
   - libcoreint -> vm;
   - libecmaobjects -> ecma/base;
   - libecmaoperations -> ecma/operations;
   - libecmabuiltins -> ecma/builtins;
   - libjsparser -> parser/js;
   - libintstructs -> parser/collections;
   - liboptimizer -> parser/js;
   - libperipherals -> ../plugins/lib_device_stm;
   - libruntime -> jrt;
 - generated.h now is created as intermediate during build;
 - benchmarks -> tests/benchmarks;
 - docs -> documentation;
 - demo-applications removed (loop_demo.js -> tests/blinky.js).
This commit is contained in:
Ruben Ayrapetyan
2015-02-10 14:45:40 +03:00
parent c104a58008
commit 718bbe26f9
221 changed files with 317 additions and 3188 deletions
+36
View File
@@ -0,0 +1,36 @@
// Copyright 2014 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var x = 7;
var y = 3;
var count = 1000000;
function cse_opt(x, y)
{
var tmp1 = x * x;
var tmp2 = y * y;
var tmp3 = tmp1 * tmp1;
var tmp4 = tmp2 * tmp2;
for (var i = 0; i < count; i++) {
var cached1 = tmp3 * x
var cached2 = tmp4 * y;
var cached_n_cached = cached1 + cached2;
var ret_val = cached_n_cached + cached_n_cached;
}
return ret_val + ret_val;
};
cse_opt(x, y);
@@ -12,31 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
function assertTrue (what) {
if (what !== true)
exit (1);
}
var count = 10000000;
var x = 7;
var y = 3;
function assertFalse (what) {
if (what !== false)
exit (1);
}
var tmp1;
var tmp2;
var tmp3;
var tmp4;
function assertNull (what) {
if (what !== null)
exit (1);
}
function assertNotNull (what) {
if (what === null)
exit (1);
}
function assertEquals (arg1, arg2) {
if (arg1 !== arg2)
exit (1);
}
function assertUnreachable () {
exit (1);
for (var i = 0; i < count; i++)
{
tmp1 = x * x;
tmp2 = y * y;
tmp3 = tmp1 * tmp1;
tmp4 = tmp2 * tmp2;
}
@@ -0,0 +1,30 @@
// Copyright 2014 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var count = 1000000;
var x = 7;
var y = 3;
var tmp1;
var tmp2;
var tmp3;
var tmp4;
for (var i = 0; i < count; i++)
{
tmp1 = x * x;
tmp2 = y * y;
tmp3 = tmp1 * tmp1;
tmp4 = tmp2 * tmp2;
}
+69
View File
@@ -0,0 +1,69 @@
// Copyright 2015 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var led_green = 0;
var led_orange = 1;
var led_red = 2;
var led_blue = 3;
var leds = new Array (led_green, led_orange, led_red, led_blue);
var waitDivisors = new Array (1, 2, 3, 6);
var waitTime = 60;
var numOfIterations = 10;
while (1)
{
for (var j = 0; j < numOfIterations; j += 1)
{
for (var led = 0; led < leds.length; led++)
{
LEDOn (leds [led]);
}
wait (waitTime * 2);
for (var led = 0; led < leds.length; led++)
{
LEDOff (leds [led]);
}
wait (waitTime * 2);
}
for (var j = 0; j < numOfIterations; j += 1)
{
for (var led = 0; led < leds.length; led++)
{
LEDOn (leds [led]);
wait (waitTime);
LEDOff (leds [led]);
wait (waitTime);
}
}
for (var d = 0; d < waitDivisors.length; d++)
{
var divisor = waitDivisors [d];
for (var j = 0; j < numOfIterations; j += 1)
{
for (var led = 0; led < leds.length; led++)
{
LEDOn (leds [led]);
wait (waitTime / divisor);
LEDOff (leds [led]);
}
}
}
}
+1 -1
View File
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "globals.h"
#include "jrt.h"
#include "mem-allocator.h"
extern "C"
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright 2014 Samsung Electronics Co., Ltd.
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
#include "ecma-globals.h"
#include "ecma-helpers.h"
#include "globals.h"
#include "jrt.h"
#include "jerry-libc.h"
#include <math.h>
+1 -1
View File
@@ -15,7 +15,7 @@
#define JERRY_MEM_POOL_INTERNAL
#include "globals.h"
#include "jrt.h"
#include "mem-allocator.h"
#include "mem-pool.h"
#include "mem-poolman.h"
+1 -1
View File
@@ -19,7 +19,7 @@
#define JERRY_MEM_POOL_INTERNAL
#include "globals.h"
#include "jrt.h"
#include "jerry-libc.h"
#include "mem-allocator.h"
#include "mem-pool.h"
+1 -1
View File
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "globals.h"
#include "jrt.h"
#include "mem-allocator.h"
#include "opcodes.h"
#include "deserializer.h"
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright 2014 Samsung Electronics Co., Ltd.
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
#include "ecma-globals.h"
#include "ecma-helpers.h"
#include "globals.h"
#include "jrt.h"
#include "jerry-libc.h"
#include <math.h>