Index: test/cctest/interpreter/test-interpreter.cc |
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc |
index 52e53727e12ca4c3038be54b5234c0ab2ebb19df..b2df1e3459f49be699d5e936d9fe5cacc3662526 100644 |
--- a/test/cctest/interpreter/test-interpreter.cc |
+++ b/test/cctest/interpreter/test-interpreter.cc |
@@ -362,117 +362,6 @@ TEST(InterpreterLoadStoreRegisters) { |
} |
-TEST(InterpreterExchangeRegisters) { |
- for (int locals_count = 2; locals_count < 300; locals_count += 126) { |
- HandleAndZoneScope handles; |
- for (int exchanges = 1; exchanges < 4; exchanges++) { |
- BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone()); |
- builder.set_locals_count(locals_count); |
- builder.set_context_count(0); |
- builder.set_parameter_count(0); |
- |
- Register r0(0); |
- Register r1(locals_count - 1); |
- builder.LoadTrue(); |
- builder.StoreAccumulatorInRegister(r0); |
- builder.ExchangeRegisters(r0, r1); |
- builder.LoadFalse(); |
- builder.StoreAccumulatorInRegister(r0); |
- |
- bool expected = false; |
- for (int i = 0; i < exchanges; i++) { |
- builder.ExchangeRegisters(r0, r1); |
- expected = !expected; |
- } |
- builder.LoadAccumulatorWithRegister(r0); |
- builder.Return(); |
- Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); |
- InterpreterTester tester(handles.main_isolate(), bytecode_array); |
- auto callable = tester.GetCallable<>(); |
- Handle<Object> return_val = callable().ToHandleChecked(); |
- Handle<Object> expected_val = |
- handles.main_isolate()->factory()->ToBoolean(expected); |
- CHECK(return_val.is_identical_to(expected_val)); |
- } |
- } |
-} |
- |
- |
-TEST(InterpreterExchangeRegistersWithParameter) { |
- for (int locals_count = 2; locals_count < 300; locals_count += 126) { |
- HandleAndZoneScope handles; |
- for (int exchanges = 1; exchanges < 4; exchanges++) { |
- BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone()); |
- builder.set_locals_count(locals_count); |
- builder.set_context_count(0); |
- builder.set_parameter_count(3); |
- |
- Register r0 = Register::FromParameterIndex(2, 3); |
- Register r1(locals_count - 1); |
- builder.LoadTrue(); |
- builder.StoreAccumulatorInRegister(r0); |
- builder.ExchangeRegisters(r0, r1); |
- builder.LoadFalse(); |
- builder.StoreAccumulatorInRegister(r0); |
- |
- bool expected = false; |
- for (int i = 0; i < exchanges; i++) { |
- builder.ExchangeRegisters(r0, r1); |
- expected = !expected; |
- } |
- builder.LoadAccumulatorWithRegister(r0); |
- builder.Return(); |
- Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); |
- InterpreterTester tester(handles.main_isolate(), bytecode_array); |
- auto callable = tester.GetCallable<>(); |
- Handle<Object> return_val = callable().ToHandleChecked(); |
- Handle<Object> expected_val = |
- handles.main_isolate()->factory()->ToBoolean(expected); |
- CHECK(return_val.is_identical_to(expected_val)); |
- } |
- } |
-} |
- |
- |
-TEST(InterpreterExchangeWideRegisters) { |
- for (int locals_count = 3; locals_count < 300; locals_count += 126) { |
- HandleAndZoneScope handles; |
- for (int exchanges = 0; exchanges < 7; exchanges++) { |
- BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone()); |
- builder.set_locals_count(locals_count); |
- builder.set_context_count(0); |
- builder.set_parameter_count(0); |
- |
- Register r0(0); |
- Register r1(locals_count - 1); |
- Register r2(locals_count - 2); |
- builder.LoadLiteral(Smi::FromInt(200)); |
- builder.StoreAccumulatorInRegister(r0); |
- builder.ExchangeRegisters(r0, r1); |
- builder.LoadLiteral(Smi::FromInt(100)); |
- builder.StoreAccumulatorInRegister(r0); |
- builder.ExchangeRegisters(r0, r2); |
- builder.LoadLiteral(Smi::FromInt(0)); |
- builder.StoreAccumulatorInRegister(r0); |
- for (int i = 0; i < exchanges; i++) { |
- builder.ExchangeRegisters(r1, r2); |
- builder.ExchangeRegisters(r0, r1); |
- } |
- builder.LoadAccumulatorWithRegister(r0); |
- builder.Return(); |
- Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); |
- InterpreterTester tester(handles.main_isolate(), bytecode_array); |
- auto callable = tester.GetCallable<>(); |
- Handle<Object> return_val = callable().ToHandleChecked(); |
- Handle<Object> expected_val = |
- handles.main_isolate()->factory()->NewNumberFromInt(100 * |
- (exchanges % 3)); |
- CHECK(return_val.is_identical_to(expected_val)); |
- } |
- } |
-} |
- |
- |
static const Token::Value kShiftOperators[] = { |
Token::Value::SHL, Token::Value::SAR, Token::Value::SHR}; |