Move rest of code related blobs from Method to oat
Change-Id: I55041b564ab65317c8b1f863005f20ba650a0322
diff --git a/src/exception_test.cc b/src/exception_test.cc
index 49a5266..4662119 100644
--- a/src/exception_test.cc
+++ b/src/exception_test.cc
@@ -25,30 +25,34 @@
dex_ = &Runtime::Current()->GetClassLinker()->FindDexFile(my_klass_->GetDexCache());
- ByteArray* fake_code = ByteArray::Alloc(12);
- ASSERT_TRUE(fake_code != NULL);
- IntArray* fake_mapping_data = IntArray::Alloc(2);
- ASSERT_TRUE(fake_mapping_data != NULL);
- fake_mapping_data->Set(0, 3); // offset 3
- fake_mapping_data->Set(1, 3); // maps to dex offset 3
+ for (size_t i = 0 ; i < 12; i++) {
+ fake_code_.push_back(0x70000000 | i);
+ }
+
+ fake_mapping_data_.push_back(2); // first element is count of remaining elements
+ fake_mapping_data_.push_back(3); // offset 3
+ fake_mapping_data_.push_back(3); // maps to dex offset 3
method_f_ = my_klass_->FindVirtualMethod("f", "()I");
ASSERT_TRUE(method_f_ != NULL);
method_f_->SetFrameSizeInBytes(kStackAlignment);
- method_f_->SetReturnPcOffsetInBytes(kStackAlignment-kPointerSize);
- method_f_->SetCodeArray(fake_code, kThumb2);
- method_f_->SetMappingTable(fake_mapping_data);
+ method_f_->SetReturnPcOffsetInBytes(kStackAlignment - kPointerSize);
+ method_f_->SetCode(CompiledMethod::CodePointer(&fake_code_[0], kThumb2));
+ method_f_->SetMappingTable(&fake_mapping_data_[0]);
method_g_ = my_klass_->FindVirtualMethod("g", "(I)V");
ASSERT_TRUE(method_g_ != NULL);
method_g_->SetFrameSizeInBytes(kStackAlignment);
- method_g_->SetReturnPcOffsetInBytes(kStackAlignment-kPointerSize);
- method_g_->SetCodeArray(fake_code, kThumb2);
- method_g_->SetMappingTable(fake_mapping_data);
+ method_g_->SetReturnPcOffsetInBytes(kStackAlignment - kPointerSize);
+ method_g_->SetCode(CompiledMethod::CodePointer(&fake_code_[0], kThumb2));
+ method_g_->SetMappingTable(&fake_mapping_data_[0]);
}
const DexFile* dex_;
+ std::vector<uint8_t> fake_code_;
+ std::vector<uint32_t> fake_mapping_data_;
+
Method* method_f_;
Method* method_g_;