Browse Source

deps: upgrade V8 to 4.5.103.30

Pick up f9a0a1636a
Commit log at https://chromium.googlesource.com/v8/v8.git/+log/branch-heads/4.5

PR-URL: https://github.com/nodejs/node/pull/2632
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
v4.x
Ali Ijaz Sheikh 9 years ago
committed by Rod Vagg
parent
commit
5424d6fcf0
  1. 4
      deps/v8/BUILD.gn
  2. 2
      deps/v8/include/v8-version.h
  3. 19
      deps/v8/include/v8.h
  4. 1
      deps/v8/samples/hello-world.cc
  5. 1
      deps/v8/samples/process.cc
  6. 1
      deps/v8/samples/shell.cc
  7. 13
      deps/v8/src/api.cc
  8. 3
      deps/v8/src/arm/assembler-arm.cc
  9. 3
      deps/v8/src/arm64/assembler-arm64.cc
  10. 3
      deps/v8/src/base/cpu.h
  11. 14
      deps/v8/src/d8.cc
  12. 2
      deps/v8/src/d8.gyp
  13. 13
      deps/v8/src/heap/heap.cc
  14. 4
      deps/v8/src/heap/heap.h
  15. 25
      deps/v8/src/heap/memory-reducer.cc
  16. 14
      deps/v8/src/preparser.h
  17. 110
      deps/v8/src/startup-data-util.cc
  18. 40
      deps/v8/src/startup-data-util.h
  19. 8
      deps/v8/test/cctest/cctest.cc
  20. 2
      deps/v8/test/cctest/cctest.gyp
  21. 61
      deps/v8/test/cctest/test-parsing.cc
  22. 8
      deps/v8/test/unittests/run-all-unittests.cc
  23. 2
      deps/v8/test/unittests/unittests.gyp
  24. 2
      deps/v8/tools/gyp/v8.gyp
  25. 2
      deps/v8/tools/parser-shell.cc

4
deps/v8/BUILD.gn

@ -1077,6 +1077,8 @@ source_set("v8_base") {
"src/splay-tree.h",
"src/splay-tree-inl.h",
"src/snapshot/snapshot.h",
"src/startup-data-util.h",
"src/startup-data-util.cc",
"src/string-builder.cc",
"src/string-builder.h",
"src/string-search.cc",
@ -1678,8 +1680,6 @@ if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") ||
sources = [
"src/d8.cc",
"src/d8.h",
"src/startup-data-util.h",
"src/startup-data-util.cc",
]
configs -= [ "//build/config/compiler:chromium_code" ]

2
deps/v8/include/v8-version.h

@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 103
#define V8_PATCH_LEVEL 24
#define V8_PATCH_LEVEL 30
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)

19
deps/v8/include/v8.h

