| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "v8.h" | 8 #include "v8.h" |
| 9 | 9 |
| 10 #include "accessors.h" | 10 #include "accessors.h" |
| (...skipping 9567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9578 | 9578 |
| 9579 RUNTIME_FUNCTION(RuntimeHidden_StackGuard) { | 9579 RUNTIME_FUNCTION(RuntimeHidden_StackGuard) { |
| 9580 SealHandleScope shs(isolate); | 9580 SealHandleScope shs(isolate); |
| 9581 ASSERT(args.length() == 0); | 9581 ASSERT(args.length() == 0); |
| 9582 | 9582 |
| 9583 // First check if this is a real stack overflow. | 9583 // First check if this is a real stack overflow. |
| 9584 if (isolate->stack_guard()->IsStackOverflow()) { | 9584 if (isolate->stack_guard()->IsStackOverflow()) { |
| 9585 return isolate->StackOverflow(); | 9585 return isolate->StackOverflow(); |
| 9586 } | 9586 } |
| 9587 | 9587 |
| 9588 return Execution::HandleStackGuardInterrupt(isolate); | 9588 return isolate->stack_guard()->HandleInterrupts(); |
| 9589 } | 9589 } |
| 9590 | 9590 |
| 9591 | 9591 |
| 9592 RUNTIME_FUNCTION(RuntimeHidden_TryInstallOptimizedCode) { | 9592 RUNTIME_FUNCTION(RuntimeHidden_TryInstallOptimizedCode) { |
| 9593 HandleScope scope(isolate); | 9593 HandleScope scope(isolate); |
| 9594 ASSERT(args.length() == 1); | 9594 ASSERT(args.length() == 1); |
| 9595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 9595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 9596 | 9596 |
| 9597 // First check if this is a real stack overflow. | 9597 // First check if this is a real stack overflow. |
| 9598 if (isolate->stack_guard()->IsStackOverflow()) { | 9598 if (isolate->stack_guard()->IsStackOverflow()) { |
| 9599 SealHandleScope shs(isolate); | 9599 SealHandleScope shs(isolate); |
| 9600 return isolate->StackOverflow(); | 9600 return isolate->StackOverflow(); |
| 9601 } | 9601 } |
| 9602 | 9602 |
| 9603 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 9603 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 9604 return (function->IsOptimized()) ? function->code() | 9604 return (function->IsOptimized()) ? function->code() |
| 9605 : function->shared()->code(); | 9605 : function->shared()->code(); |
| 9606 } | 9606 } |
| 9607 | 9607 |
| 9608 | 9608 |
| 9609 RUNTIME_FUNCTION(RuntimeHidden_Interrupt) { | 9609 RUNTIME_FUNCTION(RuntimeHidden_Interrupt) { |
| 9610 SealHandleScope shs(isolate); | 9610 SealHandleScope shs(isolate); |
| 9611 ASSERT(args.length() == 0); | 9611 ASSERT(args.length() == 0); |
| 9612 return Execution::HandleStackGuardInterrupt(isolate); | 9612 return isolate->stack_guard()->HandleInterrupts(); |
| 9613 } | 9613 } |
| 9614 | 9614 |
| 9615 | 9615 |
| 9616 static int StackSize(Isolate* isolate) { | 9616 static int StackSize(Isolate* isolate) { |
| 9617 int n = 0; | 9617 int n = 0; |
| 9618 for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) n++; | 9618 for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) n++; |
| 9619 return n; | 9619 return n; |
| 9620 } | 9620 } |
| 9621 | 9621 |
| 9622 | 9622 |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10775 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 10775 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 10776 isolate, result, | 10776 isolate, result, |
| 10777 JSObject::GetAccessor(Handle<JSObject>::cast(receiver), name, component)); | 10777 JSObject::GetAccessor(Handle<JSObject>::cast(receiver), name, component)); |
| 10778 return *result; | 10778 return *result; |
| 10779 } | 10779 } |
| 10780 | 10780 |
| 10781 | 10781 |
| 10782 RUNTIME_FUNCTION(Runtime_DebugBreak) { | 10782 RUNTIME_FUNCTION(Runtime_DebugBreak) { |
| 10783 SealHandleScope shs(isolate); | 10783 SealHandleScope shs(isolate); |
| 10784 ASSERT(args.length() == 0); | 10784 ASSERT(args.length() == 0); |
| 10785 return Execution::DebugBreakHelper(isolate); | 10785 Execution::DebugBreakHelper(isolate); |
| 10786 return isolate->heap()->undefined_value(); |
| 10786 } | 10787 } |
| 10787 | 10788 |
| 10788 | 10789 |
| 10789 // Helper functions for wrapping and unwrapping stack frame ids. | 10790 // Helper functions for wrapping and unwrapping stack frame ids. |
| 10790 static Smi* WrapFrameId(StackFrame::Id id) { | 10791 static Smi* WrapFrameId(StackFrame::Id id) { |
| 10791 ASSERT(IsAligned(OffsetFrom(id), static_cast<intptr_t>(4))); | 10792 ASSERT(IsAligned(OffsetFrom(id), static_cast<intptr_t>(4))); |
| 10792 return Smi::FromInt(id >> 2); | 10793 return Smi::FromInt(id >> 2); |
| 10793 } | 10794 } |
| 10794 | 10795 |
| 10795 | 10796 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 10812 CONVERT_ARG_HANDLE_CHECKED(Object, data, 1); | 10813 CONVERT_ARG_HANDLE_CHECKED(Object, data, 1); |
| 10813 isolate->debugger()->SetEventListener(callback, data); | 10814 isolate->debugger()->SetEventListener(callback, data); |
| 10814 | 10815 |
| 10815 return isolate->heap()->undefined_value(); | 10816 return isolate->heap()->undefined_value(); |
| 10816 } | 10817 } |
| 10817 | 10818 |
| 10818 | 10819 |
| 10819 RUNTIME_FUNCTION(Runtime_Break) { | 10820 RUNTIME_FUNCTION(Runtime_Break) { |
| 10820 SealHandleScope shs(isolate); | 10821 SealHandleScope shs(isolate); |
| 10821 ASSERT(args.length() == 0); | 10822 ASSERT(args.length() == 0); |
| 10822 isolate->stack_guard()->DebugBreak(); | 10823 isolate->stack_guard()->RequestDebugBreak(); |
| 10823 return isolate->heap()->undefined_value(); | 10824 return isolate->heap()->undefined_value(); |
| 10824 } | 10825 } |
| 10825 | 10826 |
| 10826 | 10827 |
| 10827 static Handle<Object> DebugLookupResultValue(Isolate* isolate, | 10828 static Handle<Object> DebugLookupResultValue(Isolate* isolate, |
| 10828 Handle<Object> receiver, | 10829 Handle<Object> receiver, |
| 10829 Handle<Name> name, | 10830 Handle<Name> name, |
| 10830 LookupResult* result, | 10831 LookupResult* result, |
| 10831 bool* has_caught = NULL) { | 10832 bool* has_caught = NULL) { |
| 10832 Handle<Object> value = isolate->factory()->undefined_value(); | 10833 Handle<Object> value = isolate->factory()->undefined_value(); |
| (...skipping 4407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15240 } | 15241 } |
| 15241 return NULL; | 15242 return NULL; |
| 15242 } | 15243 } |
| 15243 | 15244 |
| 15244 | 15245 |
| 15245 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15246 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15246 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15247 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15247 } | 15248 } |
| 15248 | 15249 |
| 15249 } } // namespace v8::internal | 15250 } } // namespace v8::internal |
| OLD | NEW |