OLD | NEW |
(Empty) | |
| 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 TF_BUILTIN(FastConsoleAssert, CodeStubAssembler) { |
| 13 Label runtime(this); |
| 14 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 GotoIf(Word32Equal(argc, Int32Constant(0)), &runtime); |
| 22 |
| 23 CodeStubArguments args(this, ChangeInt32ToIntPtr(argc)); |
| 24 BranchIfToBooleanIsTrue(args.AtIndex(0), &out, &runtime); |
| 25 BIND(&out); |
| 26 args.PopAndReturn(UndefinedConstant()); |
| 27 |
| 28 BIND(&runtime); |
| 29 { |
| 30 Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset, |
| 31 MachineType::TaggedPointer()); |
| 32 TailCallBuiltin(Builtins::kConsoleAssert, context, target, new_target, |
| 33 argc); |
| 34 } |
| 35 } |
| 36 |
| 37 } // namespace internal |
| 38 } // namespace v8 |
OLD | NEW |