Commit ec9fa436 authored by Maya Lekova's avatar Maya Lekova Committed by V8 LUCI CQ

[megadom] Turn an expensive check only in DEBUG

This CL fixes a performance regression by conditionally compiling an
expensive instance check only in debug mode.

Bug: chromium:1329463
Change-Id: I2cceb7c06fa6db967923047a4dee63a93a0b72a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3743385
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81519}
parent 5e2174fb
......@@ -3028,11 +3028,15 @@ Local<String> Shell::Stringify(Isolate* isolate, Local<Value> value) {
void Shell::NodeTypeCallback(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
// TODO(mslekova): Enable this once we have signature check in TF.
// HasInstance does a slow prototype chain lookup, and this function is used
// for micro benchmarks too.
#ifdef DEBUG
PerIsolateData* data = PerIsolateData::Get(isolate);
if (!data->GetDomNodeCtor()->HasInstance(args.This())) {
isolate->ThrowError("Calling .nodeType on wrong instance type.");
}
#endif
args.GetReturnValue().Set(v8::Number::New(isolate, 1));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment