OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // modification, are permitted provided that the following conditions are | 3 // found in the LICENSE file. |
4 // met: | |
5 // | |
6 // * Redistributions of source code must retain the above copyright | |
7 // notice, this list of conditions and the following disclaimer. | |
8 // * Redistributions in binary form must reproduce the above | |
9 // copyright notice, this list of conditions and the following | |
10 // disclaimer in the documentation and/or other materials provided | |
11 // with the distribution. | |
12 // * Neither the name of Google Inc. nor the names of its | |
13 // contributors may be used to endorse or promote products derived | |
14 // from this software without specific prior written permission. | |
15 // | |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | 4 |
28 #include <stdlib.h> | 5 #include "execution.h" |
29 | 6 |
30 #include "v8.h" | |
31 | |
32 #include "api.h" | |
33 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
34 #include "codegen.h" | 8 #include "codegen.h" |
35 #include "debug.h" | |
36 #include "deoptimizer.h" | 9 #include "deoptimizer.h" |
37 #include "isolate-inl.h" | 10 #include "isolate-inl.h" |
38 #include "runtime-profiler.h" | |
39 #include "simulator.h" | |
40 #include "v8threads.h" | |
41 #include "vm-state-inl.h" | 11 #include "vm-state-inl.h" |
42 | 12 |
43 namespace v8 { | 13 namespace v8 { |
44 namespace internal { | 14 namespace internal { |
45 | 15 |
46 | |
47 StackGuard::StackGuard() | 16 StackGuard::StackGuard() |
48 : isolate_(NULL) { | 17 : isolate_(NULL) { |
49 } | 18 } |
50 | 19 |
51 | 20 |
52 void StackGuard::set_interrupt_limits(const ExecutionAccess& lock) { | 21 void StackGuard::set_interrupt_limits(const ExecutionAccess& lock) { |
53 ASSERT(isolate_ != NULL); | 22 ASSERT(isolate_ != NULL); |
54 // Ignore attempts to interrupt when interrupts are postponed. | 23 // Ignore attempts to interrupt when interrupts are postponed. |
55 if (should_postpone_interrupts(lock)) return; | 24 if (should_postpone_interrupts(lock)) return; |
56 thread_local_.jslimit_ = kInterruptLimit; | 25 thread_local_.jslimit_ = kInterruptLimit; |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 EnterDebugger debugger(isolate); | 961 EnterDebugger debugger(isolate); |
993 if (debugger.FailedToEnter()) { | 962 if (debugger.FailedToEnter()) { |
994 return; | 963 return; |
995 } | 964 } |
996 | 965 |
997 // Notify the debug event listeners. Indicate auto continue if the break was | 966 // Notify the debug event listeners. Indicate auto continue if the break was |
998 // a debug command break. | 967 // a debug command break. |
999 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), | 968 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), |
1000 debug_command_only); | 969 debug_command_only); |
1001 } | 970 } |
1002 | |
1003 | |
1004 #endif | 971 #endif |
1005 | 972 |
1006 MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { | 973 MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { |
1007 StackGuard* stack_guard = isolate->stack_guard(); | 974 StackGuard* stack_guard = isolate->stack_guard(); |
1008 if (stack_guard->ShouldPostponeInterrupts()) { | 975 if (stack_guard->ShouldPostponeInterrupts()) { |
1009 return isolate->heap()->undefined_value(); | 976 return isolate->heap()->undefined_value(); |
1010 } | 977 } |
1011 | 978 |
1012 if (stack_guard->IsAPIInterrupt()) { | 979 if (stack_guard->IsAPIInterrupt()) { |
1013 stack_guard->InvokeInterruptCallback(); | 980 stack_guard->InvokeInterruptCallback(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 } | 1013 } |
1047 if (stack_guard->IsInstallCodeRequest()) { | 1014 if (stack_guard->IsInstallCodeRequest()) { |
1048 ASSERT(isolate->concurrent_recompilation_enabled()); | 1015 ASSERT(isolate->concurrent_recompilation_enabled()); |
1049 stack_guard->Continue(INSTALL_CODE); | 1016 stack_guard->Continue(INSTALL_CODE); |
1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 1017 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
1051 } | 1018 } |
1052 isolate->runtime_profiler()->OptimizeNow(); | 1019 isolate->runtime_profiler()->OptimizeNow(); |
1053 return isolate->heap()->undefined_value(); | 1020 return isolate->heap()->undefined_value(); |
1054 } | 1021 } |
1055 | 1022 |
1056 | |
1057 } } // namespace v8::internal | 1023 } } // namespace v8::internal |
OLD | NEW |