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

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

Issue 2752143004: [refactor] Separate generated builtins and C++ builtins into separate files (Closed)
Patch Set: tentative gcmole fix Created 3 years, 9 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-boolean.cc ('k') | src/builtins/builtins-constructor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-boolean-gen.cc
diff --git a/src/builtins/builtins-boolean-gen.cc b/src/builtins/builtins-boolean-gen.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0976f1cad12ba3ec18a210d78065af0828b3d2dc
--- /dev/null
+++ b/src/builtins/builtins-boolean-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 {
+
+// -----------------------------------------------------------------------------
+// ES6 section 19.3 Boolean Objects
+
+// ES6 section 19.3.3.2 Boolean.prototype.toString ( )
+TF_BUILTIN(BooleanPrototypeToString, CodeStubAssembler) {
+ Node* receiver = Parameter(0);
+ Node* context = Parameter(3);
+
+ Node* value = ToThisValue(context, receiver, PrimitiveType::kBoolean,
+ "Boolean.prototype.toString");
+ Node* result = LoadObjectField(value, Oddball::kToStringOffset);
+ Return(result);
+}
+
+// ES6 section 19.3.3.3 Boolean.prototype.valueOf ( )
+TF_BUILTIN(BooleanPrototypeValueOf, CodeStubAssembler) {
+ Node* receiver = Parameter(0);
+ Node* context = Parameter(3);
+
+ Node* result = ToThisValue(context, receiver, PrimitiveType::kBoolean,
+ "Boolean.prototype.valueOf");
+ Return(result);
+}
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/builtins/builtins-boolean.cc ('k') | src/builtins/builtins-constructor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698