Revision: 12681
Author: [email protected]
Date: Tue Oct 9 06:53:24 2012
Log: Make sure that the context argument of HAdd is never NULL.
Although this doesn't hurt currently, it hurts any future compiler
pass relying on the invariant that no operand is NULL.
[email protected]
Review URL: https://codereview.chromium.org/11088026
http://code.google.com/p/v8/source/detail?r=12681
Modified:
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Mon Oct 1 09:22:43
2012
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Tue Oct 9 06:53:24
2012
@@ -53,6 +53,7 @@
#define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
+ V(BinaryOperation) \
V(BitwiseBinaryOperation) \
V(ControlInstruction) \
V(Instruction) \
@@ -2677,6 +2678,8 @@
virtual bool IsCommutative() const { return false; }
virtual void PrintDataTo(StringStream* stream);
+
+ DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation)
};
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Mon Oct 1 09:22:43 2012
+++ /branches/bleeding_edge/src/hydrogen.cc Tue Oct 9 06:53:24 2012
@@ -3567,7 +3567,10 @@
HConstant(new_offset, Representation::Integer32());
if (*add == NULL) {
new_constant->InsertBefore(check);
- *add = new(BasicBlock()->zone()) HAdd(NULL,
+ // Because of the bounds checks elimination algorithm, the index is
always
+ // an HAdd or an HSub here, so we can safely cast to an
HBinaryOperation.
+ HValue* context = HBinaryOperation::cast(check->index())->context();
+ *add = new(BasicBlock()->zone()) HAdd(context,
original_value,
new_constant);
(*add)->AssumeRepresentation(representation);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev