Chromium Code Reviews| Index: runtime/vm/stub_code_arm64_test.cc |
| diff --git a/runtime/vm/stub_code_arm64_test.cc b/runtime/vm/stub_code_arm64_test.cc |
| index e489ced4dca19591b8b79a1e72dca734def66c1f..c1c70e07a0e277dcd582832cc65882c4d0f1db34 100644 |
| --- a/runtime/vm/stub_code_arm64_test.cc |
| +++ b/runtime/vm/stub_code_arm64_test.cc |
| @@ -67,18 +67,21 @@ TEST_CASE(CallRuntimeStubCode) { |
| // Test calls to stub code which calls into a leaf runtime entry. |
| static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler, |
| - const char* value1, |
| - const char* value2) { |
| - const Bigint& bigint1 = |
| - Bigint::ZoneHandle(Bigint::NewFromCString(value1, Heap::kOld)); |
| - const Bigint& bigint2 = |
| - Bigint::ZoneHandle(Bigint::NewFromCString(value2, Heap::kOld)); |
| + const char* str_value, |
| + intptr_t lhs_index_value, |
| + intptr_t rhs_index_value, |
| + intptr_t length_value) { |
| + const String& str = String::ZoneHandle(String::New(str_value, Heap::kOld)); |
| + const Smi& lhs_index = Smi::ZoneHandle(Smi::New(lhs_index_value)); |
| + const Smi& rhs_index = Smi::ZoneHandle(Smi::New(rhs_index_value)); |
| + const Smi& length = Smi::ZoneHandle(Smi::New(length_value)); |
| __ EnterDartFrame(0); |
| __ ReserveAlignedFrameSpace(0); |
| - __ LoadObject(R0, bigint1); // Set up argument 1 bigint1. |
| - __ LoadObject(R1, bigint2); // Set up argument 2 bigint2. |
| - __ CallRuntime(kBigintCompareRuntimeEntry, 2); |
| - __ SmiTag(R0); |
| + __ LoadObject(R0, str); |
| + __ LoadObject(R1, lhs_index); |
| + __ LoadObject(R2, rhs_index); |
| + __ LoadObject(R3, length); |
| + __ CallRuntime(kCaseInsensitiveCompareUC16RuntimeEntry, 4); |
| __ LeaveDartFrame(); |
| __ ret(); // Return value is in R0. |
| } |
| @@ -86,17 +89,20 @@ static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler, |
| TEST_CASE(CallLeafRuntimeStubCode) { |
| extern const Function& RegisterFakeFunction(const char* name, |
| const Code& code); |
| - const char* value1 = "0xAAABBCCDDAABBCCDD"; |
| - const char* value2 = "0xAABBCCDDAABBCCDD"; |
| + const char* str_value = "abAB"; |
| + intptr_t lhs_index_value = 0; |
| + intptr_t rhs_index_value = 2; |
| + intptr_t length_value = 2; |
| const char* kName = "Test_CallLeafRuntimeStubCode"; |
| Assembler _assembler_; |
|
zra
2017/07/26 16:12:23
It seems like giving this a weird name might be un
alexmarkov
2017/07/26 20:14:13
Done.
|
| - GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2); |
| + GenerateCallToCallLeafRuntimeStub(&_assembler_, str_value, lhs_index_value, |
| + rhs_index_value, length_value); |
| const Code& code = Code::Handle(Code::FinalizeCode( |
| *CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_)); |
| const Function& function = RegisterFakeFunction(kName, code); |
| - Smi& result = Smi::Handle(); |
| + Instance& result = Instance::Handle(); |
| result ^= DartEntry::InvokeFunction(function, Object::empty_array()); |
| - EXPECT_EQ(1, result.Value()); |
| + EXPECT_EQ(Bool::True().raw(), result.raw()); |
| } |
| } // namespace dart |