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-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-factory.h" | 7 #include "src/code-factory.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 input_hash, | 200 input_hash, |
201 assembler->Int32Constant(String::kContainsCachedArrayIndexMask)); | 201 assembler->Int32Constant(String::kContainsCachedArrayIndexMask)); |
202 assembler->Branch( | 202 assembler->Branch( |
203 assembler->Word32Equal(input_bit, assembler->Int32Constant(0)), | 203 assembler->Word32Equal(input_bit, assembler->Int32Constant(0)), |
204 &if_inputcached, &if_inputnotcached); | 204 &if_inputcached, &if_inputnotcached); |
205 | 205 |
206 assembler->Bind(&if_inputcached); | 206 assembler->Bind(&if_inputcached); |
207 { | 207 { |
208 // Just return the {input}s cached array index. | 208 // Just return the {input}s cached array index. |
209 Node* input_array_index = | 209 Node* input_array_index = |
210 assembler->BitFieldDecodeWord<String::ArrayIndexValueBits>( | 210 assembler->DecodeWordFromWord32<String::ArrayIndexValueBits>( |
211 input_hash); | 211 input_hash); |
212 assembler->Return(assembler->SmiTag(input_array_index)); | 212 assembler->Return(assembler->SmiTag(input_array_index)); |
213 } | 213 } |
214 | 214 |
215 assembler->Bind(&if_inputnotcached); | 215 assembler->Bind(&if_inputnotcached); |
216 { | 216 { |
217 // Need to fall back to the runtime to convert {input} to double. | 217 // Need to fall back to the runtime to convert {input} to double. |
218 assembler->Return(assembler->CallRuntime(Runtime::kStringParseFloat, | 218 assembler->Return(assembler->CallRuntime(Runtime::kStringParseFloat, |
219 context, input)); | 219 context, input)); |
220 } | 220 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 Node* input_hash = assembler->LoadNameHashField(input); | 333 Node* input_hash = assembler->LoadNameHashField(input); |
334 Node* input_bit = assembler->Word32And( | 334 Node* input_bit = assembler->Word32And( |
335 input_hash, | 335 input_hash, |
336 assembler->Int32Constant(String::kContainsCachedArrayIndexMask)); | 336 assembler->Int32Constant(String::kContainsCachedArrayIndexMask)); |
337 assembler->GotoIf( | 337 assembler->GotoIf( |
338 assembler->Word32NotEqual(input_bit, assembler->Int32Constant(0)), | 338 assembler->Word32NotEqual(input_bit, assembler->Int32Constant(0)), |
339 &if_generic); | 339 &if_generic); |
340 | 340 |
341 // Return the cached array index as result. | 341 // Return the cached array index as result. |
342 Node* input_index = | 342 Node* input_index = |
343 assembler->BitFieldDecode<String::ArrayIndexValueBits>(input_hash); | 343 assembler->DecodeWordFromWord32<String::ArrayIndexValueBits>( |
| 344 input_hash); |
344 Node* result = assembler->SmiTag(input_index); | 345 Node* result = assembler->SmiTag(input_index); |
345 assembler->Return(result); | 346 assembler->Return(result); |
346 } | 347 } |
347 } | 348 } |
348 | 349 |
349 assembler->Bind(&if_generic); | 350 assembler->Bind(&if_generic); |
350 { | 351 { |
351 Node* result = | 352 Node* result = |
352 assembler->CallRuntime(Runtime::kStringParseInt, context, input, radix); | 353 assembler->CallRuntime(Runtime::kStringParseInt, context, input, radix); |
353 assembler->Return(result); | 354 assembler->Return(result); |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 compiler::Node* lhs = assembler->Parameter(0); | 1809 compiler::Node* lhs = assembler->Parameter(0); |
1809 compiler::Node* rhs = assembler->Parameter(1); | 1810 compiler::Node* rhs = assembler->Parameter(1); |
1810 compiler::Node* context = assembler->Parameter(2); | 1811 compiler::Node* context = assembler->Parameter(2); |
1811 | 1812 |
1812 assembler->Return(assembler->StrictEqual(CodeStubAssembler::kNegateResult, | 1813 assembler->Return(assembler->StrictEqual(CodeStubAssembler::kNegateResult, |
1813 lhs, rhs, context)); | 1814 lhs, rhs, context)); |
1814 } | 1815 } |
1815 | 1816 |
1816 } // namespace internal | 1817 } // namespace internal |
1817 } // namespace v8 | 1818 } // namespace v8 |
OLD | NEW |