More memory leak fixes.

TBR=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/437523002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22749 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 67388ea2
......@@ -35,6 +35,8 @@ class InstructionTester : public HandleAndZoneScope {
machine(zone(), kMachineWord32),
code(NULL) {}
~InstructionTester() { delete code; }
Isolate* isolate;
Graph graph;
Schedule schedule;
......
......@@ -260,22 +260,23 @@ static void CheckToI32(Node* old_input, Node* new_input, bool is_signed) {
class JSBitwiseShiftTypedLoweringTester : public JSTypedLoweringTester {
public:
static const int kNumberOps = 6;
Operator** ops;
bool* signedness;
Operator* ops[kNumberOps];
bool signedness[kNumberOps];
JSBitwiseShiftTypedLoweringTester() {
Operator* o[] = {javascript.ShiftLeft(), machine.Word32Shl(),
javascript.ShiftRight(), machine.Word32Sar(),
javascript.ShiftRightLogical(), machine.Word32Shr()};
ops = static_cast<Operator**>(malloc(sizeof(o)));
memcpy(ops, o, sizeof(o));
// Expected signedness of left and right conversions above.
bool s[] = {true, false, true, false, false, false};
int i = 0;
set(i++, javascript.ShiftLeft(), true);
set(i++, machine.Word32Shl(), false);
set(i++, javascript.ShiftRight(), true);
set(i++, machine.Word32Sar(), false);
set(i++, javascript.ShiftRightLogical(), false);
set(i++, machine.Word32Shr(), false);
}
signedness = static_cast<bool*>(malloc(sizeof(s)));
memcpy(signedness, s, sizeof(s));
private:
void set(int idx, Operator* op, bool s) {
ops[idx] = op;
signedness[idx] = s;
}
};
......@@ -319,22 +320,23 @@ TEST(Int32BitwiseShifts) {
class JSBitwiseTypedLoweringTester : public JSTypedLoweringTester {
public:
static const int kNumberOps = 6;
Operator** ops;
bool* signedness;
Operator* ops[kNumberOps];
bool signedness[kNumberOps];
JSBitwiseTypedLoweringTester() {
Operator* o[] = {javascript.BitwiseOr(), machine.Word32Or(),
javascript.BitwiseXor(), machine.Word32Xor(),
javascript.BitwiseAnd(), machine.Word32And()};
ops = static_cast<Operator**>(malloc(sizeof(o)));
memcpy(ops, o, sizeof(o));
// Expected signedness of left and right conversions above.
bool s[] = {true, true, true, true, true, true};
signedness = static_cast<bool*>(malloc(sizeof(s)));
memcpy(signedness, s, sizeof(s));
int i = 0;
set(i++, javascript.BitwiseOr(), true);
set(i++, machine.Word32Or(), true);
set(i++, javascript.BitwiseXor(), true);
set(i++, machine.Word32Xor(), true);
set(i++, javascript.BitwiseAnd(), true);
set(i++, machine.Word32And(), true);
}
private:
void set(int idx, Operator* op, bool s) {
ops[idx] = op;
signedness[idx] = s;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment