summaryrefslogtreecommitdiff
path: root/runtime/verifier/instruction_flags.h
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2014-09-10 14:44:24 -0700
committer Ian Rogers <irogers@google.com> 2014-09-12 14:57:53 -0700
commit7b078e8c04f3e1451dbdd18543c8b9692b5b067e (patch)
tree414229c6b87eb20ea24c40780752da5a3999a49a /runtime/verifier/instruction_flags.h
parentf79ba17defbd9342e44ab9f3de0807054673d3c9 (diff)
Compile time performance improvements focusing on interpret-only.
Reduce virtual method dispatch in the method verifier and make more code inline-able. Add a StringPiece with const char* equality operator to avoid redundant StringPieces and strlens. Remove back link from register line to verifier and pass as argument to reduce size of RegisterLine. Remove instruction length from instruction flags and compute from the instruction, again to reduce size. Add suspend checks to resolve and verify to allow for more easy monitor inflation and reduce contention on Locks::thread_list_suspend_thread_lock_. Change ThrowEarlierClassFailure to throw pre-allocated exception. Avoid calls to Thread::Current() by passing self. Template specialize IsValidClassName. Make ANR reporting with SIGQUIT run using checkpoints rather than suspending all threads. This makes the stack/lock analysis less lock error prone. Extra Barrier assertions and condition variable time out is now returned as a boolean both from Barrier and ConditionVariable::Wait. 2 threaded host x86-64 interpret-only numbers from 341 samples: Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms After change: Avg 139.163% 99% CI 3.027ms to 838.257ms Reduction in average compile time after change is 20.9%. Slow-down without change is 26.5%. Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable could return unresolved type when class loading is disabled. Bug: 17398101 Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
Diffstat (limited to 'runtime/verifier/instruction_flags.h')
-rw-r--r--runtime/verifier/instruction_flags.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/runtime/verifier/instruction_flags.h b/runtime/verifier/instruction_flags.h
index f8abca05b8..36a6e554dd 100644
--- a/runtime/verifier/instruction_flags.h
+++ b/runtime/verifier/instruction_flags.h
@@ -20,24 +20,23 @@
#include <stdint.h>
#include <string>
-#include "base/logging.h"
+#include "base/macros.h"
namespace art {
namespace verifier {
-class InstructionFlags {
+class InstructionFlags FINAL {
public:
- InstructionFlags() : length_(0), flags_(0) {}
+ InstructionFlags() : flags_(0) {}
- void SetLengthInCodeUnits(size_t length) {
- DCHECK_LT(length, 65536u);
- length_ = length;
+ void SetIsOpcode() {
+ flags_ |= 1 << kOpcode;
}
- size_t GetLengthInCodeUnits() {
- return length_;
+ void ClearIsOpcode() {
+ flags_ &= ~(1 << kOpcode);
}
bool IsOpcode() const {
- return length_ != 0;
+ return (flags_ & (1 << kOpcode)) != 0;
}
void SetInTry() {
@@ -117,21 +116,22 @@ class InstructionFlags {
// Register type information flowing into the instruction changed and so the instruction must be
// reprocessed.
kChanged = 1,
+ // The item at this location is an opcode.
+ kOpcode = 2,
// Instruction is contained within a try region.
- kInTry = 2,
+ kInTry = 3,
// Instruction is the target of a branch (ie the start of a basic block).
- kBranchTarget = 3,
+ kBranchTarget = 4,
// Location of interest to the compiler for GC maps and verifier based method sharpening.
- kCompileTimeInfoPoint = 4,
+ kCompileTimeInfoPoint = 5,
// A return instruction.
- kReturn = 5,
+ kReturn = 6,
};
-
- // Size of instruction in code units.
- uint16_t length_;
uint8_t flags_;
};
+COMPILE_ASSERT(sizeof(InstructionFlags) == sizeof(uint8_t), err);
+
} // namespace verifier
} // namespace art