summaryrefslogtreecommitdiff
path: root/runtime/dex_file.h
diff options
context:
space:
mode:
author Orion Hodson <oth@google.com> 2017-01-18 09:23:12 +0000
committer Orion Hodson <oth@google.com> 2017-02-14 14:04:33 +0000
commitc069a30d42aefd902c20e8bc09dfad1683f07ded (patch)
tree8bbf72bea7ea5d243b57f8e0ab64b687a9f60e4b /runtime/dex_file.h
parent3f38398380b80d1ded078ebed1211b7e4f51460f (diff)
ART: invoke-custom support
Adds invoke-custom instruction to the interpreter. Bug: 33191717,30550796 Test: art/test/run-test --host 952 Change-Id: I3b754128649a8b3a00ade79ba2518d0e377f3a1e
Diffstat (limited to 'runtime/dex_file.h')
-rw-r--r--runtime/dex_file.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/runtime/dex_file.h b/runtime/dex_file.h
index cf90bca620..20bd52b060 100644
--- a/runtime/dex_file.h
+++ b/runtime/dex_file.h
@@ -264,11 +264,11 @@ class DexFile {
// MethodHandle Types
enum class MethodHandleType : uint16_t { // private
- kPutStatic = 0x0000, // a setter for a given static field.
- kGetStatic = 0x0001, // a getter for a given static field.
- kPutInstance = 0x0002, // a setter for a given instance field.
- kGetInstance = 0x0003, // a getter for a given instance field.
- kInvokeStatic = 0x0004, // an invoker for a given static method
+ kStaticPut = 0x0000, // a setter for a given static field.
+ kStaticGet = 0x0001, // a getter for a given static field.
+ kInstancePut = 0x0002, // a setter for a given instance field.
+ kInstanceGet = 0x0003, // a getter for a given instance field.
+ kInvokeStatic = 0x0004, // an invoker for a given static method.
kInvokeInstance = 0x0005, // invoke_instance : an invoker for a given instance method. This
// can be any non-static method on any class (or interface) except
// for “<init>”.
@@ -279,9 +279,9 @@ class DexFile {
// raw method_handle_item
struct MethodHandleItem {
uint16_t method_handle_type_;
- uint16_t reserved1_; // Reserved for future use.
- uint16_t field_or_method_idx_;
- uint16_t reserved2_; // Reserved for future use.
+ uint16_t reserved1_; // Reserved for future use.
+ uint16_t field_or_method_idx_; // Field index for accessors, method index otherwise.
+ uint16_t reserved2_; // Reserved for future use.
private:
DISALLOW_COPY_AND_ASSIGN(MethodHandleItem);
};
@@ -722,6 +722,20 @@ class DexFile {
return num_method_handles_;
}
+ const MethodHandleItem& GetMethodHandle(uint32_t idx) const {
+ CHECK_LT(idx, NumMethodHandles());
+ return method_handles_[idx];
+ }
+
+ uint32_t NumCallSiteIds() const {
+ return num_call_site_ids_;
+ }
+
+ const CallSiteIdItem& GetCallSiteId(uint32_t idx) const {
+ CHECK_LT(idx, NumCallSiteIds());
+ return call_site_ids_[idx];
+ }
+
// Returns a pointer to the raw memory mapped class_data_item
const uint8_t* GetClassData(const ClassDef& class_def) const {
if (class_def.class_data_off_ == 0) {