Skip to content

Commit 875d905

Browse files
committed
Revert "deps: V8: backport b36cf9f6ccd2"
This reverts commit ccd648e. PR-URL: #65907 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent b12688c commit 875d905

11 files changed

Lines changed: 2 additions & 93 deletions

File tree

‎deps/v8/BUILD.bazel‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,6 @@ v8_flag(name = "v8_enable_trace_maps")
148148

149149
v8_flag(name = "v8_enable_v8_checks")
150150

151-
v8_flag(
152-
name = "v8_disallow_js_in_api_interrupts_is_checked",
153-
default = True,
154-
)
155-
156151
v8_flag(name = "v8_enable_verify_csa")
157152

158153
v8_flag(name = "v8_enable_verify_heap")
@@ -501,7 +496,6 @@ v8_config(
501496
"v8_android_log_stdout": "V8_ANDROID_LOG_STDOUT",
502497
"v8_code_comments": "V8_CODE_COMMENTS",
503498
"v8_deprecation_warnings": "V8_DEPRECATION_WARNINGS",
504-
"v8_disallow_js_in_api_interrupts_is_checked": "V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED",
505499
"v8_imminent_deprecation_warnings": "V8_IMMINENT_DEPRECATION_WARNINGS",
506500
"v8_enable_debug_code": "V8_ENABLE_DEBUG_CODE",
507501
"v8_enable_disassembler": "ENABLE_DISASSEMBLER",

‎deps/v8/BUILD.gn‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ declare_args() {
5959
# Enable compiler warnings when using V8_DEPRECATED apis.
6060
v8_deprecation_warnings = true
6161

62-
# Check that executing JavaScript inside API interrupt callbacks is
63-
# disallowed.
64-
v8_disallow_js_in_api_interrupts_is_checked = true
65-
6662
# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
6763
v8_imminent_deprecation_warnings = true
6864

@@ -1003,7 +999,6 @@ external_v8_defines = [
1003999
"V8_COMPRESS_ZONES",
10041000
"V8_ENABLE_SANDBOX",
10051001
"V8_DEPRECATION_WARNINGS",
1006-
"V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED",
10071002
"V8_IMMINENT_DEPRECATION_WARNINGS",
10081003
"V8_USE_PERFETTO",
10091004
"V8_USE_PERFETTO_JSON_EXPORT",
@@ -1052,10 +1047,6 @@ if (v8_enable_sandbox) {
10521047
if (v8_deprecation_warnings) {
10531048
enabled_external_v8_defines += [ "V8_DEPRECATION_WARNINGS" ]
10541049
}
1055-
if (v8_disallow_js_in_api_interrupts_is_checked) {
1056-
enabled_external_v8_defines +=
1057-
[ "V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED" ]
1058-
}
10591050
if (v8_imminent_deprecation_warnings) {
10601051
enabled_external_v8_defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
10611052
}
@@ -3102,8 +3093,6 @@ generated_file("v8_generate_features_json") {
31023093
output_conversion = "json"
31033094
contents = {
31043095
v8_deprecation_warnings = v8_deprecation_warnings
3105-
v8_disallow_js_in_api_interrupts_is_checked =
3106-
v8_disallow_js_in_api_interrupts_is_checked
31073096
v8_enable_31bit_smis_on_64bit_arch = v8_enable_31bit_smis_on_64bit_arch
31083097
v8_enable_direct_handle = v8_enable_direct_handle
31093098
v8_enable_extensible_ro_snapshot = v8_enable_extensible_ro_snapshot

‎deps/v8/src/common/assert-scope.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class V8_NODISCARD PerThreadAssertScope
110110
ScopeType& operator=(const ScopeType&) = delete; \
111111
V8_EXPORT_PRIVATE ~ScopeType(); \
112112
\
113-
V8_EXPORT_PRIVATE static bool IsAllowed(Isolate* isolate); \
113+
static bool IsAllowed(Isolate* isolate); \
114114
\
115115
V8_EXPORT_PRIVATE static void Open(Isolate* isolate, \
116116
bool* was_execution_allowed); \

‎deps/v8/src/execution/isolate.cc‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,13 +2357,6 @@ void Isolate::InvokeApiInterruptCallbacks() {
23572357
}
23582358
VMState<EXTERNAL> state(this);
23592359
HandleScope handle_scope(this);
2360-
// API interrupt callbacks are forbidden from executing JavaScript on the
2361-
// interrupted Isolate (see v8::Isolate::RequestInterrupt contract in
2362-
// v8-isolate.h: "Registered |callback| must not reenter interrupted
2363-
// Isolate.").
2364-
#ifdef V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED
2365-
DisallowJavascriptExecution no_js(this);
2366-
#endif // V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED
23672360
entry.first(reinterpret_cast<v8::Isolate*>(this), entry.second);
23682361
}
23692362
}

‎deps/v8/src/inspector/v8-debugger.cc‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ void V8Debugger::handleProgramBreak(
532532
}
533533
});
534534
{
535-
v8::Isolate::AllowJavascriptExecutionScope allow_script(m_isolate);
536535
v8::Context::Scope scope(pausedContext);
537536

538537
m_inspector->forEachSession(

‎deps/v8/src/inspector/v8-inspector-impl.cc‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ int V8InspectorImpl::resolveUniqueContextId(
9696

9797
v8::MaybeLocal<v8::Value> V8InspectorImpl::compileAndRunInternalScript(
9898
v8::Local<v8::Context> context, v8::Local<v8::String> source) {
99-
v8::Isolate::AllowJavascriptExecutionScope allow_script(m_isolate);
10099
v8::Local<v8::UnboundScript> unboundScript;
101100
if (!v8::debug::CompileInspectorScript(m_isolate, source)
102101
.ToLocal(&unboundScript))

‎deps/v8/src/inspector/v8-inspector-session-impl.cc‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) {
355355
}
356356

357357
void V8InspectorSessionImpl::dispatchProtocolMessage(StringView message) {
358-
v8::Isolate::AllowJavascriptExecutionScope allow_script(
359-
m_inspector->isolate());
360358
KeepSessionAliveScope keepAlive(*this);
361359

362360
using v8_crdtp::span;

‎deps/v8/src/inspector/v8-regex.cc‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ V8Regex::V8Regex(V8InspectorImpl* inspector, const String16& pattern,
3838
v8::Local<v8::RegExp> regex;
3939
// Protect against reentrant debugger calls via interrupts.
4040
v8::debug::PostponeInterruptsScope no_interrupts(m_inspector->isolate());
41-
v8::Isolate::AllowJavascriptExecutionScope allow_js(m_inspector->isolate());
4241
if (v8::RegExp::New(context, toV8String(isolate, pattern),
4342
static_cast<v8::RegExp::Flags>(flags))
4443
.ToLocal(&regex))
@@ -70,7 +69,6 @@ int V8Regex::match(const String16& string, int startFrom,
7069
v8::MicrotasksScope::kDoNotRunMicrotasks);
7170
// Protect against reentrant debugger calls via interrupts.
7271
v8::debug::PostponeInterruptsScope no_interrupts(m_inspector->isolate());
73-
v8::Isolate::AllowJavascriptExecutionScope allow_js(m_inspector->isolate());
7472
v8::TryCatch tryCatch(isolate);
7573

7674
v8::Local<v8::RegExp> regex = m_regex.Get(isolate);

‎deps/v8/test/cctest/test-api.cc‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22306,26 +22306,6 @@ TEST(RequestInterruptSmallScripts) {
2230622306
CHECK(interrupt_was_called);
2230722307
}
2230822308

22309-
#ifdef V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED
22310-
static bool interrupt_check_no_js = false;
22311-
void DisallowJsInterruptCallback(v8::Isolate* isolate, void* data) {
22312-
CHECK(!i::AllowJavascriptExecution::IsAllowed(
22313-
reinterpret_cast<i::Isolate*>(isolate)));
22314-
interrupt_check_no_js = true;
22315-
}
22316-
22317-
TEST(RequestInterruptDisallowsJavascript) {
22318-
LocalContext env;
22319-
v8::Isolate* isolate = CcTest::isolate();
22320-
v8::HandleScope scope(isolate);
22321-
22322-
interrupt_check_no_js = false;
22323-
isolate->RequestInterrupt(&DisallowJsInterruptCallback, nullptr);
22324-
CompileRun("(function(x){return x;})(1);");
22325-
CHECK(interrupt_check_no_js);
22326-
}
22327-
#endif // V8_DISALLOW_JS_IN_API_INTERRUPTS_IS_CHECKED
22328-
2232922309
static v8::Global<Value> function_new_expected_env_global;
2233022310
static void FunctionNewCallback(const v8::FunctionCallbackInfo<Value>& info) {
2233122311
v8::Isolate* isolate = info.GetIsolate();

‎deps/v8/test/cctest/test-regexp.cc‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,7 @@ class InterruptTest {
124124
CHECK(string->ContainsOnlyOneByte());
125125
// Internalize the subject by using it as a computed property name in an
126126
// object.
127-
{
128-
// This test is technically wrong for running JS in a C++ interrupt.
129-
// However we know that the interuptee here is the regexp engine, which
130-
// does not care.
131-
Isolate::AllowJavascriptExecutionScope allow_script(isolate);
132-
CompileRun("o = { [subject_string]: 'foo' }");
133-
}
127+
CompileRun("o = { [subject_string]: 'foo' }");
134128
CHECK(string->IsOneByte());
135129
}
136130

0 commit comments

Comments
 (0)