Index: src/builtins/builtins-console-gen.cc |
diff --git a/src/builtins/builtins-console-gen.cc b/src/builtins/builtins-console-gen.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d0adaaceca4e21318b3da3916c78f16e1a1f5d6 |
--- /dev/null |
+++ b/src/builtins/builtins-console-gen.cc |
@@ -0,0 +1,37 @@ |
+// 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/code-stub-assembler.h" |
+ |
+namespace v8 { |
+namespace internal { |
+ |
+TF_BUILTIN(FastConsoleAssert, CodeStubAssembler) { |
+ Label runtime(this); |
+ Label out(this); |
+ |
+ // TODO(ishell): use constants from Descriptor once the JSFunction linkage |
+ // arguments are reordered. |
+ Node* argc = Parameter(BuiltinDescriptor::kArgumentsCount); |
+ Node* context = Parameter(BuiltinDescriptor::kContext); |
+ Node* new_target = Parameter(BuiltinDescriptor::kNewTarget); |
+ |
+ CodeStubArguments args(this, ChangeInt32ToIntPtr(argc)); |
+ GotoIf(WordEqual(argc, IntPtrConstant(0)), &runtime); |
Igor Sheludko
2017/04/20 10:18:42
argc is an int32, so the graph verifier will compl
kozy
2017/04/20 15:14:54
Done.
|
+ BranchIfToBooleanIsTrue(args.AtIndex(0), &out, &runtime); |
+ BIND(&out); |
+ { args.PopAndReturn(UndefinedConstant()); } |
Igor Sheludko
2017/04/20 10:18:42
Please remove {} and add an empty line after this
kozy
2017/04/20 15:14:54
Done.
|
+ BIND(&runtime); |
+ { |
+ Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset, |
+ MachineType::TaggedPointer()); |
+ TailCallStub(CodeFactory::ConsoleAssert(isolate()), context, target, |
Igor Sheludko
2017/04/20 10:18:42
It's simplier to use TailCallBuiltin().
kozy
2017/04/20 15:14:54
I couldn't find TailCallBuiltin in code-assembler,
Igor Sheludko
2017/04/20 15:20:10
I'm sorry. Please add CSA::TailCallBuiltin(), see
|
+ new_target, argc); |
+ } |
+} |
+ |
+} // namespace internal |
+} // namespace v8 |