mirror of https://github.com/lukechilds/node.git
Browse Source
Upgrade to the latest branch-head for V8 4.5. For the full commit log see https://github.com/v8/v8-git-mirror/commits/4.5.103.24 PR-URL: https://github.com/nodejs/node/pull/2509 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>v4.x
committed by
Rod Vagg
1284 changed files with 88587 additions and 46662 deletions
@ -1,266 +0,0 @@ |
|||
# Copyright 2012 the V8 project authors. All rights reserved. |
|||
# Redistribution and use in source and binary forms, with or without |
|||
# modification, are permitted provided that the following conditions are |
|||
# met: |
|||
# |
|||
# * Redistributions of source code must retain the above copyright |
|||
# notice, this list of conditions and the following disclaimer. |
|||
# * Redistributions in binary form must reproduce the above |
|||
# copyright notice, this list of conditions and the following |
|||
# disclaimer in the documentation and/or other materials provided |
|||
# with the distribution. |
|||
# * Neither the name of Google Inc. nor the names of its |
|||
# contributors may be used to endorse or promote products derived |
|||
# from this software without specific prior written permission. |
|||
# |
|||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|||
|
|||
# Definitions for building standalone V8 binaries to run on Android. |
|||
# This is mostly excerpted from: |
|||
# http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi |
|||
|
|||
{ |
|||
'variables': { |
|||
# Location of Android NDK. |
|||
'variables': { |
|||
'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)', |
|||
'android_toolchain%': '<!(/bin/echo -n $ANDROID_TOOLCHAIN)', |
|||
}, |
|||
'conditions': [ |
|||
['android_ndk_root==""', { |
|||
'variables': { |
|||
'android_sysroot': '<(android_toolchain)/sysroot/', |
|||
'android_stlport': '<(android_toolchain)/sources/cxx-stl/stlport/', |
|||
}, |
|||
'android_include': '<(android_sysroot)/usr/include', |
|||
'conditions': [ |
|||
['target_arch=="x64"', { |
|||
'android_lib': '<(android_sysroot)/usr/lib64', |
|||
}, { |
|||
'android_lib': '<(android_sysroot)/usr/lib', |
|||
}], |
|||
], |
|||
'android_stlport_include': '<(android_stlport)/stlport', |
|||
'android_stlport_libs': '<(android_stlport)/libs', |
|||
}, { |
|||
'variables': { |
|||
'android_sysroot': '<(android_ndk_root)/platforms/android-<(android_target_platform)/arch-<(android_target_arch)', |
|||
'android_stlport': '<(android_ndk_root)/sources/cxx-stl/stlport/', |
|||
}, |
|||
'android_include': '<(android_sysroot)/usr/include', |
|||
'conditions': [ |
|||
['target_arch=="x64"', { |
|||
'android_lib': '<(android_sysroot)/usr/lib64', |
|||
}, { |
|||
'android_lib': '<(android_sysroot)/usr/lib', |
|||
}], |
|||
], |
|||
'android_stlport_include': '<(android_stlport)/stlport', |
|||
'android_stlport_libs': '<(android_stlport)/libs', |
|||
}], |
|||
], |
|||
'android_stlport_library': 'stlport_static', |
|||
}, # variables |
|||
'target_defaults': { |
|||
'defines': [ |
|||
'ANDROID', |
|||
'V8_ANDROID_LOG_STDOUT', |
|||
], |
|||
'configurations': { |
|||
'Release': { |
|||
'cflags': [ |
|||
'-fomit-frame-pointer', |
|||
], |
|||
}, # Release |
|||
}, # configurations |
|||
'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter'], |
|||
'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions', |
|||
# Note: Using -std=c++0x will define __STRICT_ANSI__, which |
|||
# in turn will leave out some template stuff for 'long |
|||
# long'. What we want is -std=c++11, but this is not |
|||
# supported by GCC 4.6 or Xcode 4.2 |
|||
'-std=gnu++0x' ], |
|||
'target_conditions': [ |
|||
['_toolset=="target"', { |
|||
'cflags!': [ |
|||
'-pthread', # Not supported by Android toolchain. |
|||
], |
|||
'cflags': [ |
|||
'-ffunction-sections', |
|||
'-funwind-tables', |
|||
'-fstack-protector', |
|||
'-fno-short-enums', |
|||
'-finline-limit=64', |
|||
'-Wa,--noexecstack', |
|||
# Note: This include is in cflags to ensure that it comes after |
|||
# all of the includes. |
|||
'-I<(android_include)', |
|||
'-I<(android_stlport_include)', |
|||
], |
|||
'cflags_cc': [ |
|||
'-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. |
|||
], |
|||
'defines': [ |
|||
'ANDROID', |
|||
#'__GNU_SOURCE=1', # Necessary for clone() |
|||
'USE_STLPORT=1', |
|||
'_STLP_USE_PTR_SPECIALIZATIONS=1', |
|||
'HAVE_OFF64_T', |
|||
'HAVE_SYS_UIO_H', |
|||
'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize. |
|||
], |
|||
'ldflags!': [ |
|||
'-pthread', # Not supported by Android toolchain. |
|||
], |
|||
'ldflags': [ |
|||
'-nostdlib', |
|||
'-Wl,--no-undefined', |
|||
'-Wl,-rpath-link=<(android_lib)', |
|||
'-L<(android_lib)', |
|||
], |
|||
'libraries!': [ |
|||
'-lrt', # librt is built into Bionic. |
|||
# Not supported by Android toolchain. |
|||
# Where do these come from? Can't find references in |
|||
# any Chromium gyp or gypi file. Maybe they come from |
|||
# gyp itself? |
|||
'-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4', '-lnspr4', |
|||
], |
|||
'libraries': [ |
|||
'-l<(android_stlport_library)', |
|||
# Manually link the libgcc.a that the cross compiler uses. |
|||
'<!($CC -print-libgcc-file-name)', |
|||
'-lc', |
|||
'-ldl', |
|||
'-lstdc++', |
|||
'-lm', |
|||
], |
|||
'conditions': [ |
|||
['target_arch == "arm"', { |
|||
'ldflags': [ |
|||
# Enable identical code folding to reduce size. |
|||
'-Wl,--icf=safe', |
|||
], |
|||
}], |
|||
['target_arch=="arm" and arm_version==7', { |
|||
'cflags': [ |
|||
'-march=armv7-a', |
|||
'-mtune=cortex-a8', |
|||
'-mfpu=vfp3', |
|||
], |
|||
'ldflags': [ |
|||
'-L<(android_stlport_libs)/armeabi-v7a', |
|||
], |
|||
}], |
|||
['target_arch=="arm" and arm_version < 7', { |
|||
'ldflags': [ |
|||
'-L<(android_stlport_libs)/armeabi', |
|||
], |
|||
}], |
|||
['target_arch=="x64"', { |
|||
'ldflags': [ |
|||
'-L<(android_stlport_libs)/x86_64', |
|||
], |
|||
}], |
|||
['target_arch=="arm64"', { |
|||
'ldflags': [ |
|||
'-L<(android_stlport_libs)/arm64-v8a', |
|||
], |
|||
}], |
|||
['target_arch=="ia32" or target_arch=="x87"', { |
|||
# The x86 toolchain currently has problems with stack-protector. |
|||
'cflags!': [ |
|||
'-fstack-protector', |
|||
], |
|||
'cflags': [ |
|||
'-fno-stack-protector', |
|||
], |
|||
'ldflags': [ |
|||
'-L<(android_stlport_libs)/x86', |
|||
], |
|||
}], |
|||
['target_arch=="mipsel"', { |
|||
# The mips toolchain currently has problems with stack-protector. |
|||
'cflags!': [ |
|||
'-fstack-protector', |
|||
'-U__linux__' |
|||
], |
|||
'cflags': [ |
|||
'-fno-stack-protector', |
|||
], |
|||
'ldflags': [ |
|||
'-L<(android_stlport_libs)/mips', |
|||
], |
|||
}], |
|||
['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64") and component!="shared_library"', { |
|||
'cflags': [ |
|||
'-fPIE', |
|||
], |
|||
'ldflags': [ |
|||
'-pie', |
|||
], |
|||
}], |
|||
], |
|||
'target_conditions': [ |
|||
['_type=="executable"', { |
|||
'conditions': [ |
|||
['target_arch=="arm64" or target_arch=="x64"', { |
|||
'ldflags': [ |
|||
'-Wl,-dynamic-linker,/system/bin/linker64', |
|||
], |
|||
}, { |
|||
'ldflags': [ |
|||
'-Wl,-dynamic-linker,/system/bin/linker', |
|||
], |
|||
}] |
|||
], |
|||
'ldflags': [ |
|||
'-Bdynamic', |
|||
'-Wl,-z,nocopyreloc', |
|||
# crtbegin_dynamic.o should be the last item in ldflags. |
|||
'<(android_lib)/crtbegin_dynamic.o', |
|||
], |
|||
'libraries': [ |
|||
# crtend_android.o needs to be the last item in libraries. |
|||
# Do not add any libraries after this! |
|||
'<(android_lib)/crtend_android.o', |
|||
], |
|||
}], |
|||
['_type=="shared_library"', { |
|||
'ldflags': [ |
|||
'-Wl,-shared,-Bsymbolic', |
|||
'<(android_lib)/crtbegin_so.o', |
|||
], |
|||
}], |
|||
['_type=="static_library"', { |
|||
'ldflags': [ |
|||
# Don't export symbols from statically linked libraries. |
|||
'-Wl,--exclude-libs=ALL', |
|||
], |
|||
}], |
|||
], |
|||
}], # _toolset=="target" |
|||
# Settings for building host targets using the system toolchain. |
|||
['_toolset=="host"', { |
|||
'cflags': [ '-pthread' ], |
|||
'ldflags': [ '-pthread' ], |
|||
'ldflags!': [ |
|||
'-Wl,-z,noexecstack', |
|||
'-Wl,--gc-sections', |
|||
'-Wl,-O1', |
|||
'-Wl,--as-needed', |
|||
], |
|||
}], |
|||
], # target_conditions |
|||
}, # target_defaults |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,3 @@ |
|||
machenbach@chromium.org |
|||
sergiyb@chromium.org |
|||
tandrii@chromium.org |
@ -0,0 +1 @@ |
|||
This directory contains infra-specific files. |
@ -0,0 +1,52 @@ |
|||
# See http://luci-config.appspot.com/schemas/projects/refs:cq.cfg for the |
|||
# documentation of this file format. |
|||
|
|||
version: 1 |
|||
cq_name: "v8" |
|||
cq_status_url: "https://chromium-cq-status.appspot.com" |
|||
hide_ref_in_committed_msg: true |
|||
commit_burst_delay: 60 |
|||
max_commit_burst: 1 |
|||
target_ref: "refs/pending/heads/master" |
|||
|
|||
rietveld { |
|||
url: "https://codereview.chromium.org" |
|||
} |
|||
|
|||
verifiers { |
|||
reviewer_lgtm { |
|||
committer_list: "v8" |
|||
} |
|||
|
|||
tree_status { |
|||
tree_status_url: "https://v8-status.appspot.com" |
|||
} |
|||
|
|||
try_job { |
|||
buckets { |
|||
name: "tryserver.v8" |
|||
builders { name: "v8_android_arm_compile_rel" } |
|||
builders { name: "v8_linux64_asan_rel" } |
|||
builders { name: "v8_linux64_avx2_rel" } |
|||
builders { name: "v8_linux64_rel" } |
|||
builders { name: "v8_linux_arm64_rel" } |
|||
builders { name: "v8_linux_arm_rel" } |
|||
builders { name: "v8_linux_chromium_gn_rel" } |
|||
builders { name: "v8_linux_dbg" } |
|||
builders { name: "v8_linux_gcc_compile_rel" } |
|||
builders { name: "v8_linux_mipsel_compile_rel" } |
|||
builders { name: "v8_linux_mips64el_compile_rel" } |
|||
builders { name: "v8_linux_nodcheck_rel" } |
|||
builders { name: "v8_linux_rel" } |
|||
builders { name: "v8_mac_rel" } |
|||
builders { name: "v8_presubmit" } |
|||
builders { name: "v8_win64_rel" } |
|||
builders { name: "v8_win_compile_dbg" } |
|||
builders { name: "v8_win_nosnap_shared_compile_rel" } |
|||
builders { name: "v8_win_rel" } |
|||
} |
|||
} |
|||
|
|||
sign_cla {} |
|||
} |
|||
|
@ -0,0 +1 @@ |
|||
This directory contains v8 project-wide configurations for infra services. |
@ -0,0 +1,23 @@ |
|||
# Defines buckets on cr-buildbucket.appspot.com, used to schedule builds |
|||
# on buildbot. In particular, CQ uses some of these buckets to schedule tryjobs. |
|||
# |
|||
# See http://luci-config.appspot.com/schemas/projects:buildbucket.cfg for |
|||
# schema of this file and documentation. |
|||
# |
|||
# Please keep this list sorted by bucket name. |
|||
|
|||
buckets { |
|||
name: "master.tryserver.v8" |
|||
acls { |
|||
role: READER |
|||
group: "all" |
|||
} |
|||
acls { |
|||
role: SCHEDULER |
|||
group: "service-account-cq" |
|||
} |
|||
acls { |
|||
role: WRITER |
|||
group: "service-account-v8-master" |
|||
} |
|||
} |
@ -0,0 +1,71 @@ |
|||
// Copyright 2015 the V8 project authors. All rights reserved.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
|||
// found in the LICENSE file.
|
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
|
|||
#include "include/libplatform/libplatform.h" |
|||
#include "include/v8.h" |
|||
|
|||
using namespace v8; |
|||
|
|||
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
|||
public: |
|||
virtual void* Allocate(size_t length) { |
|||
void* data = AllocateUninitialized(length); |
|||
return data == NULL ? data : memset(data, 0, length); |
|||
} |
|||
virtual void* AllocateUninitialized(size_t length) { return malloc(length); } |
|||
virtual void Free(void* data, size_t) { free(data); } |
|||
}; |
|||
|
|||
|
|||
int main(int argc, char* argv[]) { |
|||
// Initialize V8.
|
|||
V8::InitializeICU(); |
|||
Platform* platform = platform::CreateDefaultPlatform(); |
|||
V8::InitializePlatform(platform); |
|||
V8::Initialize(); |
|||
|
|||
// Create a new Isolate and make it the current one.
|
|||
ArrayBufferAllocator allocator; |
|||
Isolate::CreateParams create_params; |
|||
create_params.array_buffer_allocator = &allocator; |
|||
Isolate* isolate = Isolate::New(create_params); |
|||
{ |
|||
Isolate::Scope isolate_scope(isolate); |
|||
|
|||
// Create a stack-allocated handle scope.
|
|||
HandleScope handle_scope(isolate); |
|||
|
|||
// Create a new context.
|
|||
Local<Context> context = Context::New(isolate); |
|||
|
|||
// Enter the context for compiling and running the hello world script.
|
|||
Context::Scope context_scope(context); |
|||
|
|||
// Create a string containing the JavaScript source code.
|
|||
Local<String> source = |
|||
String::NewFromUtf8(isolate, "'Hello' + ', World!'", |
|||
NewStringType::kNormal).ToLocalChecked(); |
|||
|
|||
// Compile the source code.
|
|||
Local<Script> script = Script::Compile(context, source).ToLocalChecked(); |
|||
|
|||
// Run the script to get the result.
|
|||
Local<Value> result = script->Run(context).ToLocalChecked(); |
|||
|
|||
// Convert the result to an UTF8 string and print it.
|
|||
String::Utf8Value utf8(result); |
|||
printf("%s\n", *utf8); |
|||
} |
|||
|
|||
// Dispose the isolate and tear down V8.
|
|||
isolate->Dispose(); |
|||
V8::Dispose(); |
|||
V8::ShutdownPlatform(); |
|||
delete platform; |
|||
return 0; |
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue