diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-07-22 15:17:38 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-07-22 15:19:29 +0100 |
commit | 535a3fbc08e1577f43aec7402cab80c14ca64c41 (patch) | |
tree | b1bfd1425064f3ddd243cc87352eb8596f2aa037 /runtime/interpreter | |
parent | ebb6b5c90857f390db5a4f840bbe67b3a59a22d8 (diff) | |
download | art-535a3fbc08e1577f43aec7402cab80c14ca64c41.zip art-535a3fbc08e1577f43aec7402cab80c14ca64c41.tar.gz art-535a3fbc08e1577f43aec7402cab80c14ca64c41.tar.bz2 |
Interpreter can kick in even when implicit checks are enabled.
Add a GetStackEndForInterpreter for its stack overfow check.
Change-Id: I2d4fc229a8eb727fda509ff778e16d60d96ecc28
Diffstat (limited to 'runtime/interpreter')
-rw-r--r-- | runtime/interpreter/interpreter.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index e3068b3..47a7f0d 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -397,7 +397,8 @@ static inline JValue Execute(Thread* self, MethodHelper& mh, const DexFile::Code void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method, Object* receiver, uint32_t* args, JValue* result) { DCHECK_EQ(self, Thread::Current()); - if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEnd())) { + bool implicit_check = !Runtime::Current()->ExplicitStackOverflowChecks(); + if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEndForInterpreter(implicit_check))) { ThrowStackOverflowError(self); return; } @@ -509,7 +510,8 @@ void EnterInterpreterFromDeoptimize(Thread* self, ShadowFrame* shadow_frame, JVa JValue EnterInterpreterFromStub(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item, ShadowFrame& shadow_frame) { DCHECK_EQ(self, Thread::Current()); - if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEnd())) { + bool implicit_check = !Runtime::Current()->ExplicitStackOverflowChecks(); + if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEndForInterpreter(implicit_check))) { ThrowStackOverflowError(self); return JValue(); } @@ -520,7 +522,8 @@ JValue EnterInterpreterFromStub(Thread* self, MethodHelper& mh, const DexFile::C extern "C" void artInterpreterToInterpreterBridge(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item, ShadowFrame* shadow_frame, JValue* result) { - if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEnd())) { + bool implicit_check = !Runtime::Current()->ExplicitStackOverflowChecks(); + if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEndForInterpreter(implicit_check))) { ThrowStackOverflowError(self); return; } |