Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: src/builtins/builtins-console-gen.cc

Issue 2828933002: [console] fast console.assert(true) (Closed)
Patch Set: addressed comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins.cc ('k') | src/builtins/builtins-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f8475d1632c1b89a9fe62a9e3b9c30067d9400c0
--- /dev/null
+++ b/src/builtins/builtins-console-gen.cc
@@ -0,0 +1,38 @@
+// 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);
+ GotoIf(Word32Equal(argc, Int32Constant(0)), &runtime);
+
+ CodeStubArguments args(this, ChangeInt32ToIntPtr(argc));
+ BranchIfToBooleanIsTrue(args.AtIndex(0), &out, &runtime);
+ BIND(&out);
+ args.PopAndReturn(UndefinedConstant());
+
+ BIND(&runtime);
+ {
+ Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset,
+ MachineType::TaggedPointer());
+ TailCallBuiltin(Builtins::kConsoleAssert, context, target, new_target,
+ argc);
+ }
+}
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/builtins/builtins.cc ('k') | src/builtins/builtins-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698