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

Unified Diff: src/code-stubs.cc

Issue 1827463003: [stubs] Allow branch combining for Smi overflow checks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index fb5f8881dd979776cd1c60cce06c5582663fe860..920bf3edd1de7f7aced1d5dd69e29410b8a42a83 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -555,11 +555,11 @@ void AddStub::GenerateAssembly(compiler::CodeStubAssembler* assembler) const {
assembler->Bind(&if_rhsissmi);
{
- // TODO(bmeurer): Properly fuse Int64AddWithOverflow on x64
+ // Try fast Smi addition first.
Node* pair = assembler->SmiAddWithOverflow(lhs, rhs);
- Node* result = assembler->Projection(0, pair);
Node* overflow = assembler->Projection(1, pair);
+ // Check if the Smi additon overflowed.
Label if_overflow(assembler), if_notoverflow(assembler);
assembler->Branch(overflow, &if_overflow, &if_notoverflow);
@@ -571,7 +571,7 @@ void AddStub::GenerateAssembly(compiler::CodeStubAssembler* assembler) const {
}
assembler->Bind(&if_notoverflow);
- assembler->Return(result);
+ assembler->Return(assembler->Projection(0, pair));
}
assembler->Bind(&if_rhsisnotsmi);
@@ -919,7 +919,6 @@ void SubtractStub::GenerateAssembly(
{
// Try a fast Smi subtraction first.
Node* pair = assembler->SmiSubWithOverflow(lhs, rhs);
- Node* result = assembler->Projection(0, pair);
Node* overflow = assembler->Projection(1, pair);
// Check if the Smi subtraction overflowed.
@@ -935,7 +934,7 @@ void SubtractStub::GenerateAssembly(
}
assembler->Bind(&if_notoverflow);
- assembler->Return(result);
+ assembler->Return(assembler->Projection(0, pair));
}
assembler->Bind(&if_rhsisnotsmi);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698