Line data Source code
1 : // Copyright 2017 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 : #include "src/builtins/builtins-utils-gen.h"
6 : #include "src/builtins/builtins.h"
7 : #include "src/code-stub-assembler.h"
8 :
9 : namespace v8 {
10 : namespace internal {
11 :
12 172 : TF_BUILTIN(FastConsoleAssert, CodeStubAssembler) {
13 43 : Label runtime(this);
14 43 : Label out(this);
15 :
16 : // TODO(ishell): use constants from Descriptor once the JSFunction linkage
17 : // arguments are reordered.
18 : Node* argc = Parameter(BuiltinDescriptor::kArgumentsCount);
19 : Node* context = Parameter(BuiltinDescriptor::kContext);
20 : Node* new_target = Parameter(BuiltinDescriptor::kNewTarget);
21 43 : GotoIf(Word32Equal(argc, Int32Constant(0)), &runtime);
22 :
23 43 : CodeStubArguments args(this, ChangeInt32ToIntPtr(argc));
24 43 : BranchIfToBooleanIsTrue(args.AtIndex(0), &out, &runtime);
25 43 : BIND(&out);
26 43 : args.PopAndReturn(UndefinedConstant());
27 :
28 43 : BIND(&runtime);
29 : {
30 : Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset,
31 43 : MachineType::TaggedPointer());
32 : TailCallBuiltin(Builtins::kConsoleAssert, context, target, new_target,
33 43 : argc);
34 43 : }
35 43 : }
36 :
37 : } // namespace internal
38 : } // namespace v8
|