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

Unified Diff: src/interpreter/bytecode-generator.h

Issue 2795183002: [Interpreter] Move ToBoolean elision in BytecodeGenerator. (Closed)
Patch Set: tests Created 3 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index 846731b16d2364eb7dd5864ae9648cb039dacda3..01d1b602f903731df6e5197e3195e83714e95724 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -53,7 +53,10 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
class TestResultScope;
class ValueResultScope;
+ using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode;
+
enum class TestFallthrough { kThen, kElse, kNone };
+ enum class TypeHint { kAny, kBoolean };
void GenerateBytecodeBody();
void AllocateDeferredConstants(Isolate* isolate);
@@ -162,7 +165,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
// Visitors for obtaining expression result in the accumulator, in a
// register, or just getting the effect.
- void VisitForAccumulatorValue(Expression* expr);
+ TypeHint VisitForAccumulatorValue(Expression* expr);
void VisitForAccumulatorValueOrTheHole(Expression* expr);
MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr);
void VisitForRegisterValue(Expression* expr, Register destination);
@@ -176,6 +179,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
inline Runtime::FunctionId StoreToSuperRuntimeId();
inline Runtime::FunctionId StoreKeyedToSuperRuntimeId();
+ ToBooleanMode ToBooleanModeFromTypeHint(TypeHint type_hint);
+
inline BytecodeArrayBuilder* builder() const { return builder_; }
inline Zone* zone() const { return zone_; }
inline DeclarationScope* closure_scope() const { return closure_scope_; }
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698