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

Side by Side Diff: src/code-stub-assembler.h

Issue 2293943002: [builtins] Create StringToNumber helper. (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-conversion.cc ('k') | src/code-stub-assembler.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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_
6 #define V8_CODE_STUB_ASSEMBLER_H_ 6 #define V8_CODE_STUB_ASSEMBLER_H_
7 7
8 #include <functional> 8 #include <functional>
9 9
10 #include "src/compiler/code-assembler.h" 10 #include "src/compiler/code-assembler.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 PrimitiveType primitive_type, 347 PrimitiveType primitive_type,
348 char const* method_name); 348 char const* method_name);
349 349
350 // String helpers. 350 // String helpers.
351 // Load a character from a String (might flatten a ConsString). 351 // Load a character from a String (might flatten a ConsString).
352 compiler::Node* StringCharCodeAt(compiler::Node* string, 352 compiler::Node* StringCharCodeAt(compiler::Node* string,
353 compiler::Node* smi_index); 353 compiler::Node* smi_index);
354 // Return the single character string with only {code}. 354 // Return the single character string with only {code}.
355 compiler::Node* StringFromCharCode(compiler::Node* code); 355 compiler::Node* StringFromCharCode(compiler::Node* code);
356 356
357 // Type conversion helpers.
358 // Convert a String to a Number.
359 compiler::Node* StringToNumber(compiler::Node* context,
360 compiler::Node* input);
361
357 // Returns a node that is true if the given bit is set in |word32|. 362 // Returns a node that is true if the given bit is set in |word32|.
358 template <typename T> 363 template <typename T>
359 compiler::Node* BitFieldDecode(compiler::Node* word32) { 364 compiler::Node* BitFieldDecode(compiler::Node* word32) {
360 return BitFieldDecode(word32, T::kShift, T::kMask); 365 return BitFieldDecode(word32, T::kShift, T::kMask);
361 } 366 }
362 367
363 compiler::Node* BitFieldDecode(compiler::Node* word32, uint32_t shift, 368 compiler::Node* BitFieldDecode(compiler::Node* word32, uint32_t shift,
364 uint32_t mask); 369 uint32_t mask);
365 370
366 void SetCounter(StatsCounter* counter, int value); 371 void SetCounter(StatsCounter* counter, int value);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 compiler::Node* SmiShiftBitsConstant(); 613 compiler::Node* SmiShiftBitsConstant();
609 614
610 static const int kElementLoopUnrollThreshold = 8; 615 static const int kElementLoopUnrollThreshold = 8;
611 }; 616 };
612 617
613 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 618 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
614 619
615 } // namespace internal 620 } // namespace internal
616 } // namespace v8 621 } // namespace v8
617 #endif // V8_CODE_STUB_ASSEMBLER_H_ 622 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/builtins/builtins-conversion.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698