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

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

Issue 2302923002: [stubs] Port ToName stub to TurboFan. (Closed)
Patch Set: Addressed nits. Created 4 years, 3 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.h ('k') | src/code-factory.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 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 void Builtins::Generate_StringToNumber(CodeStubAssembler* assembler) { 112 void Builtins::Generate_StringToNumber(CodeStubAssembler* assembler) {
113 typedef compiler::Node Node; 113 typedef compiler::Node Node;
114 typedef TypeConversionDescriptor Descriptor; 114 typedef TypeConversionDescriptor Descriptor;
115 115
116 Node* input = assembler->Parameter(Descriptor::kArgument); 116 Node* input = assembler->Parameter(Descriptor::kArgument);
117 Node* context = assembler->Parameter(Descriptor::kContext); 117 Node* context = assembler->Parameter(Descriptor::kContext);
118 118
119 assembler->Return(assembler->StringToNumber(context, input)); 119 assembler->Return(assembler->StringToNumber(context, input));
120 } 120 }
121 121
122 void Builtins::Generate_ToName(CodeStubAssembler* assembler) {
123 typedef compiler::Node Node;
124 typedef TypeConversionDescriptor Descriptor;
125
126 Node* input = assembler->Parameter(Descriptor::kArgument);
127 Node* context = assembler->Parameter(Descriptor::kContext);
128
129 assembler->Return(assembler->ToName(context, input));
130 }
131
122 // ES6 section 7.1.3 ToNumber ( argument ) 132 // ES6 section 7.1.3 ToNumber ( argument )
123 void Builtins::Generate_NonNumberToNumber(CodeStubAssembler* assembler) { 133 void Builtins::Generate_NonNumberToNumber(CodeStubAssembler* assembler) {
124 typedef CodeStubAssembler::Label Label; 134 typedef CodeStubAssembler::Label Label;
125 typedef compiler::Node Node; 135 typedef compiler::Node Node;
126 typedef CodeStubAssembler::Variable Variable; 136 typedef CodeStubAssembler::Variable Variable;
127 typedef TypeConversionDescriptor Descriptor; 137 typedef TypeConversionDescriptor Descriptor;
128 138
129 Node* input = assembler->Parameter(Descriptor::kArgument); 139 Node* input = assembler->Parameter(Descriptor::kArgument);
130 Node* context = assembler->Parameter(Descriptor::kContext); 140 Node* context = assembler->Parameter(Descriptor::kContext);
131 141
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 334
325 assembler->Bind(&return_true); 335 assembler->Bind(&return_true);
326 assembler->Return(assembler->BooleanConstant(true)); 336 assembler->Return(assembler->BooleanConstant(true));
327 337
328 assembler->Bind(&return_false); 338 assembler->Bind(&return_false);
329 assembler->Return(assembler->BooleanConstant(false)); 339 assembler->Return(assembler->BooleanConstant(false));
330 } 340 }
331 341
332 } // namespace internal 342 } // namespace internal
333 } // namespace v8 343 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins.h ('k') | src/code-factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698