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

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

Issue 2361363002: [stubs] Add TruncationMode argument to ToInteger (Closed)
Patch Set: Simplify Created 4 years, 2 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-string.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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 compiler::Node* StringToNumber(compiler::Node* context, 479 compiler::Node* StringToNumber(compiler::Node* context,
480 compiler::Node* input); 480 compiler::Node* input);
481 // Convert an object to a name. 481 // Convert an object to a name.
482 compiler::Node* ToName(compiler::Node* context, compiler::Node* input); 482 compiler::Node* ToName(compiler::Node* context, compiler::Node* input);
483 // Convert a Non-Number object to a Number. 483 // Convert a Non-Number object to a Number.
484 compiler::Node* NonNumberToNumber(compiler::Node* context, 484 compiler::Node* NonNumberToNumber(compiler::Node* context,
485 compiler::Node* input); 485 compiler::Node* input);
486 // Convert any object to a Number. 486 // Convert any object to a Number.
487 compiler::Node* ToNumber(compiler::Node* context, compiler::Node* input); 487 compiler::Node* ToNumber(compiler::Node* context, compiler::Node* input);
488 488
489 enum ToIntegerTruncationMode {
490 kNoTruncation,
491 kTruncateMinusZero,
492 };
493
489 // Convert any object to an Integer. 494 // Convert any object to an Integer.
490 compiler::Node* ToInteger(compiler::Node* context, compiler::Node* input); 495 compiler::Node* ToInteger(compiler::Node* context, compiler::Node* input,
496 ToIntegerTruncationMode mode = kNoTruncation);
491 497
492 // Returns a node that contains a decoded (unsigned!) value of a bit 498 // Returns a node that contains a decoded (unsigned!) value of a bit
493 // field |T| in |word32|. Returns result as an uint32 node. 499 // field |T| in |word32|. Returns result as an uint32 node.
494 template <typename T> 500 template <typename T>
495 compiler::Node* BitFieldDecode(compiler::Node* word32) { 501 compiler::Node* BitFieldDecode(compiler::Node* word32) {
496 return BitFieldDecode(word32, T::kShift, T::kMask); 502 return BitFieldDecode(word32, T::kShift, T::kMask);
497 } 503 }
498 504
499 // Returns a node that contains a decoded (unsigned!) value of a bit 505 // Returns a node that contains a decoded (unsigned!) value of a bit
500 // field |T| in |word32|. Returns result as a word-size node. 506 // field |T| in |word32|. Returns result as a word-size node.
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 Label* bailout); 836 Label* bailout);
831 837
832 static const int kElementLoopUnrollThreshold = 8; 838 static const int kElementLoopUnrollThreshold = 8;
833 }; 839 };
834 840
835 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 841 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
836 842
837 } // namespace internal 843 } // namespace internal
838 } // namespace v8 844 } // namespace v8
839 #endif // V8_CODE_STUB_ASSEMBLER_H_ 845 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/builtins/builtins-string.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698