Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

New Runtime Features #145

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 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
23 changes: 7 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ before_script:
script: RUNTIME_BUILD=release scons
after_success: gzip disk/boot/runtime
deploy:
- provider: releases
skip_cleanup: true
api_key:
secure: P+Ei+zxl/jN4Mt+sIm0jfikU0F81yQJEDQgLharThnblm8SILYLZ4jo+vSC7YA5u75wjj6ej3Guxk/Nm0Ajg4C9K7BLVZViZzrRhT8VdxZ8680EOn0A7/abHKA8AT+By8n4sOMhGgbsOLUUHQC+Bo7KLA2S2NGLgHJCKuEatPjg=
file: disk/boot/runtime.gz
on:
tags: true
repo: runtimejs/runtime
- provider: npm
skip_cleanup: true
email: [email protected]
api_key:
secure: Prcon+FjPLo1nh6hdJ1byLAUTMU/vfq3fBLzkxQIyJTVKIeKg9mPVtNoCmvbgxsSVTdS+gPjIoMpt0LgZCUq/cDRJAtOIaAqbm+fVNJBTwgkgwYAG7hCjEprAhUYiqutT+7KhgNZSKUBNJo/w5sWl8xdsSbfHyldGP6XBcocL50=
on:
tags: true
repo: runtimejs/runtime
provider: releases
api_key:
secure: NInTm2I0c/OdzQ4ev3ZK1Z1zmg+VZ/YCdj2UD+aGTz+5IkspwQNuimNZQJSY8T05snDqxOXk/OWKPGOxgRNDKITrGAbxnSG996P1uWg/98btAvmwuSocXOe3OBlsGO+LXOcqK70v4YGF5DPr2bPXqxQLsEA9CiOKHPJ8OEZT/osF7OWpipypapZj4iIsHB3/TR5rrqBJCJivaxGd3MdVP1XTSMOl2k34EFuZgcV+hJm9gY26+oxIPhwkIUhaRUchuke0QgqUnWyiX1yAItJP7RsV0QSM8wVluwNFn1WPAPzI76gIL7wHR7u+7gums8h/XvBHddhatNUzQFcrsKv0o2+6hFPGoarFA9mGwXMFdqdv91iiKt5aqlbbomwnpCuftmcTdPdvmbPkSbkTIAJTYJKxflrAzAreYIJAr2qzqWDkEd4GdH80RKh2HHXO++AS88kTDHAkXw7CA5ZOOndFsa5isxqnnEtBo3Isf8MvlVWwQ4/AqyxWWtm18N8WSu92unMKT2KQ4GkaBmkbH0o664qxiRH1gBw9DedZbLqNqbU15e90HrvR7Xyk3mg5rFdZr/tnHrT1CzLI0i0imTGxC27acUFFaJ4dRaOYNDJ8Z0FM2c4U4Nvv17JxhtaN8zkwDwy2oLGxLoGaSwNLqWgd/U7oxq12fRiEzYmPi6oL0Eo=
file: disk/boot/runtime.gz
skip_cleanup: true
on:
repo: Ross-Computers/runtime
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want your changes to be merged mainstream instead of create your own fork, you should left the repo references as they were before.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# runtime.js