@ -6247,6 +6247,25 @@ class V8_EXPORT V8 {
*/
static bool InitializeICU(const char* icu_data_file = NULL);
/**
* Initialize the external startup data. The embedder only needs to
* invoke this method when external startup data was enabled in a build.
*
* If V8 was compiled with the startup data in an external file, then
* V8 needs to be given those external files during startup. There are
* three ways to do this:
* - InitializeExternalStartupData(const char*)
* This will look in the given directory for files "natives_blob.bin"
* and "snapshot_blob.bin" - which is what the default build calls them.
* - InitializeExternalStartupData(const char*, const char*)
* As above, but will directly use the two given file names.
* - Call SetNativesDataBlob, SetNativesDataBlob.
* This will read the blobs from the given data structures and will
* not perform any file IO.
*/
static void InitializeExternalStartupData(const char* directory_path);
static void InitializeExternalStartupData(const char* natives_blob,
const char* snapshot_blob);
/**
* Sets the v8::Platform to use. This should be invoked before V8 is
* initialized.

1
deps/v8/samples/hello-world.cc

@ -25,6 +25,7 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
int main(int argc, char* argv[]) {
// Initialize V8.
V8::InitializeICU();
V8::InitializeExternalStartupData(argv[0]);
Platform* platform = platform::CreateDefaultPlatform();
V8::InitializePlatform(platform);
V8::Initialize();

1
deps/v8/samples/process.cc

@ -686,6 +686,7 @@ void PrintMap(map<string, string>* m) {
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
v8::V8::InitializeExternalStartupData(argv[0]);
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
v8::V8::Initialize();

1
deps/v8/samples/shell.cc

@ -75,6 +75,7 @@ class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
v8::V8::InitializeExternalStartupData(argv[0]);
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
v8::V8::Initialize();

13
deps/v8/src/api.cc

@ -49,6 +49,7 @@
#include "src/simulator.h"
#include "src/snapshot/natives.h"
#include "src/snapshot/snapshot.h"
#include "src/startup-data-util.h"
#include "src/unicode-inl.h"
#include "src/v8threads.h"
#include "src/version.h"
@ -5398,11 +5399,23 @@ HeapObjectStatistics::HeapObjectStatistics()
object_count_(0),
object_size_(0) {}
bool v8::V8::InitializeICU(const char* icu_data_file) {
return i::InitializeICU(icu_data_file);
}
void v8::V8::InitializeExternalStartupData(const char* directory_path) {
i::InitializeExternalStartupData(directory_path);
}
void v8::V8::InitializeExternalStartupData(const char* natives_blob,
const char* snapshot_blob) {
i::InitializeExternalStartupData(natives_blob, snapshot_blob);
}
const char* v8::V8::GetVersion() {
return i::Version::GetVersion();
}

3
deps/v8/src/arm/assembler-arm.cc

@ -128,7 +128,8 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
if (FLAG_enable_32dregs && cpu.has_vfp3_d32()) supported_ |= 1u << VFP32DREGS;
if (cpu.implementer() == base::CPU::NVIDIA &&
cpu.variant() == base::CPU::NVIDIA_DENVER) {
cpu.variant() == base::CPU::NVIDIA_DENVER &&
cpu.part() <= base::CPU::NVIDIA_DENVER_V10) {
supported_ |= 1u << COHERENT_CACHE;
}
#endif

3
deps/v8/src/arm64/assembler-arm64.cc

@ -53,7 +53,8 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
// Probe for runtime features
base::CPU cpu;
if (cpu.implementer() == base::CPU::NVIDIA &&
cpu.variant() == base::CPU::NVIDIA_DENVER) {
cpu.variant() == base::CPU::NVIDIA_DENVER &&
cpu.part() <= base::CPU::NVIDIA_DENVER_V10) {
supported_ |= 1u << COHERENT_CACHE;
}
}

3
deps/v8/src/base/cpu.h

@ -59,6 +59,9 @@ class CPU final {
static const int ARM_CORTEX_A12 = 0xc0c;
static const int ARM_CORTEX_A15 = 0xc0f;
// Denver-specific part code
static const int NVIDIA_DENVER_V10 = 0x002;
// PPC-specific part codes
enum {
PPC_POWER5,

14
deps/v8/src/d8.cc

@ -50,10 +50,6 @@
#include "src/v8.h"
#endif // !V8_SHARED
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
#include "src/startup-data-util.h"
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#if !defined(_WIN32) && !defined(_WIN64)
#include <unistd.h> // NOLINT
#else
@ -2316,10 +2312,12 @@ int Shell::Main(int argc, char* argv[]) {
g_platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(g_platform);
v8::V8::Initialize();
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
v8::StartupDataHandler startup_data(argv[0], options.natives_blob,
options.snapshot_blob);
#endif
if (options.natives_blob || options.snapshot_blob) {
v8::V8::InitializeExternalStartupData(options.natives_blob,
options.snapshot_blob);
} else {
v8::V8::InitializeExternalStartupData(argv[0]);
}
SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg");
SetFlagsFromString("--trace-turbo-cfg-file=turbo.cfg");
SetFlagsFromString("--redirect-code-traces-to=code.asm");

2
deps/v8/src/d8.gyp

@ -50,8 +50,6 @@
'sources': [
'd8.h',
'd8.cc',
'startup-data-util.h',
'startup-data-util.cc'
],
'conditions': [
[ 'want_separate_host_toolset==1', {

13
deps/v8/src/heap/heap.cc

@ -4867,19 +4867,6 @@ void Heap::ReduceNewSpaceSize() {
}
void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) {
if (FLAG_overapproximate_weak_closure &&
(incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(!incremental_marking()->weak_closure_was_overapproximated() &&
mark_compact_collector_.marking_deque()->IsEmpty()))) {
OverApproximateWeakClosure(comment);
} else if (incremental_marking()->IsComplete() ||
(mark_compact_collector_.marking_deque()->IsEmpty())) {
CollectAllGarbage(kNoGCFlags, comment);
}
}
bool Heap::TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects,
size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {

4
deps/v8/src/heap/heap.h

@ -852,8 +852,6 @@ class Heap {
intptr_t step_size_in_bytes, double deadline_in_ms,
IncrementalMarking::StepActions step_actions);
void FinalizeIncrementalMarkingIfComplete(const char* comment);
inline void increment_scan_on_scavenge_pages() {
scan_on_scavenge_pages_++;
if (FLAG_gc_verbose) {
@ -1644,8 +1642,6 @@ class Heap {
bool HasHighFragmentation();
bool HasHighFragmentation(intptr_t used, intptr_t committed);
bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; }
protected:
// Methods made available to tests.

25
deps/v8/src/heap/memory-reducer.cc

@ -44,35 +44,12 @@ void MemoryReducer::NotifyTimer(const Event& event) {
if (state_.action == kRun) {
DCHECK(heap()->incremental_marking()->IsStopped());
DCHECK(FLAG_incremental_marking);
heap()->StartIdleIncrementalMarking();
if (FLAG_trace_gc_verbose) {
PrintIsolate(heap()->isolate(), "Memory reducer: started GC #%d\n",
state_.started_gcs);
}
if (heap()->ShouldOptimizeForMemoryUsage()) {
// Do full GC if memory usage has higher priority than latency. This is
// important for background tabs that do not send idle notifications.
heap()->CollectAllGarbage(Heap::kReduceMemoryFootprintMask,
"memory reducer");
} else {
heap()->StartIdleIncrementalMarking();
}
} else if (state_.action == kWait) {
if (!heap()->incremental_marking()->IsStopped() &&
heap()->ShouldOptimizeForMemoryUsage()) {
// Make progress with pending incremental marking if memory usage has
// higher priority than latency. This is important for background tabs
// that do not send idle notifications.
const int kIncrementalMarkingDelayMs = 500;
double deadline = heap()->MonotonicallyIncreasingTimeInMs() +
kIncrementalMarkingDelayMs;
heap()->AdvanceIncrementalMarking(
0, deadline, i::IncrementalMarking::StepActions(
i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
i::IncrementalMarking::FORCE_MARKING,
i::IncrementalMarking::FORCE_COMPLETION));
heap()->FinalizeIncrementalMarkingIfComplete(
"Memory reducer: finalize incremental marking");
}
// Re-schedule the timer.
ScheduleTimer(state_.next_gc_start_ms - event.time_ms);
if (FLAG_trace_gc_verbose) {

14
deps/v8/src/preparser.h

@ -2939,6 +2939,7 @@ ParserBase<Traits>::ParseConditionalExpression(bool accept_IN,
ExpressionT expression =
this->ParseBinaryExpression(4, accept_IN, classifier, CHECK_OK);
if (peek() != Token::CONDITIONAL) return expression;
ArrowFormalParametersUnexpectedToken(classifier);
BindingPatternUnexpectedToken(classifier);
Consume(Token::CONDITIONAL);
// In parsing the first assignment expression in conditional
@ -2964,6 +2965,7 @@ ParserBase<Traits>::ParseBinaryExpression(int prec, bool accept_IN,
// prec1 >= 4
while (Precedence(peek(), accept_IN) == prec1) {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Token::Value op = Next();
Scanner::Location op_location = scanner()->location();
int pos = position();
@ -3026,6 +3028,7 @@ ParserBase<Traits>::ParseUnaryExpression(ExpressionClassifier* classifier,
Token::Value op = peek();
if (Token::IsUnaryOp(op)) {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
op = Next();
int pos = position();
@ -3048,6 +3051,7 @@ ParserBase<Traits>::ParseUnaryExpression(ExpressionClassifier* classifier,
return this->BuildUnaryExpression(expression, op, pos, factory());
} else if (Token::IsCountOp(op)) {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
op = Next();
Scanner::Location lhs_location = scanner()->peek_location();
ExpressionT expression = this->ParseUnaryExpression(classifier, CHECK_OK);
@ -3080,6 +3084,7 @@ ParserBase<Traits>::ParsePostfixExpression(ExpressionClassifier* classifier,
if (!scanner()->HasAnyLineTerminatorBeforeNext() &&
Token::IsCountOp(peek())) {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
expression = this->CheckAndRewriteReferenceExpression(
expression, lhs_location, MessageTemplate::kInvalidLhsInPostfixOp,
@ -3111,6 +3116,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
switch (peek()) {
case Token::LBRACK: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Consume(Token::LBRACK);
int pos = position();
ExpressionT index = ParseExpression(true, classifier, CHECK_OK);
@ -3121,6 +3127,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
case Token::LPAREN: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
if (is_strong(language_mode()) && this->IsIdentifier(result) &&
this->IsEval(this->AsIdentifier(result))) {
@ -3172,6 +3179,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
case Token::PERIOD: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Consume(Token::PERIOD);
int pos = position();
IdentifierT name = ParseIdentifierName(CHECK_OK);
@ -3184,6 +3192,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
case Token::TEMPLATE_SPAN:
case Token::TEMPLATE_TAIL: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
result = ParseTemplateLiteral(result, position(), classifier, CHECK_OK);
break;
}
@ -3221,6 +3230,7 @@ ParserBase<Traits>::ParseMemberWithNewPrefixesExpression(
if (peek() == Token::NEW) {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Consume(Token::NEW);
int new_pos = position();
ExpressionT result = this->EmptyExpression();
@ -3274,6 +3284,7 @@ ParserBase<Traits>::ParseMemberExpression(ExpressionClassifier* classifier,
ExpressionT result = this->EmptyExpression();
if (peek() == Token::FUNCTION) {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Consume(Token::FUNCTION);
int function_token_position = position();
@ -3523,6 +3534,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(
switch (peek()) {
case Token::LBRACK: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Consume(Token::LBRACK);
int pos = position();
@ -3536,6 +3548,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(
}
case Token::PERIOD: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
Consume(Token::PERIOD);
int pos = position();
@ -3550,6 +3563,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(
case Token::TEMPLATE_SPAN:
case Token::TEMPLATE_TAIL: {
BindingPatternUnexpectedToken(classifier);
ArrowFormalParametersUnexpectedToken(classifier);
int pos;
if (scanner()->current_token() == Token::IDENTIFIER) {
pos = position();

110
deps/v8/src/startup-data-util.cc

@ -8,66 +8,41 @@
#include <string.h>
#include "src/base/logging.h"
#include "src/base/platform/platform.h"
namespace v8 {
namespace internal {
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
StartupDataHandler::StartupDataHandler(const char* exec_path,
const char* natives_blob,
const char* snapshot_blob) {
// If we have (at least one) explicitly given blob, use those.
// If not, use the default blob locations next to the d8 binary.
if (natives_blob || snapshot_blob) {
LoadFromFiles(natives_blob, snapshot_blob);
} else {
char* natives;
char* snapshot;
LoadFromFiles(RelativePath(&natives, exec_path, "natives_blob.bin"),
RelativePath(&snapshot, exec_path, "snapshot_blob.bin"));
namespace {
free(natives);
free(snapshot);
}
}
v8::StartupData g_natives;
v8::StartupData g_snapshot;
StartupDataHandler::~StartupDataHandler() {
delete[] natives_.data;
delete[] snapshot_.data;
void ClearStartupData(v8::StartupData* data) {
data->data = nullptr;
data->raw_size = 0;
}
char* StartupDataHandler::RelativePath(char** buffer, const char* exec_path,
const char* name) {
DCHECK(exec_path);
const char* last_slash = strrchr(exec_path, '/');
if (last_slash) {
int after_slash = static_cast<int>(last_slash - exec_path + 1);
int name_length = static_cast<int>(strlen(name));
*buffer = reinterpret_cast<char*>(calloc(after_slash + name_length + 1, 1));
strncpy(*buffer, exec_path, after_slash);
strncat(*buffer, name, name_length);
} else {
*buffer = strdup(name);
}
return *buffer;
void DeleteStartupData(v8::StartupData* data) {
delete[] data->data;
ClearStartupData(data);
}
void StartupDataHandler::LoadFromFiles(const char* natives_blob,
const char* snapshot_blob) {
Load(natives_blob, &natives_, v8::V8::SetNativesDataBlob);
Load(snapshot_blob, &snapshot_, v8::V8::SetSnapshotDataBlob);
void FreeStartupData() {
DeleteStartupData(&g_natives);
DeleteStartupData(&g_snapshot);
}
void StartupDataHandler::Load(const char* blob_file,
v8::StartupData* startup_data,
void (*setter_fn)(v8::StartupData*)) {
startup_data->data = NULL;
startup_data->raw_size = 0;
void Load(const char* blob_file, v8::StartupData* startup_data,
void (*setter_fn)(v8::StartupData*)) {
ClearStartupData(startup_data);
if (!blob_file) return;
@ -86,6 +61,57 @@ void StartupDataHandler::Load(const char* blob_file,
if (startup_data->raw_size == read_size) (*setter_fn)(startup_data);
}
void LoadFromFiles(const char* natives_blob, const char* snapshot_blob) {
Load(natives_blob, &g_natives, v8::V8::SetNativesDataBlob);
Load(snapshot_blob, &g_snapshot, v8::V8::SetSnapshotDataBlob);
atexit(&FreeStartupData);
}
char* RelativePath(char** buffer, const char* exec_path, const char* name) {
DCHECK(exec_path);
int path_separator = static_cast<int>(strlen(exec_path)) - 1;
while (path_separator >= 0 &&
!base::OS::isDirectorySeparator(exec_path[path_separator])) {
path_separator--;
}
if (path_separator >= 0) {
int name_length = static_cast<int>(strlen(name));
*buffer =
reinterpret_cast<char*>(calloc(path_separator + name_length + 2, 1));
*buffer[0] = '\0';
strncat(*buffer, exec_path, path_separator + 1);
strncat(*buffer, name, name_length);
} else {
*buffer = strdup(name);
}
return *buffer;
}
} // namespace
#endif // V8_USE_EXTERNAL_STARTUP_DATA
void InitializeExternalStartupData(const char* directory_path) {
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
char* natives;
char* snapshot;
LoadFromFiles(RelativePath(&natives, directory_path, "natives_blob.bin"),
RelativePath(&snapshot, directory_path, "snapshot_blob.bin"));
free(natives);
free(snapshot);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
void InitializeExternalStartupData(const char* natives_blob,
const char* snapshot_blob) {
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
LoadFromFiles(natives_blob, snapshot_blob);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
} // namespace internal
} // namespace v8

40
deps/v8/src/startup-data-util.h

@ -9,43 +9,21 @@
#include "include/v8.h"
namespace v8 {
namespace internal {
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
// Helper class to load the startup data files from disk.
// Helper functions to load external startup data.
//
// This is meant as a convenience for stand-alone binaries like d8, cctest,
// unittest. A V8 embedder would likely either handle startup data on their
// own or just disable the feature if they don't want to handle it at all,
// while tools like cctest need to work in either configuration. Hence this is
// not meant for inclusion in the general v8 library.
class StartupDataHandler {
public:
// Load startup data, and call the v8::V8::Set*DataBlob API functions.
//
// natives_blob and snapshot_blob will be loaded realitive to exec_path,
// which would usually be the equivalent of argv[0].
StartupDataHandler(const char* exec_path, const char* natives_blob,
const char* snapshot_blob);
~StartupDataHandler();
private:
static char* RelativePath(char** buffer, const char* exec_path,
const char* name);
void LoadFromFiles(const char* natives_blob, const char* snapshot_blob);
void Load(const char* blob_file, v8::StartupData* startup_data,
void (*setter_fn)(v8::StartupData*));
v8::StartupData natives_;
v8::StartupData snapshot_;
// Disallow copy & assign.
StartupDataHandler(const StartupDataHandler& other);
void operator=(const StartupDataHandler& other);
};
#endif // V8_USE_EXTERNAL_STARTUP_DATA
// while tools like cctest need to work in either configuration.
void InitializeExternalStartupData(const char* directory_path);
void InitializeExternalStartupData(const char* natives_blob,
const char* snapshot_blob);
} // namespace internal
} // namespace v8
#endif // V8_STARTUP_DATA_UTIL_H_

8
deps/v8/test/cctest/cctest.cc

@ -34,10 +34,6 @@
#include "test/cctest/profiler-extension.h"
#include "test/cctest/trace-extension.h"
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
#include "src/startup-data-util.h"
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#if V8_OS_WIN
#include <windows.h> // NOLINT
#if V8_CC_MSVC
@ -173,9 +169,7 @@ int main(int argc, char* argv[]) {
v8::V8::InitializePlatform(platform);
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
v8::V8::Initialize();
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
v8::StartupDataHandler startup_data(argv[0], NULL, NULL);
#endif
v8::V8::InitializeExternalStartupData(argv[0]);
CcTestArrayBufferAllocator array_buffer_allocator;
CcTest::set_array_buffer_allocator(&array_buffer_allocator);

2
deps/v8/test/cctest/cctest.gyp

@ -163,8 +163,6 @@
'test-weakmaps.cc',
'test-weaksets.cc',
'trace-extension.cc',
'../../src/startup-data-util.h',
'../../src/startup-data-util.cc'
],
'conditions': [
['v8_target_arch=="ia32"', {

61
deps/v8/test/cctest/test-parsing.cc

@ -3516,6 +3516,67 @@ TEST(UseConstLegacyCount) {
}
TEST(ErrorsArrowFormalParameters) {
const char* context_data[][2] = {
{ "()", "=>{}" },
{ "()", "=>{};" },
{ "var x = ()", "=>{}" },
{ "var x = ()", "=>{};" },
{ "a", "=>{}" },
{ "a", "=>{};" },
{ "var x = a", "=>{}" },
{ "var x = a", "=>{};" },
{ "(a)", "=>{}" },
{ "(a)", "=>{};" },
{ "var x = (a)", "=>{}" },
{ "var x = (a)", "=>{};" },
{ "(...a)", "=>{}" },
{ "(...a)", "=>{};" },
{ "var x = (...a)", "=>{}" },
{ "var x = (...a)", "=>{};" },
{ "(a,b)", "=>{}" },
{ "(a,b)", "=>{};" },
{ "var x = (a,b)", "=>{}" },
{ "var x = (a,b)", "=>{};" },
{ "(a,...b)", "=>{}" },
{ "(a,...b)", "=>{};" },
{ "var x = (a,...b)", "=>{}" },
{ "var x = (a,...b)", "=>{};" },
{ nullptr, nullptr }
};
const char* assignment_expression_suffix_data[] = {
"?c:d=>{}",
"=c=>{}",
"()",
"(c)",
"[1]",
"[c]",
".c",
"-c",
"+c",
"c++",
"`c`",
"`${c}`",
"`template-head${c}`",
"`${c}template-tail`",
"`template-head${c}template-tail`",
"`${c}template-tail`",
nullptr
};
static const ParserFlag always_flags[] = { kAllowHarmonyArrowFunctions,
kAllowHarmonyRestParameters };
RunParserSyncTest(context_data, assignment_expression_suffix_data, kError,
NULL, 0, always_flags, arraysize(always_flags));
}
TEST(ErrorsArrowFunctions) {
// Tests that parser and preparser generate the same kind of errors
// on invalid arrow function syntax.

8
deps/v8/test/unittests/run-all-unittests.cc

@ -7,10 +7,6 @@
#include "src/base/compiler-specific.h"
#include "testing/gmock/include/gmock/gmock.h"
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
#include "src/startup-data-util.h"
#endif // V8_USE_EXTERNAL_STARTUP_DATA
namespace {
class DefaultPlatformEnvironment final : public ::testing::Environment {
@ -45,8 +41,6 @@ int main(int argc, char** argv) {
testing::InitGoogleMock(&argc, argv);
testing::AddGlobalTestEnvironment(new DefaultPlatformEnvironment);
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
v8::StartupDataHandler startup_data(argv[0], NULL, NULL);
#endif
v8::V8::InitializeExternalStartupData(argv[0]);
return RUN_ALL_TESTS();
}

2
deps/v8/test/unittests/unittests.gyp

@ -94,8 +94,6 @@
'run-all-unittests.cc',
'test-utils.h',
'test-utils.cc',
'../../src/startup-data-util.h',
'../../src/startup-data-util.cc'
],
'conditions': [
['v8_target_arch=="arm"', {

2
deps/v8/tools/gyp/v8.gyp

@ -910,6 +910,8 @@
'../../src/snapshot/snapshot-source-sink.h',
'../../src/splay-tree.h',
'../../src/splay-tree-inl.h',
'../../src/startup-data-util.cc',
'../../src/startup-data-util.h',
'../../src/string-builder.cc',
'../../src/string-builder.h',
'../../src/string-search.cc',

2
deps/v8/tools/parser-shell.cc

@ -146,6 +146,8 @@ int main(int argc, char* argv[]) {
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
v8::V8::Initialize();
v8::V8::InitializeExternalStartupData(argv[0]);
Encoding encoding = LATIN1;
std::vector<std::string> fnames;
std::string benchmark;

Loading…
Cancel
Save