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

Unified Diff: src/interpreter/bytecode-array-builder.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 | « no previous file | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index 98703473d7937ad8c9aea8e53b47d821a616fb84..d9f1c4a5ab58849c341f51e848621a2ff67393cd 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -297,8 +297,13 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
// Type feedback will be recorded in the |feedback_slot|
BytecodeArrayBuilder& CountOperation(Token::Value op, int feedback_slot);
+ enum class ToBooleanMode {
+ kConvertToBoolean, // Perform ToBoolean conversion on accumulator.
+ kAlreadyBoolean, // Accumulator is already a Boolean.
+ };
+
// Unary Operators.
- BytecodeArrayBuilder& LogicalNot();
+ BytecodeArrayBuilder& LogicalNot(ToBooleanMode mode);
BytecodeArrayBuilder& TypeOf();
// Expects a heap object in the accumulator. Returns its super constructor in
@@ -331,8 +336,10 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label);
BytecodeArrayBuilder& Jump(BytecodeLabel* label);
- BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label);
- BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label);
+ BytecodeArrayBuilder& JumpLoop(BytecodeLabel* label, int loop_depth);
+
+ BytecodeArrayBuilder& JumpIfTrue(ToBooleanMode mode, BytecodeLabel* label);
+ BytecodeArrayBuilder& JumpIfFalse(ToBooleanMode mode, BytecodeLabel* label);
BytecodeArrayBuilder& JumpIfNotHole(BytecodeLabel* label);
BytecodeArrayBuilder& JumpIfJSReceiver(BytecodeLabel* label);
BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label);
@@ -343,7 +350,6 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
NilValue nil);
BytecodeArrayBuilder& JumpIfNotNil(BytecodeLabel* label, Token::Value op,
NilValue nil);
- BytecodeArrayBuilder& JumpLoop(BytecodeLabel* label, int loop_depth);
BytecodeArrayBuilder& StackCheck(int position);
@@ -505,6 +511,9 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder);
};
+V8_EXPORT_PRIVATE std::ostream& operator<<(
+ std::ostream& os, const BytecodeArrayBuilder::ToBooleanMode& mode);
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698