Skip to content

Commit

Permalink
deps: patch V8 to 8.1.307.30
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Apr 18, 2020
1 parent 91b1820 commit 98629ba
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 8
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 307
#define V8_PATCH_LEVEL 28
#define V8_PATCH_LEVEL 30

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
25 changes: 23 additions & 2 deletions deps/v8/src/regexp/regexp-interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,29 @@ IrregexpInterpreter::Result IrregexpInterpreter::MatchForCallFromJs(
return IrregexpInterpreter::RETRY;
}

return Match(isolate, regexp_obj, subject_string, registers, registers_length,
start_position, call_origin);
// In generated code, registers are allocated on the stack. The given
// `registers` argument is only guaranteed to hold enough space for permanent
// registers (i.e. for captures), and not for temporary registers used only
// during matcher execution. We match that behavior in the interpreter by
// using a SmallVector as internal register storage.
static constexpr int kBaseRegisterArraySize = 64; // Arbitrary.
const int internal_register_count =
Smi::ToInt(regexp_obj.DataAt(JSRegExp::kIrregexpMaxRegisterCountIndex));
base::SmallVector<int, kBaseRegisterArraySize> internal_registers(
internal_register_count);

Result result =
Match(isolate, regexp_obj, subject_string, internal_registers.data(),
internal_register_count, start_position, call_origin);

// Copy capture registers to the output array.
if (result == IrregexpInterpreter::SUCCESS) {
CHECK_GE(internal_registers.size(), registers_length);
MemCopy(registers, internal_registers.data(),
registers_length * sizeof(registers[0]));
}

return result;
}

IrregexpInterpreter::Result IrregexpInterpreter::MatchForCallFromRuntime(
Expand Down
6 changes: 6 additions & 0 deletions deps/v8/src/wasm/wasm-engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ class WasmGCForegroundTask : public CancelableTask {
std::shared_ptr<NativeModule> NativeModuleCache::MaybeGetNativeModule(
ModuleOrigin origin, Vector<const uint8_t> wire_bytes) {
if (origin != kWasmOrigin) return nullptr;
// Temporarily disabled to fix stability issue on M-81
// (https://crbug.com/1070199).
if (!FLAG_future) return nullptr;
base::MutexGuard lock(&mutex_);
while (true) {
auto it = map_.find(wire_bytes);
Expand All @@ -153,6 +156,9 @@ void NativeModuleCache::Update(std::shared_ptr<NativeModule> native_module,
bool error) {
DCHECK_NOT_NULL(native_module);
if (native_module->module()->origin != kWasmOrigin) return;
// Temporarily disabled to fix stability issue on M-81
// (https://crbug.com/1070199).
if (!FLAG_future) return;
Vector<const uint8_t> wire_bytes = native_module->wire_bytes();
base::MutexGuard lock(&mutex_);
auto it = map_.find(wire_bytes);
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/test/cctest/cctest.status
Original file line number Diff line number Diff line change
Expand Up @@ -600,4 +600,11 @@
'test-cpu-profiler/DeoptUntrackedFunction': [SKIP],
}], # variant == turboprop

##############################################################################
['variant != future', {
# Wasm native module cache is temporarily disabled in non-future variant
# (https://crbug.com/1070199)
'test-compilation-cache/*': [SKIP]
}], # variant != future

]
6 changes: 6 additions & 0 deletions deps/v8/test/inspector/inspector.status
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,11 @@
}], # 'arch == s390 or arch == s390x'

##############################################################################
['variant != future', {
# Wasm native module cache is temporarily disabled in non-future variant
# (https://crbug.com/1070199)
'debugger/wasm-scripts': [SKIP],
}], # variant != future


]
11 changes: 11 additions & 0 deletions deps/v8/test/mjsunit/regress/regress-1067270.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2020 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.
//
// Flags: --allow-natives-syntax

const needle = Array(1802).join(" +") + Array(16884).join("A");
const string = "A";

assertEquals(string.search(needle), -1);
assertEquals(string.search(needle), -1);

0 comments on commit 98629ba

Please sign in to comment.