[![Build Status](https://travis-ci.org/runtimejs/runtime.svg?branch=master)](https://travis-ci.org/runtimejs/runtime) [![npm](https://img.shields.io/npm/v/runtimejs.svg)](https://www.npmjs.com/package/runtimejs) [![Gem](https://img.shields.io/badge/freenode-%23runtimejs-blue.svg)](https://freenode.net/) [![Travis](https://img.shields.io/badge/GITTER-JOIN_CHAT_%E2%86%92-1dce73.svg)](https://gitter.im/runtimejs/runtime)
[![Build Status](https://travis-ci.org/Ross-Computers/runtime.svg?branch=master)](https://travis-ci.org/Ross-Computers/runtime) [![npm](https://img.shields.io/npm/v/runtimejs.svg)](https://www.npmjs.com/package/runtimejs) [![Gem](https://img.shields.io/badge/freenode-%23runtimejs-blue.svg)](https://freenode.net/) [![Travis](https://img.shields.io/badge/GITTER-JOIN_CHAT_%E2%86%92-1dce73.svg)](https://gitter.im/runtimejs/runtime)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.


__runtime.js__ is an open-source library operating system (unikernel) for the cloud that runs JavaScript, can be bundled up with an application and deployed as a lightweight and immutable VM image.

Expand Down
77 changes: 58 additions & 19 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@ import os
import sys
import datetime

arch = os.getenv('ARCH', "x64")
bits = os.getenv('BITS', "64")
arch_alt = os.getenv('ALT_ARCH', "x86_64")

SetOption('num_jobs', 4)

build = os.getenv('RUNTIME_BUILD', "debug")
print 'Build', build
print 'Arch',arch
print 'CPU Bits',bits

config = {
"project_name": "out/runtimejs",
"binary_output_file": "disk/boot/runtime",
"toolchain_bin_path": "",
"fasm_pathname": "fasm",
"link_script": "etc/kernel.ld",
"name_gxx": "x86_64-elf-g++",
"name_gcc": "x86_64-elf-gcc",
"name_as": "x86_64-elf-as",
"name_ld": "x86_64-elf-gcc",
"name_ar": "x86_64-elf-ar",
"name_ranlib": "x86_64-elf-ranlib",
"name_objcopy": "x86_64-elf-objcopy",
"name_gxx": arch_alt+"-elf-g++",
"name_gcc": arch_alt+"-elf-gcc",
"name_as": arch_alt+"-elf-as",
"name_ld": arch_alt+"-elf-gcc",
"name_ar": arch_alt+"-elf-ar",
"name_ranlib": arch_alt+"-elf-ranlib",
"name_objcopy": arch_alt+"-elf-objcopy",
"flags_common": {
"shared": set([
'-m64',
'-m'+bits,
'-ffreestanding',
'-nostdlib',
'-mno-red-zone',
Expand All @@ -38,7 +44,12 @@ config = {
'-Wno-unused-parameter',
'-fdiagnostics-color',
'-D__runtime_js__',
'-DRUNTIMEJS_PLATFORM_X64',
'-DRT_INC_ADDR_SPACE=\<kernel/arch/'+arch+'/address-space-'+arch+'.h\>',
'-DRT_INC_CPU=\<kernel/arch/'+arch+'/cpu-'+arch+'.h\>',
'-DRT_INC_IO=\<kernel/arch/'+arch+'/io-'+arch+'.h\>',
'-DRT_INC_IRQ=\<kernel/arch/'+arch+'/irqs-'+arch+'.h\>',
'-DRT_INC_PLATFORM=\<kernel/arch/'+arch+'/platform-'+arch+'.h\>',
'-DRUNTIMEJS_PLATFORM_X'+bits,
]),
"release": set([
]),
Expand All @@ -55,8 +66,8 @@ config = {
'-U__STRICT_ANSI__',
'-DENABLE_DEBUGGER_SUPPORT',
'-DENABLE_DISASSEMBLER',
'-DV8_HOST_ARCH_X64',
'-DV8_TARGET_ARCH_X64',
'-DV8_HOST_ARCH_X'+bits,
'-DV8_TARGET_ARCH_X'+bits,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X64 is the arch name, not an indicator of the number of bits.

# '-DV8_DEPRECATION_WARNINGS',
# '-DV8_IMMINENT_DEPRECATION_WARNINGS',
# '-DVERIFY_HEAP',
Expand Down Expand Up @@ -85,32 +96,52 @@ config = {
},
"flags_link": set([
'-nostdlib',
'-nodefaultlibs',
# '-Map etc/map.txt',
'-nodefaultlibs'
]),
"locations": {
"cc": [
'src',
'src/arch',
'src/kernel',
'src/kernel/x64',
'src/kernel/arch',
'src/kernel/arch/'+arch,
'src/kernel/boot',
'src/kernel/sys',
'src/kernel/sys/fs',
'src/kernel/sys/hw',
'src/kernel/sys/io',
'src/kernel/sys/memory',
'src/kernel/sys/thread',
'src/kernel/sys/v8',
'src/kernel/utils',
'src/kernel/profiler',
'src/common',
'test/cc',
],
"asm": [
'src',
'src/kernel/x64',
'src/kernel/arch',
'src/kernel/arch/'+arch,
'src/kernel/boot',
'src/kernel/sys',
'src/kernel/sys/fs',
'src/kernel/sys/hw',
'src/kernel/sys/io',
'src/kernel/sys/memory',
'src/kernel/sys/thread',
'src/kernel/sys/v8',
'src/kernel/utils',
'src/'+arch
],
"js": [
'src/kernel/Js',
'src/kernel/js',
],
},
"includes": [
'deps/musl/src/internal',
'deps/musl/include',
'deps/musl/arch/x86_64',
'deps/musl/arch/x86_64/bits',
'deps/musl/arch/'+arch_alt,
'deps/musl/arch/'+arch_alt+'/bits',
'deps/libcxx/include',
'deps/v8/include',
'deps/v8',
Expand All @@ -120,6 +151,8 @@ config = {
'deps/miniz',
'deps/libsodium/src/libsodium/include',
'deps/json11',
'src/Includes',
'src/Includes/kernel',
'src',
'test',
],
Expand Down Expand Up @@ -178,6 +211,9 @@ def EnvironmentCreate(build):
AR = ar,
AS = _as,
RANLIB = ranlib,
ARCH = arch,
ALT_ARCH = arch_alt,
BITS = bits,
CXXFLAGS = " ".join(flags_gxx),
CFLAGS = " ".join(flags_gcc),
LINK = ld,
Expand All @@ -186,7 +222,7 @@ def EnvironmentCreate(build):
LINKCOMSTR = 'Link $TARGET',
RANLIBCOMSTR = 'Index $TARGET',
ARCOMSTR = 'Archive $TARGET',
ENV = {'PATH': os.environ['PATH']},
ENV = {'PATH': os.environ['PATH'],'ARCH': arch,'ALT_ARCH':arch_alt,'BITS':bits},
)

env.Append(
Expand Down Expand Up @@ -216,6 +252,9 @@ def BuildProject(env_base):
env.Replace(CPPPATH = config["includes"])
env.Replace(LIBS = config["libs"])
env.Replace(LIBPATH = ['deps'])
env.Replace(ARCH = arch)
env.Replace(ALT_ARCH = arch_alt)
env.Replace(BITS = bits)

version_header = env.Command('src/kernel/version-autogenerated.h', 'package.json',
'node scripts/update-versions.js')
Expand Down
87 changes: 47 additions & 40 deletions deps/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import os
Import('env_base')

ARCH = os.getenv('ARCH', "x64")
ALT_ARCH = os.getenv('ALT_ARCH', "x86_64")
BITS = os.getenv('BITS', "64")

libs_config = {
"v8": {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/$ALT_ARCH',
'musl/arch/$ALT_ARCH/bits',
'libcxx/include',
'eastl/include',
'concurrentqueue',
Expand All @@ -17,6 +22,8 @@ libs_config = {
'v8/src',
'v8',
'../src',
'../src/Includes',
'../src/Includes/kernel'
],
"source": [
'v8/src/accessors.cc',
Expand Down Expand Up @@ -390,30 +397,30 @@ libs_config = {
'v8/src/wasm/wasm-opcodes.cc',
'v8/src/wasm/wasm-result.cc',
'v8/src/zone.cc',
'v8/src/crankshaft/x64/lithium-codegen-x64.cc',
'v8/src/crankshaft/x64/lithium-gap-resolver-x64.cc',
'v8/src/crankshaft/x64/lithium-x64.cc',
'v8/src/x64/assembler-x64.cc',
'v8/src/x64/builtins-x64.cc',
'v8/src/x64/code-stubs-x64.cc',
'v8/src/x64/codegen-x64.cc',
'v8/src/x64/cpu-x64.cc',
'v8/src/x64/deoptimizer-x64.cc',
'v8/src/x64/disasm-x64.cc',
'v8/src/x64/frames-x64.cc',
'v8/src/x64/interface-descriptors-x64.cc',
'v8/src/x64/macro-assembler-x64.cc',
'v8/src/debug/x64/debug-x64.cc',
'v8/src/full-codegen/x64/full-codegen-x64.cc',
'v8/src/ic/x64/access-compiler-x64.cc',
'v8/src/ic/x64/handler-compiler-x64.cc',
'v8/src/ic/x64/ic-x64.cc',
'v8/src/ic/x64/ic-compiler-x64.cc',
'v8/src/ic/x64/stub-cache-x64.cc',
'v8/src/regexp/x64/regexp-macro-assembler-x64.cc',
'v8/src/compiler/x64/code-generator-x64.cc',
'v8/src/compiler/x64/instruction-scheduler-x64.cc',
'v8/src/compiler/x64/instruction-selector-x64.cc',
'v8/src/crankshaft/'+ARCH+'/lithium-codegen-'+ARCH+'.cc',
'v8/src/crankshaft/'+ARCH+'/lithium-gap-resolver-'+ARCH+'.cc',
'v8/src/crankshaft/'+ARCH+'/lithium-'+ARCH+'.cc',
'v8/src/'+ARCH+'/assembler-'+ARCH+'.cc',
'v8/src/'+ARCH+'/builtins-'+ARCH+'.cc',
'v8/src/'+ARCH+'/code-stubs-'+ARCH+'.cc',
'v8/src/'+ARCH+'/codegen-'+ARCH+'.cc',
'v8/src/'+ARCH+'/cpu-'+ARCH+'.cc',
'v8/src/'+ARCH+'/deoptimizer-'+ARCH+'.cc',
'v8/src/'+ARCH+'/disasm-'+ARCH+'.cc',
'v8/src/'+ARCH+'/frames-'+ARCH+'.cc',
'v8/src/'+ARCH+'/interface-descriptors-'+ARCH+'.cc',
'v8/src/'+ARCH+'/macro-assembler-'+ARCH+'.cc',
'v8/src/debug/'+ARCH+'/debug-'+ARCH+'.cc',
'v8/src/full-codegen/'+ARCH+'/full-codegen-'+ARCH+'.cc',
'v8/src/ic/'+ARCH+'/access-compiler-'+ARCH+'.cc',
'v8/src/ic/'+ARCH+'/handler-compiler-'+ARCH+'.cc',
'v8/src/ic/'+ARCH+'/ic-'+ARCH+'.cc',
'v8/src/ic/'+ARCH+'/ic-compiler-'+ARCH+'.cc',
'v8/src/ic/'+ARCH+'/stub-cache-'+ARCH+'.cc',
'v8/src/regexp/'+ARCH+'/regexp-macro-assembler-'+ARCH+'.cc',
'v8/src/compiler/'+ARCH+'/code-generator-'+ARCH+'.cc',
'v8/src/compiler/'+ARCH+'/instruction-scheduler-'+ARCH+'.cc',
'v8/src/compiler/'+ARCH+'/instruction-selector-'+ARCH+'.cc',

'v8/src/base/accounting-allocator.cc',
'v8/src/base/atomicops_internals_x86_gcc.cc',
Expand Down Expand Up @@ -447,8 +454,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
'libcxx/include',
'../src',
],
Expand All @@ -472,8 +479,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
'acpica/source/include',
],
"source": [
Expand Down Expand Up @@ -1059,8 +1066,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
],
"source": [
'libcxxrt/src/typeinfo.cc',
Expand All @@ -1072,8 +1079,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
],
"source": [
'printf/printf.cc',
Expand All @@ -1083,8 +1090,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
],
"source": [
'miniz/tinfl.c',
Expand All @@ -1094,8 +1101,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
'libsodium/src/libsodium/include/sodium',
],
"source": [
Expand Down Expand Up @@ -1243,8 +1250,8 @@ libs_config = {
"include": [
'musl/src/internal',
'musl/include',
'musl/arch/x86_64',
'musl/arch/x86_64/bits',
'musl/arch/'+ALT_ARCH,
'musl/arch/'+ALT_ARCH+'/bits',
'libcxx/include',
'json11'
],
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/base/platform/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#endif

#if V8_OS_RUNTIMEJS
#include <kernel/threadlib/mutex.h>
#include <kernel/threadlib/condvar.h>
#include <threadlib/mutex.h>
#include <threadlib/condvar.h>
#endif

namespace v8 {
Expand Down
2 changes: 1 addition & 1 deletion etc/kernel.ld
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SECTIONS
}
.text 0x0000000000201000 :
{
src/startup.o (.text)
src/kernel/boot/startup.o (.text)
*(.text)
*(.gnu.linkonce.t*)
. = ALIGN(4096);
Expand Down
3 changes: 3 additions & 0 deletions js/__loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
inherits: './modules/inherits.js',
sys: 'util/util.js',
util: 'util/util.js',
tty: './modules/tty.js',
}, runtimePackagePath);

loader.require(`${runtimePackagePath}/index.js`);
Expand Down Expand Up @@ -300,6 +301,8 @@
process.stderr = new StderrStream();
process.termout = new TermoutStream();
process.termerr = new TermerrStream();
process.argv = process.execArgv = __SYSCALL.getCommandLine().split(" ");
process.title = process.argv0 = process.execPath = process.argv[0];
loader.require('console');
loader.require('/');
})();
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading