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

Side by Side Diff: src/execution.cc

Issue 2151663003: [simulator] Check for C stack overflows during Invoke (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/execution.h" 5 #include "src/execution.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 namespace { 53 namespace {
54 54
55 MUST_USE_RESULT MaybeHandle<Object> Invoke(Isolate* isolate, bool is_construct, 55 MUST_USE_RESULT MaybeHandle<Object> Invoke(Isolate* isolate, bool is_construct,
56 Handle<Object> target, 56 Handle<Object> target,
57 Handle<Object> receiver, int argc, 57 Handle<Object> receiver, int argc,
58 Handle<Object> args[], 58 Handle<Object> args[],
59 Handle<Object> new_target) { 59 Handle<Object> new_target) {
60 DCHECK(!receiver->IsJSGlobalObject()); 60 DCHECK(!receiver->IsJSGlobalObject());
61 61
62 #ifdef USE_SIMULATOR
63 // Simulators use separate stacks for C++ and JS. JS stack overflow checks
64 // are performed whenever a JS function is called. However, it can be the case
65 // that the C++ stack grows faster than the JS stack, resulting in an overflow
66 // there. Add a check here to make that less likely.
67 StackLimitCheck check(isolate);
68 if (check.HasOverflowed()) {
69 isolate->StackOverflow();
70 isolate->ReportPendingMessages();
71 return MaybeHandle<Object>();
72 }
73 #endif
74
62 // Entering JavaScript. 75 // Entering JavaScript.
63 VMState<JS> state(isolate); 76 VMState<JS> state(isolate);
64 CHECK(AllowJavascriptExecution::IsAllowed(isolate)); 77 CHECK(AllowJavascriptExecution::IsAllowed(isolate));
65 if (!ThrowOnJavascriptExecution::IsAllowed(isolate)) { 78 if (!ThrowOnJavascriptExecution::IsAllowed(isolate)) {
66 isolate->ThrowIllegalOperation(); 79 isolate->ThrowIllegalOperation();
67 isolate->ReportPendingMessages(); 80 isolate->ReportPendingMessages();
68 return MaybeHandle<Object>(); 81 return MaybeHandle<Object>();
69 } 82 }
70 83
71 // Placeholder for return value. 84 // Placeholder for return value.
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 485
473 isolate_->counters()->stack_interrupts()->Increment(); 486 isolate_->counters()->stack_interrupts()->Increment();
474 isolate_->counters()->runtime_profiler_ticks()->Increment(); 487 isolate_->counters()->runtime_profiler_ticks()->Increment();
475 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); 488 isolate_->runtime_profiler()->MarkCandidatesForOptimization();
476 489
477 return isolate_->heap()->undefined_value(); 490 return isolate_->heap()->undefined_value();
478 } 491 }
479 492
480 } // namespace internal 493 } // namespace internal
481 } // namespace v8 494 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698