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

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

Issue 1919513002: [turbofan] Introduce TruncateTaggedToWord32 simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index a656a963c64c4096559ff1d867481f99dff0a6aa..0f3d9daa92b67804da0fef0ed4261f494ee9ab7b 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -726,17 +726,13 @@ Node* CodeStubAssembler::TruncateTaggedToWord32(Node* context, Node* value) {
return var_result.value();
}
-Node* CodeStubAssembler::TruncateFloat64ToInt32(Node* value) {
- return TruncateFloat64ToInt32JavaScript(value);
-}
-
Node* CodeStubAssembler::TruncateHeapNumberValueToWord32(Node* object) {
Node* value = LoadHeapNumberValue(object);
- return TruncateFloat64ToInt32(value);
+ return TruncateFloat64ToWord32(value);
}
Node* CodeStubAssembler::ChangeFloat64ToTagged(Node* value) {
- Node* value32 = TruncateFloat64ToInt32RoundToZero(value);
+ Node* value32 = RoundFloat64ToInt32(value);
Node* value64 = ChangeInt32ToFloat64(value32);
Label if_valueisint32(this), if_valueisheapnumber(this), if_join(this);
@@ -745,16 +741,9 @@ Node* CodeStubAssembler::ChangeFloat64ToTagged(Node* value) {
Branch(Float64Equal(value, value64), &if_valueisequal, &if_valueisnotequal);
Bind(&if_valueisequal);
{
- Label if_valueiszero(this), if_valueisnotzero(this);
- Branch(Float64Equal(value, Float64Constant(0.0)), &if_valueiszero,
- &if_valueisnotzero);
-
- Bind(&if_valueiszero);
+ GotoUnless(Word32Equal(value32, Int32Constant(0)), &if_valueisint32);
BranchIfInt32LessThan(Float64ExtractHighWord32(value), Int32Constant(0),
&if_valueisheapnumber, &if_valueisint32);
-
- Bind(&if_valueisnotzero);
- Goto(&if_valueisint32);
}
Bind(&if_valueisnotequal);
Goto(&if_valueisheapnumber);

Powered by Google App Engine
This is Rietveld 408576698