This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add chakrashim and enable node.js on chakra
"chakrashim" provides an implementation of the essential V8 APIs on top of the public API for Microsoft's Chakra JavaScript engine known as JSRT. Use a build switch "chakra" to build node with chakrashim. Add Visual Studio 2015 and ARM build support on Windows.
- Loading branch information
Jianchun Xu
committed
Jun 29, 2015
1 parent
a6bc75d
commit 47000c7
Showing
61 changed files
with
11,691 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# chakrashim project contributors | ||
|
||
Curtis Man <[email protected]> | ||
Jianchun Xu <[email protected]> | ||
Nadav Bar <[email protected]> | ||
Paul Vick <[email protected]> | ||
Saar Yahalom <[email protected]> | ||
Sandeep Agarwal <[email protected]> | ||
Munyiri Kamau <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright Microsoft. All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to | ||
deal in the Software without restriction, including without limitation the | ||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
sell copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
{ | ||
'variables': { | ||
'library_files': [ | ||
'lib/chakra_shim.js', | ||
], | ||
}, | ||
'targets': [{ | ||
'target_name': 'chakrashim', | ||
'type': '<(library)', | ||
|
||
'dependencies': [ | ||
'chakra_js2c#host', | ||
], | ||
|
||
'include_dirs': [ | ||
'include', | ||
'<(SHARED_INTERMEDIATE_DIR)' | ||
], | ||
'defines': [ | ||
'USE_EDGEMODE_JSRT=1', | ||
], | ||
'conditions': [ | ||
[ 'target_arch=="ia32"', { 'defines': [ '__i386__=1' ] } ], | ||
[ 'target_arch=="x64"', { 'defines': [ '__x86_64__=1' ] } ], | ||
[ 'target_arch=="arm"', { 'defines': [ '__arm__=1' ] } ], | ||
], | ||
'direct_dependent_settings': { | ||
'include_dirs': [ | ||
'include', | ||
], | ||
'defines': [ | ||
'USE_CHAKRA=1', | ||
'USE_EDGEMODE_JSRT=1', | ||
'_WIN32_WINNT=0x0601', | ||
], | ||
'libraries': [ | ||
'-lchakrart.lib', | ||
'-lole32.lib', | ||
], | ||
'conditions': [ | ||
[ 'target_arch!="arm"', { | ||
'libraries': [ '-lversion.lib' ] | ||
}, { | ||
'libraries!': [ '-lpsapi.lib' ], | ||
'libraries': [ '-lonecore.lib' ], | ||
'defines': [ '__arm__=1' ] | ||
}], | ||
], | ||
}, | ||
'sources': [ | ||
'include/v8.h', | ||
'include/v8-debug.h', | ||
'include/v8-profiler.h', | ||
'include/v8chakra.h', | ||
'include/jsrtutils.h', | ||
'include/jsrtproxyutils.h', | ||
'src/jsrtcachedpropertyidref.h', | ||
'src/jsrtcontextshim.h', | ||
'src/jsrtcontextshim.cc', | ||
'src/jsrtcrosscontext.h', | ||
'src/jsrtcrosscontext.cc', | ||
'src/jsrtisolateshim.cc', | ||
'src/jsrtisolateshim.h', | ||
'src/jsrtpromise.cc', | ||
'src/jsrtproxyutils.cc', | ||
'src/jsrtstringutils.h', | ||
'src/jsrtstringutils.cc', | ||
'src/jsrtutils.cc', | ||
'src/v8array.cc', | ||
'src/v8boolean.cc', | ||
'src/v8booleanobject.cc', | ||
'src/v8context.cc', | ||
'src/v8date.cc', | ||
'src/v8debug.cc', | ||
'src/v8exception.cc', | ||
'src/v8function.cc', | ||
'src/v8functiontemplate.cc', | ||
'src/v8global.cc', | ||
'src/v8handlescope.cc', | ||
'src/v8int32.cc', | ||
'src/v8integer.cc', | ||
'src/v8isolate.cc', | ||
'src/v8message.cc', | ||
'src/v8number.cc', | ||
'src/v8numberobject.cc', | ||
'src/v8object.cc', | ||
'src/v8objecttemplate.cc', | ||
'src/v8persistent.cc', | ||
'src/v8returnvalue.cc', | ||
'src/v8script.cc', | ||
'src/v8signature.cc', | ||
'src/v8string.cc', | ||
'src/v8stringobject.cc', | ||
'src/v8template.cc', | ||
'src/v8trycatch.cc', | ||
'src/v8uint32.cc', | ||
'src/v8value.cc', | ||
'src/v8v8.cc', | ||
'src/v8external.cc', | ||
], | ||
}, # end chakrashim | ||
{ | ||
'target_name': 'chakra_js2c', | ||
'type': 'none', | ||
'toolsets': ['host'], | ||
'actions': [ | ||
{ | ||
'action_name': 'chakra_js2c', | ||
'inputs': [ | ||
'<@(library_files)' | ||
], | ||
'outputs': [ | ||
'<(SHARED_INTERMEDIATE_DIR)/chakra_natives.h', | ||
], | ||
'action': [ | ||
'<(python)', | ||
'./../../tools/js2c.py', | ||
'-chakra', | ||
'<@(_outputs)', | ||
'<@(_inputs)', | ||
], | ||
}, | ||
], | ||
}, # end chakra_js2c | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright Microsoft. All rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files(the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and / or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions : | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
// IN THE SOFTWARE. | ||
|
||
#pragma once | ||
|
||
#include "jsrt.h" | ||
#include "jsrtutils.h" | ||
#include <map> | ||
|
||
namespace jsrt | ||
{ | ||
// Proxy Traps types, please see: | ||
// http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies | ||
// for more details regarding harmony proxies | ||
enum ProxyTraps | ||
{ | ||
ApplyTrap, | ||
ConstructTrap, | ||
DefinePropertyTrap, | ||
DeletePropertyTrap, | ||
EnumerateTrap, | ||
GetTrap, | ||
GetOwnPropertyDescriptorTrap, | ||
GetPrototypeOfTrap, | ||
HasTrap, | ||
IsExtensibleTrap, | ||
OwnKeysTrap, | ||
PreventExtensionsTrap, | ||
SetTrap, | ||
SetPrototypeOfTrap, | ||
TrapCount | ||
}; | ||
|
||
enum CachedPropertyIdRef; | ||
CachedPropertyIdRef GetProxyTrapCachedPropertyIdRef(ProxyTraps trap); | ||
|
||
JsErrorCode CreateProxy( | ||
_In_ JsValueRef target, | ||
_In_ const std::map<ProxyTraps, JsNativeFunction>& conf, | ||
_Out_ JsValueRef *result | ||
); | ||
|
||
JsErrorCode TryParseUInt32( | ||
_In_ JsValueRef strRef, | ||
_Out_ bool* isUInt32, | ||
_Out_ unsigned int *uint32Value); | ||
} |
Oops, something went wrong.