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

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

Issue 2367413002: [turbofan] Introduces the BitcastWordToTaggedSigned and BitcastTaggedToWord opcodes. (Closed)
Patch Set: Update. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/code-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 386cb665f19a0ded59fa64ede49ff5341dd8b134..5abfe384af369e2d1573bacdd219aa92af902c60 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -296,7 +296,7 @@ Node* CodeStubAssembler::SmiShiftBitsConstant() {
Node* CodeStubAssembler::SmiFromWord32(Node* value) {
value = ChangeInt32ToIntPtr(value);
- return WordShl(value, SmiShiftBitsConstant());
+ return BitcastWordToTaggedSigned(WordShl(value, SmiShiftBitsConstant()));
}
Node* CodeStubAssembler::SmiTag(Node* value) {
@@ -304,15 +304,15 @@ Node* CodeStubAssembler::SmiTag(Node* value) {
if (ToInt32Constant(value, constant_value) && Smi::IsValid(constant_value)) {
return SmiConstant(Smi::FromInt(constant_value));
}
- return WordShl(value, SmiShiftBitsConstant());
+ return BitcastWordToTaggedSigned(WordShl(value, SmiShiftBitsConstant()));
}
Node* CodeStubAssembler::SmiUntag(Node* value) {
- return WordSar(value, SmiShiftBitsConstant());
+ return WordSar(BitcastTaggedToWord(value), SmiShiftBitsConstant());
}
Node* CodeStubAssembler::SmiToWord32(Node* value) {
- Node* result = WordSar(value, SmiShiftBitsConstant());
+ Node* result = SmiUntag(value);
if (Is64()) {
result = TruncateInt64ToInt32(result);
}
« no previous file with comments | « no previous file | src/compiler/code-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698