Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: runtime/vm/dart_entry.cc

Issue 2639673003: Use a better stack bound in DartEntry::InvokeFunction (Closed)
Patch Set: asiva review Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 6cd7b4f8efa77ad74fc3b15513a2113817f2c3d8..195781cd5044c03bf337b3f468268c5791419107 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -32,7 +32,7 @@ RawObject* DartEntry::InvokeFunction(const Function& function,
class ScopedIsolateStackLimits : public ValueObject {
public:
- explicit ScopedIsolateStackLimits(Thread* thread)
+ explicit ScopedIsolateStackLimits(Thread* thread, uword current_sp)
: thread_(thread), saved_stack_limit_(0) {
ASSERT(thread != NULL);
// Set the thread's stack_base based on the current
@@ -41,7 +41,6 @@ class ScopedIsolateStackLimits : public ValueObject {
// grows from high to low addresses).
OSThread* os_thread = thread->os_thread();
ASSERT(os_thread != NULL);
- uword current_sp = Thread::GetCurrentStackPointer();
if (current_sp > os_thread->stack_base()) {
os_thread->set_stack_base(current_sp);
}
@@ -87,13 +86,15 @@ class SuspendLongJumpScope : public StackResource {
RawObject* DartEntry::InvokeFunction(const Function& function,
const Array& arguments,
- const Array& arguments_descriptor) {
+ const Array& arguments_descriptor,
+ uword current_sp) {
// Get the entrypoint corresponding to the function specified, this
// will result in a compilation of the function if it is not already
// compiled.
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
ASSERT(thread->IsMutatorThread());
+ ScopedIsolateStackLimits stack_limit(thread, current_sp);
if (!function.HasCode()) {
const Error& error =
Error::Handle(zone, Compiler::CompileFunction(thread, function));
@@ -109,7 +110,6 @@ RawObject* DartEntry::InvokeFunction(const Function& function,
const Code& code = Code::Handle(zone, function.CurrentCode());
ASSERT(!code.IsNull());
ASSERT(thread->no_callback_scope_depth() == 0);
- ScopedIsolateStackLimits stack_limit(thread);
SuspendLongJumpScope suspend_long_jump_scope(thread);
TransitionToGenerated transition(thread);
#if defined(TARGET_ARCH_DBC)
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698