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

Side by Side Diff: src/builtins/builtins-boolean.cc

Issue 2498073002: [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: one more attempt Created 4 years, 1 month 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-array.cc ('k') | src/builtins/builtins-conversion.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.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 16 matching lines...) Expand all
27 DCHECK(*target == target->native_context()->boolean_function()); 27 DCHECK(*target == target->native_context()->boolean_function());
28 Handle<JSObject> result; 28 Handle<JSObject> result;
29 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 29 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
30 JSObject::New(target, new_target)); 30 JSObject::New(target, new_target));
31 Handle<JSValue>::cast(result)->set_value( 31 Handle<JSValue>::cast(result)->set_value(
32 isolate->heap()->ToBoolean(value->BooleanValue())); 32 isolate->heap()->ToBoolean(value->BooleanValue()));
33 return *result; 33 return *result;
34 } 34 }
35 35
36 // ES6 section 19.3.3.2 Boolean.prototype.toString ( ) 36 // ES6 section 19.3.3.2 Boolean.prototype.toString ( )
37 void Builtins::Generate_BooleanPrototypeToString(CodeStubAssembler* assembler) { 37 void Builtins::Generate_BooleanPrototypeToString(
38 compiler::CodeAssemblerState* state) {
38 typedef compiler::Node Node; 39 typedef compiler::Node Node;
40 CodeStubAssembler assembler(state);
39 41
40 Node* receiver = assembler->Parameter(0); 42 Node* receiver = assembler.Parameter(0);
41 Node* context = assembler->Parameter(3); 43 Node* context = assembler.Parameter(3);
42 44
43 Node* value = assembler->ToThisValue( 45 Node* value = assembler.ToThisValue(
44 context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.toString"); 46 context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.toString");
45 Node* result = assembler->LoadObjectField(value, Oddball::kToStringOffset); 47 Node* result = assembler.LoadObjectField(value, Oddball::kToStringOffset);
46 assembler->Return(result); 48 assembler.Return(result);
47 } 49 }
48 50
49 // ES6 section 19.3.3.3 Boolean.prototype.valueOf ( ) 51 // ES6 section 19.3.3.3 Boolean.prototype.valueOf ( )
50 void Builtins::Generate_BooleanPrototypeValueOf(CodeStubAssembler* assembler) { 52 void Builtins::Generate_BooleanPrototypeValueOf(
53 compiler::CodeAssemblerState* state) {
51 typedef compiler::Node Node; 54 typedef compiler::Node Node;
55 CodeStubAssembler assembler(state);
52 56
53 Node* receiver = assembler->Parameter(0); 57 Node* receiver = assembler.Parameter(0);
54 Node* context = assembler->Parameter(3); 58 Node* context = assembler.Parameter(3);
55 59
56 Node* result = assembler->ToThisValue( 60 Node* result = assembler.ToThisValue(
57 context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.valueOf"); 61 context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.valueOf");
58 assembler->Return(result); 62 assembler.Return(result);
59 } 63 }
60 64
61 } // namespace internal 65 } // namespace internal
62 } // namespace v8 66 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-array.cc ('k') | src/builtins/builtins-conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698