| 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 #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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |