summaryrefslogtreecommitdiffstats
path: root/runtime/oat.h
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-12 13:46:57 -0700
committerBrian Carlstrom <bdc@google.com>2013-07-12 17:49:01 -0700
commit7940e44f4517de5e2634a7e07d58d0fb26160513 (patch)
treeac90242d96229a6942f6e24ab137bc1f8f2e0025 /runtime/oat.h
parent5cd9e3b122f276f610980cbaf0d2ad6ed4cd9088 (diff)
downloadart-7940e44f4517de5e2634a7e07d58d0fb26160513.zip
art-7940e44f4517de5e2634a7e07d58d0fb26160513.tar.gz
art-7940e44f4517de5e2634a7e07d58d0fb26160513.tar.bz2
Create separate Android.mk for main build targets
The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81
Diffstat (limited to 'runtime/oat.h')
-rw-r--r--runtime/oat.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/runtime/oat.h b/runtime/oat.h
new file mode 100644
index 0000000..c67a1a6
--- /dev/null
+++ b/runtime/oat.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_SRC_OAT_H_
+#define ART_SRC_OAT_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "dex_file.h"
+#include "instruction_set.h"
+
+namespace art {
+
+class PACKED(4) OatHeader {
+ public:
+ OatHeader();
+ OatHeader(InstructionSet instruction_set,
+ const std::vector<const DexFile*>* dex_files,
+ uint32_t image_file_location_oat_checksum,
+ uint32_t image_file_location_oat_data_begin,
+ const std::string& image_file_location);
+
+ bool IsValid() const;
+ const char* GetMagic() const;
+ uint32_t GetChecksum() const;
+ void UpdateChecksum(const void* data, size_t length);
+ uint32_t GetDexFileCount() const {
+ DCHECK(IsValid());
+ return dex_file_count_;
+ }
+ uint32_t GetExecutableOffset() const;
+ void SetExecutableOffset(uint32_t executable_offset);
+ const void* GetInterpreterToInterpreterEntry() const;
+ uint32_t GetInterpreterToInterpreterEntryOffset() const;
+ void SetInterpreterToInterpreterEntryOffset(uint32_t offset);
+ const void* GetInterpreterToQuickEntry() const;
+ uint32_t GetInterpreterToQuickEntryOffset() const;
+ void SetInterpreterToQuickEntryOffset(uint32_t offset);
+ const void* GetPortableResolutionTrampoline() const;
+ uint32_t GetPortableResolutionTrampolineOffset() const;
+ void SetPortableResolutionTrampolineOffset(uint32_t offset);
+ const void* GetQuickResolutionTrampoline() const;
+ uint32_t GetQuickResolutionTrampolineOffset() const;
+ void SetQuickResolutionTrampolineOffset(uint32_t offset);
+ InstructionSet GetInstructionSet() const;
+ uint32_t GetImageFileLocationOatChecksum() const;
+ uint32_t GetImageFileLocationOatDataBegin() const;
+ uint32_t GetImageFileLocationSize() const;
+ const uint8_t* GetImageFileLocationData() const;
+ std::string GetImageFileLocation() const;
+
+ private:
+ static const uint8_t kOatMagic[4];
+ static const uint8_t kOatVersion[4];
+
+ uint8_t magic_[4];
+ uint8_t version_[4];
+ uint32_t adler32_checksum_;
+
+ InstructionSet instruction_set_;
+ uint32_t dex_file_count_;
+ uint32_t executable_offset_;
+ uint32_t interpreter_to_interpreter_entry_offset_;
+ uint32_t interpreter_to_quick_entry_offset_;
+ uint32_t portable_resolution_trampoline_offset_;
+ uint32_t quick_resolution_trampoline_offset_;
+
+ uint32_t image_file_location_oat_checksum_;
+ uint32_t image_file_location_oat_data_begin_;
+ uint32_t image_file_location_size_;
+ uint8_t image_file_location_data_[0]; // note variable width data at end
+
+ DISALLOW_COPY_AND_ASSIGN(OatHeader);
+};
+
+class PACKED(4) OatMethodOffsets {
+ public:
+ OatMethodOffsets();
+
+ OatMethodOffsets(uint32_t code_offset,
+ uint32_t frame_size_in_bytes,
+ uint32_t core_spill_mask,
+ uint32_t fp_spill_mask,
+ uint32_t mapping_table_offset,
+ uint32_t vmap_table_offset,
+ uint32_t gc_map_offset
+ );
+
+ ~OatMethodOffsets();
+
+ uint32_t code_offset_;
+ uint32_t frame_size_in_bytes_;
+ uint32_t core_spill_mask_;
+ uint32_t fp_spill_mask_;
+ uint32_t mapping_table_offset_;
+ uint32_t vmap_table_offset_;
+ uint32_t gc_map_offset_;
+};
+
+} // namespace art
+
+#endif // ART_SRC_OAT_H_