| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 | 922 |
| 923 | 923 |
| 924 Handle<Context> Top::global_context() { | 924 Handle<Context> Top::global_context() { |
| 925 GlobalObject* global = thread_local_.context_->global(); | 925 GlobalObject* global = thread_local_.context_->global(); |
| 926 return Handle<Context>(global->global_context()); | 926 return Handle<Context>(global->global_context()); |
| 927 } | 927 } |
| 928 | 928 |
| 929 | 929 |
| 930 Handle<Context> Top::GetCallingGlobalContext() { | 930 Handle<Context> Top::GetCallingGlobalContext() { |
| 931 JavaScriptFrameIterator it; | 931 JavaScriptFrameIterator it; |
| 932 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 933 if (Debug::InDebugger()) { |
| 934 while (!it.done()) { |
| 935 JavaScriptFrame* frame = it.frame(); |
| 936 Context* context = Context::cast(frame->context()); |
| 937 if (context->global_context() == *Debug::debug_context()) { |
| 938 it.Advance(); |
| 939 } else { |
| 940 break; |
| 941 } |
| 942 } |
| 943 } |
| 944 #endif // ENABLE_DEBUGGER_SUPPORT |
| 932 if (it.done()) return Handle<Context>::null(); | 945 if (it.done()) return Handle<Context>::null(); |
| 933 JavaScriptFrame* frame = it.frame(); | 946 JavaScriptFrame* frame = it.frame(); |
| 934 Context* context = Context::cast(frame->context()); | 947 Context* context = Context::cast(frame->context()); |
| 935 return Handle<Context>(context->global_context()); | 948 return Handle<Context>(context->global_context()); |
| 936 } | 949 } |
| 937 | 950 |
| 938 | 951 |
| 939 Object* Top::LookupSpecialFunction(JSObject* receiver, | 952 Object* Top::LookupSpecialFunction(JSObject* receiver, |
| 940 JSObject* prototype, | 953 JSObject* prototype, |
| 941 JSFunction* function) { | 954 JSFunction* function) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 969 Top::break_access_->Lock(); | 982 Top::break_access_->Lock(); |
| 970 } | 983 } |
| 971 | 984 |
| 972 | 985 |
| 973 ExecutionAccess::~ExecutionAccess() { | 986 ExecutionAccess::~ExecutionAccess() { |
| 974 Top::break_access_->Unlock(); | 987 Top::break_access_->Unlock(); |
| 975 } | 988 } |
| 976 | 989 |
| 977 | 990 |
| 978 } } // namespace v8::internal | 991 } } // namespace v8::internal |
| OLD | NEW |