Skip to content

Commit bf86f55

Browse files
targosBethGriggs
authored andcommitted
deps: patch V8 to 8.1.307.30
PR-URL: #32693 Refs: v8/v8@8.1.307.26...8.1.307.28 Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
1 parent b5bbde8 commit bf86f55

File tree

9 files changed

+83
-4
lines changed

9 files changed

+83
-4
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 8
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 307
14-
#define V8_PATCH_LEVEL 26
14+
#define V8_PATCH_LEVEL 30
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/builtins/builtins-function.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
#include "src/api/api-inl.h"
56
#include "src/builtins/builtins-utils-inl.h"
67
#include "src/builtins/builtins.h"
78
#include "src/codegen/code-factory.h"
@@ -31,7 +32,12 @@ MaybeHandle<Object> CreateDynamicFunction(Isolate* isolate,
3132

3233
if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) {
3334
isolate->CountUsage(v8::Isolate::kFunctionConstructorReturnedUndefined);
34-
return isolate->factory()->undefined_value();
35+
// TODO(verwaest): We would like to throw using the calling context instead
36+
// of the entered context but we don't currently have access to that.
37+
HandleScopeImplementer* impl = isolate->handle_scope_implementer();
38+
SaveAndSwitchContext save(
39+
isolate, impl->LastEnteredOrMicrotaskContext()->native_context());
40+
THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kNoAccess), Object);
3541
}
3642

3743
// Build the source string.

deps/v8/src/regexp/regexp-interpreter.cc

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,29 @@ IrregexpInterpreter::Result IrregexpInterpreter::MatchForCallFromJs(
10511051
return IrregexpInterpreter::RETRY;
10521052
}
10531053

1054-
return Match(isolate, regexp_obj, subject_string, registers, registers_length,
1055-
start_position, call_origin);
1054+
// In generated code, registers are allocated on the stack. The given
1055+
// `registers` argument is only guaranteed to hold enough space for permanent
1056+
// registers (i.e. for captures), and not for temporary registers used only
1057+
// during matcher execution. We match that behavior in the interpreter by
1058+
// using a SmallVector as internal register storage.
1059+
static constexpr int kBaseRegisterArraySize = 64; // Arbitrary.
1060+
const int internal_register_count =
1061+
Smi::ToInt(regexp_obj.DataAt(JSRegExp::kIrregexpMaxRegisterCountIndex));
1062+
base::SmallVector<int, kBaseRegisterArraySize> internal_registers(
1063+
internal_register_count);
1064+
1065+
Result result =
1066+
Match(isolate, regexp_obj, subject_string, internal_registers.data(),
1067+
internal_register_count, start_position, call_origin);
1068+
1069+
// Copy capture registers to the output array.
1070+
if (result == IrregexpInterpreter::SUCCESS) {
1071+
CHECK_GE(internal_registers.size(), registers_length);
1072+
MemCopy(registers, internal_registers.data(),
1073+
registers_length * sizeof(registers[0]));
1074+
}
1075+
1076+
return result;
10561077
}
10571078

10581079
IrregexpInterpreter::Result IrregexpInterpreter::MatchForCallFromRuntime(

deps/v8/src/wasm/wasm-engine.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ class WasmGCForegroundTask : public CancelableTask {
129129
std::shared_ptr<NativeModule> NativeModuleCache::MaybeGetNativeModule(
130130
ModuleOrigin origin, Vector<const uint8_t> wire_bytes) {
131131
if (origin != kWasmOrigin) return nullptr;
132+
// Temporarily disabled to fix stability issue on M-81
133+
// (https://crbug.com/1070199).
134+
if (!FLAG_future) return nullptr;
132135
base::MutexGuard lock(&mutex_);
133136
while (true) {
134137
auto it = map_.find(wire_bytes);
@@ -153,6 +156,9 @@ void NativeModuleCache::Update(std::shared_ptr<NativeModule> native_module,
153156
bool error) {
154157
DCHECK_NOT_NULL(native_module);
155158
if (native_module->module()->origin != kWasmOrigin) return;
159+
// Temporarily disabled to fix stability issue on M-81
160+
// (https://crbug.com/1070199).
161+
if (!FLAG_future) return;
156162
Vector<const uint8_t> wire_bytes = native_module->wire_bytes();
157163
base::MutexGuard lock(&mutex_);
158164
auto it = map_.find(wire_bytes);

deps/v8/test/cctest/cctest.status

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,4 +600,11 @@
600600
'test-cpu-profiler/DeoptUntrackedFunction': [SKIP],
601601
}], # variant == turboprop
602602

603+
##############################################################################
604+
['variant != future', {
605+
# Wasm native module cache is temporarily disabled in non-future variant
606+
# (https://crbug.com/1070199)
607+
'test-compilation-cache/*': [SKIP]
608+
}], # variant != future
609+
603610
]

deps/v8/test/inspector/inspector.status

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,11 @@
8484
}], # 'arch == s390 or arch == s390x'
8585

8686
##############################################################################
87+
['variant != future', {
88+
# Wasm native module cache is temporarily disabled in non-future variant
89+
# (https://crbug.com/1070199)
90+
'debugger/wasm-scripts': [SKIP],
91+
}], # variant != future
92+
8793

8894
]

deps/v8/test/mjsunit/mjsunit.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@
157157
# OOM with too many isolates/memory objects (https://crbug.com/1010272)
158158
# Predictable tests fail due to race between postMessage and GrowMemory
159159
'regress/wasm/regress-1010272': [PASS, NO_VARIANTS, ['system == android', SKIP], ['predictable', SKIP]],
160+
161+
# Needs to be adapted after changes to Function constructor. chromium:1065094
162+
'cross-realm-filtering': [SKIP],
160163
}], # ALWAYS
161164

162165
##############################################################################
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2020 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --allow-natives-syntax
6+
7+
function f(fnConstructor) {
8+
return Object.is(new fnConstructor(), undefined);
9+
}
10+
11+
const realmIndex = Realm.createAllowCrossRealmAccess();
12+
const otherFunction = Realm.global(realmIndex).Function;
13+
Realm.detachGlobal(realmIndex);
14+
15+
%PrepareFunctionForOptimization(f);
16+
assertFalse(f(Function));
17+
assertThrows(_ => f(otherFunction));
18+
%OptimizeFunctionOnNextCall(f);
19+
assertThrows(_ => f(otherFunction));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2020 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
//
5+
// Flags: --allow-natives-syntax
6+
7+
const needle = Array(1802).join(" +") + Array(16884).join("A");
8+
const string = "A";
9+
10+
assertEquals(string.search(needle), -1);
11+
assertEquals(string.search(needle), -1);

0 commit comments

Comments
 (0)