OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 // Bail out if the index is invalid. | 747 // Bail out if the index is invalid. |
748 if (index == -1) { | 748 if (index == -1) { |
749 return false; | 749 return false; |
750 } | 750 } |
751 | 751 |
752 // Find source and name for the requested script. | 752 // Find source and name for the requested script. |
753 Handle<String> source_code = | 753 Handle<String> source_code = |
754 isolate->bootstrapper()->NativesSourceLookup(index); | 754 isolate->bootstrapper()->NativesSourceLookup(index); |
755 Vector<const char> name = Natives::GetScriptName(index); | 755 Vector<const char> name = Natives::GetScriptName(index); |
756 Handle<String> script_name = factory->NewStringFromAscii(name); | 756 Handle<String> script_name = factory->NewStringFromAscii(name); |
| 757 ASSERT(!script_name.is_null()); |
757 Handle<Context> context = isolate->native_context(); | 758 Handle<Context> context = isolate->native_context(); |
758 | 759 |
759 // Compile the script. | 760 // Compile the script. |
760 Handle<SharedFunctionInfo> function_info; | 761 Handle<SharedFunctionInfo> function_info; |
761 function_info = Compiler::CompileScript(source_code, | 762 function_info = Compiler::CompileScript(source_code, |
762 script_name, 0, 0, | 763 script_name, 0, 0, |
763 false, | 764 false, |
764 context, | 765 context, |
765 NULL, NULL, NO_CACHED_DATA, | 766 NULL, NULL, NO_CACHED_DATA, |
766 NATIVES_CODE); | 767 NATIVES_CODE); |
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 | 2593 |
2593 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, | 2594 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, |
2594 int argc, | 2595 int argc, |
2595 Handle<Object> argv[], | 2596 Handle<Object> argv[], |
2596 bool* caught_exception) { | 2597 bool* caught_exception) { |
2597 ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); | 2598 ASSERT(isolate_->context() == *isolate_->debug()->debug_context()); |
2598 | 2599 |
2599 // Create the execution state object. | 2600 // Create the execution state object. |
2600 Handle<String> constructor_str = | 2601 Handle<String> constructor_str = |
2601 isolate_->factory()->InternalizeUtf8String(constructor_name); | 2602 isolate_->factory()->InternalizeUtf8String(constructor_name); |
| 2603 ASSERT(!constructor_str.is_null()); |
2602 Handle<Object> constructor( | 2604 Handle<Object> constructor( |
2603 isolate_->global_object()->GetPropertyNoExceptionThrown(*constructor_str), | 2605 isolate_->global_object()->GetPropertyNoExceptionThrown(*constructor_str), |
2604 isolate_); | 2606 isolate_); |
2605 ASSERT(constructor->IsJSFunction()); | 2607 ASSERT(constructor->IsJSFunction()); |
2606 if (!constructor->IsJSFunction()) { | 2608 if (!constructor->IsJSFunction()) { |
2607 *caught_exception = true; | 2609 *caught_exception = true; |
2608 return isolate_->factory()->undefined_value(); | 2610 return isolate_->factory()->undefined_value(); |
2609 } | 2611 } |
2610 Handle<Object> js_object = Execution::TryCall( | 2612 Handle<Object> js_object = Execution::TryCall( |
2611 Handle<JSFunction>::cast(constructor), | 2613 Handle<JSFunction>::cast(constructor), |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3809 { | 3811 { |
3810 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 3812 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |
3811 isolate_->debugger()->CallMessageDispatchHandler(); | 3813 isolate_->debugger()->CallMessageDispatchHandler(); |
3812 } | 3814 } |
3813 } | 3815 } |
3814 } | 3816 } |
3815 | 3817 |
3816 #endif // ENABLE_DEBUGGER_SUPPORT | 3818 #endif // ENABLE_DEBUGGER_SUPPORT |
3817 | 3819 |
3818 } } // namespace v8::internal | 3820 } } // namespace v8::internal |
OLD | NEW |