summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2013-08-05 10:56:33 -0700
committer Ian Rogers <irogers@google.com> 2013-08-12 06:11:35 +0000
commit468532ea115657709bc32ee498e701a4c71762d4 (patch)
tree4f6bd555afe2333df2e748eff72d8e1d23e8ce86 /compiler/driver/compiler_driver.cc
parentf981da1d60864a730f744ef2cc3a19391c8303f2 (diff)
Entry point clean up.
Create set of entry points needed for image methods to avoid fix-up at load time: - interpreter - bridge to interpreter, bridge to compiled code - jni - dlsym lookup - quick - resolution and bridge to interpreter - portable - resolution and bridge to interpreter Fix JNI work around to use JNI work around argument rewriting code that'd been accidentally disabled. Remove abstact method error stub, use interpreter bridge instead. Consolidate trampoline (previously stub) generation in generic helper. Simplify trampolines to jump directly into assembly code, keeps stack crawlable. Dex: replace use of int with ThreadOffset for values that are thread offsets. Tidy entry point routines between interpreter, jni, quick and portable. Change-Id: I52a7c2bbb1b7e0ff8a3c3100b774212309d0828e (cherry picked from commit 848871b4d8481229c32e0d048a9856e5a9a17ef9)
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc78
1 files changed, 26 insertions, 52 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index e7ba402b21..56b629c576 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -41,9 +41,9 @@
#include "mirror/throwable.h"
#include "scoped_thread_state_change.h"
#include "ScopedLocalRef.h"
-#include "stubs/stubs.h"
#include "thread.h"
#include "thread_pool.h"
+#include "trampolines/trampoline_compiler.h"
#include "verifier/method_verifier.h"
#if defined(ART_USE_PORTABLE_COMPILER)
@@ -433,64 +433,38 @@ CompilerTls* CompilerDriver::GetTls() {
return res;
}
+const std::vector<uint8_t>* CompilerDriver::CreateInterpreterToInterpreterBridge() const {
+ return CreateTrampoline(instruction_set_, kInterpreterAbi,
+ INTERPRETER_ENTRYPOINT_OFFSET(pInterpreterToInterpreterBridge));
+}
+
+const std::vector<uint8_t>* CompilerDriver::CreateInterpreterToCompiledCodeBridge() const {
+ return CreateTrampoline(instruction_set_, kInterpreterAbi,
+ INTERPRETER_ENTRYPOINT_OFFSET(pInterpreterToCompiledCodeBridge));
+}
+
+const std::vector<uint8_t>* CompilerDriver::CreateJniDlsymLookup() const {
+ return CreateTrampoline(instruction_set_, kJniAbi, JNI_ENTRYPOINT_OFFSET(pDlsymLookup));
+}
+
const std::vector<uint8_t>* CompilerDriver::CreatePortableResolutionTrampoline() const {
- switch (instruction_set_) {
- case kArm:
- case kThumb2:
- return arm::CreatePortableResolutionTrampoline();
- case kMips:
- return mips::CreatePortableResolutionTrampoline();
- case kX86:
- return x86::CreatePortableResolutionTrampoline();
- default:
- LOG(FATAL) << "Unknown InstructionSet: " << instruction_set_;
- return NULL;
- }
+ return CreateTrampoline(instruction_set_, kPortableAbi,
+ PORTABLE_ENTRYPOINT_OFFSET(pPortableResolutionTrampoline));
}
-const std::vector<uint8_t>* CompilerDriver::CreateQuickResolutionTrampoline() const {
- switch (instruction_set_) {
- case kArm:
- case kThumb2:
- return arm::CreateQuickResolutionTrampoline();
- case kMips:
- return mips::CreateQuickResolutionTrampoline();
- case kX86:
- return x86::CreateQuickResolutionTrampoline();
- default:
- LOG(FATAL) << "Unknown InstructionSet: " << instruction_set_;
- return NULL;
- }
+const std::vector<uint8_t>* CompilerDriver::CreatePortableToInterpreterBridge() const {
+ return CreateTrampoline(instruction_set_, kPortableAbi,
+ PORTABLE_ENTRYPOINT_OFFSET(pPortableToInterpreterBridge));
}
-const std::vector<uint8_t>* CompilerDriver::CreateInterpreterToInterpreterEntry() const {
- switch (instruction_set_) {
- case kArm:
- case kThumb2:
- return arm::CreateInterpreterToInterpreterEntry();
- case kMips:
- return mips::CreateInterpreterToInterpreterEntry();
- case kX86:
- return x86::CreateInterpreterToInterpreterEntry();
- default:
- LOG(FATAL) << "Unknown InstructionSet: " << instruction_set_;
- return NULL;
- }
+const std::vector<uint8_t>* CompilerDriver::CreateQuickResolutionTrampoline() const {
+ return CreateTrampoline(instruction_set_, kQuickAbi,
+ QUICK_ENTRYPOINT_OFFSET(pQuickResolutionTrampoline));
}
-const std::vector<uint8_t>* CompilerDriver::CreateInterpreterToQuickEntry() const {
- switch (instruction_set_) {
- case kArm:
- case kThumb2:
- return arm::CreateInterpreterToQuickEntry();
- case kMips:
- return mips::CreateInterpreterToQuickEntry();
- case kX86:
- return x86::CreateInterpreterToQuickEntry();
- default:
- LOG(FATAL) << "Unknown InstructionSet: " << instruction_set_;
- return NULL;
- }
+const std::vector<uint8_t>* CompilerDriver::CreateQuickToInterpreterBridge() const {
+ return CreateTrampoline(instruction_set_, kQuickAbi,
+ QUICK_ENTRYPOINT_OFFSET(pQuickToInterpreterBridge));
}
void CompilerDriver::CompileAll(jobject class_loader,