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