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

Side by Side Diff: src/builtins/builtins-boolean.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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-async-iterator-gen.cc ('k') | src/builtins/builtins-boolean-gen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-stub-assembler.h"
8 #include "src/counters.h" 7 #include "src/counters.h"
9 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
10 9
11 namespace v8 { 10 namespace v8 {
12 namespace internal { 11 namespace internal {
13 12
14 // ----------------------------------------------------------------------------- 13 // -----------------------------------------------------------------------------
15 // ES6 section 19.3 Boolean Objects 14 // ES6 section 19.3 Boolean Objects
16 15
17 // ES6 section 19.3.1.1 Boolean ( value ) for the [[Call]] case. 16 // ES6 section 19.3.1.1 Boolean ( value ) for the [[Call]] case.
(...skipping 11 matching lines...) Expand all
29 Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target()); 28 Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target());
30 DCHECK(*target == target->native_context()->boolean_function()); 29 DCHECK(*target == target->native_context()->boolean_function());
31 Handle<JSObject> result; 30 Handle<JSObject> result;
32 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 31 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
33 JSObject::New(target, new_target)); 32 JSObject::New(target, new_target));
34 Handle<JSValue>::cast(result)->set_value( 33 Handle<JSValue>::cast(result)->set_value(
35 isolate->heap()->ToBoolean(value->BooleanValue())); 34 isolate->heap()->ToBoolean(value->BooleanValue()));
36 return *result; 35 return *result;
37 } 36 }
38 37
39 // ES6 section 19.3.3.2 Boolean.prototype.toString ( )
40 void Builtins::Generate_BooleanPrototypeToString(
41 compiler::CodeAssemblerState* state) {
42 typedef compiler::Node Node;
43 CodeStubAssembler assembler(state);
44
45 Node* receiver = assembler.Parameter(0);
46 Node* context = assembler.Parameter(3);
47
48 Node* value = assembler.ToThisValue(
49 context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.toString");
50 Node* result = assembler.LoadObjectField(value, Oddball::kToStringOffset);
51 assembler.Return(result);
52 }
53
54 // ES6 section 19.3.3.3 Boolean.prototype.valueOf ( )
55 void Builtins::Generate_BooleanPrototypeValueOf(
56 compiler::CodeAssemblerState* state) {
57 typedef compiler::Node Node;
58 CodeStubAssembler assembler(state);
59
60 Node* receiver = assembler.Parameter(0);
61 Node* context = assembler.Parameter(3);
62
63 Node* result = assembler.ToThisValue(
64 context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.valueOf");
65 assembler.Return(result);
66 }
67
68 } // namespace internal 38 } // namespace internal
69 } // namespace v8 39 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-async-iterator-gen.cc ('k') | src/builtins/builtins-boolean-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698