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 10822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10833 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 10833 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
10834 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | 10834 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
10835 | 10835 |
10836 // Make sure to set the current context to the context before the debugger was | 10836 // Make sure to set the current context to the context before the debugger was |
10837 // entered (if the debugger is entered). The reason for switching context here | 10837 // entered (if the debugger is entered). The reason for switching context here |
10838 // is that for some property lookups (accessors and interceptors) callbacks | 10838 // is that for some property lookups (accessors and interceptors) callbacks |
10839 // into the embedding application can occour, and the embedding application | 10839 // into the embedding application can occour, and the embedding application |
10840 // could have the assumption that its own native context is the current | 10840 // could have the assumption that its own native context is the current |
10841 // context and not some internal debugger context. | 10841 // context and not some internal debugger context. |
10842 SaveContext save(isolate); | 10842 SaveContext save(isolate); |
10843 if (isolate->debug()->is_entered()) { | 10843 if (isolate->debug()->in_debug_scope()) { |
10844 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); | 10844 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); |
10845 } | 10845 } |
10846 | 10846 |
10847 // Skip the global proxy as it has no properties and always delegates to the | 10847 // Skip the global proxy as it has no properties and always delegates to the |
10848 // real global object. | 10848 // real global object. |
10849 if (obj->IsJSGlobalProxy()) { | 10849 if (obj->IsJSGlobalProxy()) { |
10850 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); | 10850 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); |
10851 } | 10851 } |
10852 | 10852 |
10853 | 10853 |
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13615 CONVERT_BOOLEAN_ARG_CHECKED(without_debugger, 1); | 13615 CONVERT_BOOLEAN_ARG_CHECKED(without_debugger, 1); |
13616 | 13616 |
13617 MaybeHandle<Object> maybe_result; | 13617 MaybeHandle<Object> maybe_result; |
13618 if (without_debugger) { | 13618 if (without_debugger) { |
13619 maybe_result = Execution::Call(isolate, | 13619 maybe_result = Execution::Call(isolate, |
13620 function, | 13620 function, |
13621 isolate->global_object(), | 13621 isolate->global_object(), |
13622 0, | 13622 0, |
13623 NULL); | 13623 NULL); |
13624 } else { | 13624 } else { |
13625 EnterDebugger enter_debugger(isolate); | 13625 DebugScope debug_scope(isolate->debug()); |
13626 maybe_result = Execution::Call(isolate, | 13626 maybe_result = Execution::Call(isolate, |
13627 function, | 13627 function, |
13628 isolate->global_object(), | 13628 isolate->global_object(), |
13629 0, | 13629 0, |
13630 NULL); | 13630 NULL); |
13631 } | 13631 } |
13632 Handle<Object> result; | 13632 Handle<Object> result; |
13633 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, maybe_result); | 13633 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, maybe_result); |
13634 return *result; | 13634 return *result; |
13635 } | 13635 } |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15171 } | 15171 } |
15172 return NULL; | 15172 return NULL; |
15173 } | 15173 } |
15174 | 15174 |
15175 | 15175 |
15176 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15176 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15177 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15177 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15178 } | 15178 } |
15179 | 15179 |
15180 } } // namespace v8::internal | 15180 } } // namespace v8::internal |
OLD | NEW |