Commit 7a60f322 authored by Gus Caplan's avatar Gus Caplan Committed by Commit Bot

[Torque] port FastConsoleAssert to Torque

Change-Id: Iee27a99a9627d73e10c4c85c31d07a5204808259
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1864574
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64483}
parent 729d5de6
...@@ -945,6 +945,7 @@ torque_files = [ ...@@ -945,6 +945,7 @@ torque_files = [
"src/builtins/bigint.tq", "src/builtins/bigint.tq",
"src/builtins/boolean.tq", "src/builtins/boolean.tq",
"src/builtins/collections.tq", "src/builtins/collections.tq",
"src/builtins/console.tq",
"src/builtins/data-view.tq", "src/builtins/data-view.tq",
"src/builtins/frames.tq", "src/builtins/frames.tq",
"src/builtins/growable-fixed-array.tq", "src/builtins/growable-fixed-array.tq",
...@@ -1464,7 +1465,6 @@ v8_source_set("v8_initializers") { ...@@ -1464,7 +1465,6 @@ v8_source_set("v8_initializers") {
"src/builtins/builtins-call-gen.cc", "src/builtins/builtins-call-gen.cc",
"src/builtins/builtins-call-gen.h", "src/builtins/builtins-call-gen.h",
"src/builtins/builtins-collections-gen.cc", "src/builtins/builtins-collections-gen.cc",
"src/builtins/builtins-console-gen.cc",
"src/builtins/builtins-constructor-gen.cc", "src/builtins/builtins-constructor-gen.cc",
"src/builtins/builtins-constructor-gen.h", "src/builtins/builtins-constructor-gen.h",
"src/builtins/builtins-constructor.h", "src/builtins/builtins-constructor.h",
......
// Copyright 2017 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.
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/codegen/code-stub-assembler.h"
#include "src/codegen/macro-assembler.h"
#include "src/execution/frame-constants.h"
namespace v8 {
namespace internal {
TF_BUILTIN(FastConsoleAssert, CodeStubAssembler) {
Label runtime(this);
Label out(this);
TNode<Int32T> argc =
UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<Object> new_target = CAST(Parameter(Descriptor::kJSNewTarget));
GotoIf(Word32Equal(argc, Int32Constant(0)), &runtime);
CodeStubArguments args(this, argc);
BranchIfToBooleanIsTrue(args.AtIndex(0), &out, &runtime);
BIND(&out);
args.PopAndReturn(UndefinedConstant());
BIND(&runtime);
{
// We are not using Parameter(Descriptor::kJSTarget) and loading the value
// from the current frame here in order to reduce register pressure on the
// fast path.
TNode<JSFunction> target = LoadTargetFromFrame();
TailCallBuiltin(Builtins::kConsoleAssert, context, target, new_target,
argc);
}
}
} // namespace internal
} // namespace v8
...@@ -429,7 +429,6 @@ namespace internal { ...@@ -429,7 +429,6 @@ namespace internal {
CPP(ConsoleCount) \ CPP(ConsoleCount) \
CPP(ConsoleCountReset) \ CPP(ConsoleCountReset) \
CPP(ConsoleAssert) \ CPP(ConsoleAssert) \
TFJ(FastConsoleAssert, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
CPP(ConsoleProfile) \ CPP(ConsoleProfile) \
CPP(ConsoleProfileEnd) \ CPP(ConsoleProfileEnd) \
CPP(ConsoleTime) \ CPP(ConsoleTime) \
......
// Copyright 2019 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.
namespace console {
extern builtin ConsoleAssert(implicit context:
Context)(JSFunction, JSAny, int32): JSAny;
javascript builtin FastConsoleAssert(
js-implicit context: Context, receiver: JSAny, newTarget: JSAny,
target: JSFunction)(...arguments): JSAny {
if (ToBoolean(arguments[0])) {
return Undefined;
} else {
tail ConsoleAssert(target, newTarget, Convert<int32>(arguments.length));
}
}
}
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