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

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

Issue 2151163002: [stubs] Improve code generation for ToBoolean. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fix redness. Created 4 years, 5 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/code-factory.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 4d090b83f1823c87cbd18bbb4430dc73c861ca46..da5f5b72c96225ed304be6b1f17d0b4478c347d5 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -99,6 +99,11 @@ class CodeStubAssembler : public compiler::CodeAssembler {
// Check that the value is a positive smi.
compiler::Node* WordIsPositiveSmi(compiler::Node* a);
+ void BranchIfSmiEqual(compiler::Node* a, compiler::Node* b, Label* if_true,
+ Label* if_false) {
+ BranchIf(SmiEqual(a, b), if_true, if_false);
+ }
+
void BranchIfSmiLessThan(compiler::Node* a, compiler::Node* b, Label* if_true,
Label* if_false) {
BranchIf(SmiLessThan(a, b), if_true, if_false);
@@ -114,6 +119,11 @@ class CodeStubAssembler : public compiler::CodeAssembler {
BranchIfFloat64Equal(value, value, if_false, if_true);
}
+ // Branches to {if_true} if ToBoolean applied to {value} yields true,
+ // otherwise goes to {if_false}.
+ void BranchIfToBooleanIsTrue(compiler::Node* value, Label* if_true,
+ Label* if_false);
+
// Load value from current frame by given offset in bytes.
compiler::Node* LoadFromFrame(int offset,
MachineType rep = MachineType::AnyTagged());
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698