Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 66bc38b2601e6df026f548dd7fe10c20de03343f..9ad7f586b6f32ee82b434461215714688c8de2c9 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -4353,7 +4353,10 @@ void FullCodeGenerator::EmitUnaryOperation(UnaryOperation* expr, |
const char* comment) { |
// TODO(svenpanne): Allowing format strings in Comment would be nice here... |
Comment cmt(masm_, comment); |
- UnaryOpStub stub(expr->op()); |
+ bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); |
+ UnaryOverwriteMode overwrite = |
+ can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; |
+ UnaryOpStub stub(expr->op(), overwrite); |
// UnaryOpStub expects the argument to be in the |
// accumulator register rax. |
VisitForAccumulatorValue(expr->expression()); |