Merge "Re-enable thread-safety checking on host, warn when not enabled." into dalvik-dev
diff --git a/src/dex_instruction.cc b/src/dex_instruction.cc
index 1b7d3bb..b18b4d0 100644
--- a/src/dex_instruction.cc
+++ b/src/dex_instruction.cc
@@ -299,7 +299,7 @@
case NEW_INSTANCE:
if (file != NULL) {
uint32_t type_idx = VRegB_21c();
- os << opcode << " v" << VRegA_21c() << ", " << PrettyType(type_idx, *file)
+ os << opcode << " v" << static_cast<int>(VRegA_21c()) << ", " << PrettyType(type_idx, *file)
<< " // type@" << type_idx;
break;
} // else fall-through
@@ -312,7 +312,7 @@
case SGET_SHORT:
if (file != NULL) {
uint32_t field_idx = VRegB_21c();
- os << opcode << " v" << VRegA_21c() << ", " << PrettyField(field_idx, *file, true)
+ os << opcode << " v" << static_cast<int>(VRegA_21c()) << ", " << PrettyField(field_idx, *file, true)
<< " // field@" << field_idx;
break;
} // else fall-through
@@ -325,7 +325,7 @@
case SPUT_SHORT:
if (file != NULL) {
uint32_t field_idx = VRegB_21c();
- os << opcode << " v" << VRegA_21c() << ", " << PrettyField(field_idx, *file, true)
+ os << opcode << " v" << static_cast<int>(VRegA_21c()) << ", " << PrettyField(field_idx, *file, true)
<< " // field@" << field_idx;
break;
} // else fall-through
@@ -350,7 +350,7 @@
case IGET_SHORT:
if (file != NULL) {
uint32_t field_idx = VRegC_22c();
- os << opcode << " v" << VRegA_22c() << ", v" << VRegB_22c() << ", "
+ os << opcode << " v" << static_cast<int>(VRegA_22c()) << ", v" << static_cast<int>(VRegB_22c()) << ", "
<< PrettyField(field_idx, *file, true) << " // field@" << field_idx;
break;
} // else fall-through
@@ -363,21 +363,21 @@
case IPUT_SHORT:
if (file != NULL) {
uint32_t field_idx = VRegC_22c();
- os << opcode << " v" << VRegA_22c() << ", v" << VRegB_22c() << ", "
+ os << opcode << " v" << static_cast<int>(VRegA_22c()) << ", v" << static_cast<int>(VRegB_22c()) << ", "
<< PrettyField(field_idx, *file, true) << " // field@" << field_idx;
break;
} // else fall-through
case INSTANCE_OF:
if (file != NULL) {
uint32_t type_idx = VRegC_22c();
- os << opcode << " v" << VRegA_22c() << ", v" << VRegB_22c() << ", "
+ os << opcode << " v" << static_cast<int>(VRegA_22c()) << ", v" << static_cast<int>(VRegB_22c()) << ", "
<< PrettyType(type_idx, *file) << " // type@" << type_idx;
break;
}
case NEW_ARRAY:
if (file != NULL) {
uint32_t type_idx = VRegC_22c();
- os << opcode << " v" << VRegA_22c() << ", v" << VRegB_22c() << ", "
+ os << opcode << " v" << static_cast<int>(VRegA_22c()) << ", v" << static_cast<int>(VRegB_22c()) << ", "
<< PrettyType(type_idx, *file) << " // type@" << type_idx;
break;
} // else fall-through
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index 2eb0c20..90f5b41 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -3168,7 +3168,7 @@
return NULL;
}
- PcToConreteMethod* pc_to_concrete_method = new PcToConreteMethod();
+ UniquePtr<PcToConreteMethod> pc_to_concrete_method(new PcToConreteMethod());
uint32_t dex_pc = 0;
const uint16_t* insns = code_item_->insns_ ;
const Instruction* inst = Instruction::At(insns);
@@ -3190,7 +3190,7 @@
const RegType& reg_type(line->GetRegisterType(dec_insn.vC));
if (!reg_type.IsPreciseReference()) {
- continue;
+ continue;
}
CHECK(!(reg_type.GetClass()->IsInterface()));
@@ -3229,13 +3229,12 @@
// Now Save the current PC and the concrete method reference to be used
// in compiler driver.
pc_to_concrete_method->Put(dex_pc, concrete_ref );
- }
+ }
if (pc_to_concrete_method->size() == 0) {
- delete pc_to_concrete_method;
return NULL ;
}
- return pc_to_concrete_method;
+ return pc_to_concrete_method.release();
}
const std::vector<uint8_t>* MethodVerifier::GenerateGcMap() {