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

Unified Diff: src/code-stub-assembler.h

Issue 2436893003: [stubs] Cleanup CSA::BitFieldDecode() and friends. (Closed)
Patch Set: Addressing comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-sharedarraybuffer.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index 919df75fc2bfe5f75e86aec8119e58dd0a15def0..6e62fc94bba19134c1710602b163a081869f4238 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -656,20 +656,45 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Returns a node that contains a decoded (unsigned!) value of a bit
// field |T| in |word32|. Returns result as an uint32 node.
template <typename T>
- compiler::Node* BitFieldDecode(compiler::Node* word32) {
- return BitFieldDecode(word32, T::kShift, T::kMask);
+ compiler::Node* DecodeWord32(compiler::Node* word32) {
+ return DecodeWord32(word32, T::kShift, T::kMask);
+ }
+
+ // Returns a node that contains a decoded (unsigned!) value of a bit
+ // field |T| in |word|. Returns result as a word-size node.
+ template <typename T>
+ compiler::Node* DecodeWord(compiler::Node* word) {
+ return DecodeWord(word, T::kShift, T::kMask);
}
// Returns a node that contains a decoded (unsigned!) value of a bit
// field |T| in |word32|. Returns result as a word-size node.
template <typename T>
- compiler::Node* BitFieldDecodeWord(compiler::Node* word32) {
- return ChangeUint32ToWord(BitFieldDecode<T>(word32));
+ compiler::Node* DecodeWordFromWord32(compiler::Node* word32) {
+ return DecodeWord<T>(ChangeUint32ToWord(word32));
}
// Decodes an unsigned (!) value from |word32| to an uint32 node.
- compiler::Node* BitFieldDecode(compiler::Node* word32, uint32_t shift,
- uint32_t mask);
+ compiler::Node* DecodeWord32(compiler::Node* word32, uint32_t shift,
+ uint32_t mask);
+
+ // Decodes an unsigned (!) value from |word| to a word-size node.
+ compiler::Node* DecodeWord(compiler::Node* word, uint32_t shift,
+ uint32_t mask);
+
+ // Returns true if any of the |T|'s bits in given |word32| are set.
+ template <typename T>
+ compiler::Node* IsSetWord32(compiler::Node* word32) {
+ return Word32NotEqual(Word32And(word32, Int32Constant(T::kMask)),
+ Int32Constant(0));
+ }
+
+ // Returns true if any of the |T|'s bits in given |word| are set.
+ template <typename T>
+ compiler::Node* IsSetWord(compiler::Node* word) {
+ return WordNotEqual(WordAnd(word, IntPtrConstant(T::kMask)),
+ IntPtrConstant(0));
+ }
void SetCounter(StatsCounter* counter, int value);
void IncrementCounter(StatsCounter* counter, int delta);
« no previous file with comments | « src/builtins/builtins-sharedarraybuffer.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698