OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |