| OLD | NEW |
| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // Note: We cannot tail call to the runtime here, as js-to-wasm | 134 // Note: We cannot tail call to the runtime here, as js-to-wasm |
| 135 // trampolines also use this code currently, and they declare all | 135 // trampolines also use this code currently, and they declare all |
| 136 // outgoing parameters as untagged, while we would push a tagged | 136 // outgoing parameters as untagged, while we would push a tagged |
| 137 // object here. | 137 // object here. |
| 138 Node* result = | 138 Node* result = |
| 139 assembler->CallRuntime(Runtime::kStringToNumber, context, input); | 139 assembler->CallRuntime(Runtime::kStringToNumber, context, input); |
| 140 assembler->Return(result); | 140 assembler->Return(result); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 void Builtins::Generate_ToName(CodeStubAssembler* assembler) { |
| 145 typedef compiler::Node Node; |
| 146 typedef TypeConversionDescriptor Descriptor; |
| 147 |
| 148 Node* input = assembler->Parameter(Descriptor::kArgument); |
| 149 Node* context = assembler->Parameter(Descriptor::kContext); |
| 150 |
| 151 assembler->Return(assembler->ToName(context, input)); |
| 152 } |
| 153 |
| 144 // ES6 section 7.1.3 ToNumber ( argument ) | 154 // ES6 section 7.1.3 ToNumber ( argument ) |
| 145 void Builtins::Generate_NonNumberToNumber(CodeStubAssembler* assembler) { | 155 void Builtins::Generate_NonNumberToNumber(CodeStubAssembler* assembler) { |
| 146 typedef CodeStubAssembler::Label Label; | 156 typedef CodeStubAssembler::Label Label; |
| 147 typedef compiler::Node Node; | 157 typedef compiler::Node Node; |
| 148 typedef CodeStubAssembler::Variable Variable; | 158 typedef CodeStubAssembler::Variable Variable; |
| 149 typedef TypeConversionDescriptor Descriptor; | 159 typedef TypeConversionDescriptor Descriptor; |
| 150 | 160 |
| 151 Node* input = assembler->Parameter(Descriptor::kArgument); | 161 Node* input = assembler->Parameter(Descriptor::kArgument); |
| 152 Node* context = assembler->Parameter(Descriptor::kContext); | 162 Node* context = assembler->Parameter(Descriptor::kContext); |
| 153 | 163 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 358 |
| 349 assembler->Bind(&return_true); | 359 assembler->Bind(&return_true); |
| 350 assembler->Return(assembler->BooleanConstant(true)); | 360 assembler->Return(assembler->BooleanConstant(true)); |
| 351 | 361 |
| 352 assembler->Bind(&return_false); | 362 assembler->Bind(&return_false); |
| 353 assembler->Return(assembler->BooleanConstant(false)); | 363 assembler->Return(assembler->BooleanConstant(false)); |
| 354 } | 364 } |
| 355 | 365 |
| 356 } // namespace internal | 366 } // namespace internal |
| 357 } // namespace v8 | 367 } // namespace v8 |
| OLD | NEW |