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 8997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9008 native_context->ErrorMessageForCodeGenerationFromStrings(); | 9008 native_context->ErrorMessageForCodeGenerationFromStrings(); |
9009 isolate->Throw(*isolate->factory()->NewEvalError( | 9009 isolate->Throw(*isolate->factory()->NewEvalError( |
9010 "code_gen_from_strings", HandleVector<Object>(&error_message, 1))); | 9010 "code_gen_from_strings", HandleVector<Object>(&error_message, 1))); |
9011 return MakePair(Failure::Exception(), NULL); | 9011 return MakePair(Failure::Exception(), NULL); |
9012 } | 9012 } |
9013 | 9013 |
9014 // Deal with a normal eval call with a string argument. Compile it | 9014 // Deal with a normal eval call with a string argument. Compile it |
9015 // and return the compiled function bound in the local context. | 9015 // and return the compiled function bound in the local context. |
9016 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( | 9016 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( |
9017 source, | 9017 source, |
9018 Handle<Context>(isolate->context()), | 9018 context, |
9019 context->IsNativeContext(), | 9019 context->IsNativeContext(), |
9020 language_mode, | 9020 language_mode, |
9021 NO_PARSE_RESTRICTION, | 9021 NO_PARSE_RESTRICTION, |
9022 scope_position); | 9022 scope_position); |
9023 if (shared.is_null()) return MakePair(Failure::Exception(), NULL); | 9023 if (shared.is_null()) return MakePair(Failure::Exception(), NULL); |
9024 Handle<JSFunction> compiled = | 9024 Handle<JSFunction> compiled = |
9025 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 9025 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
9026 shared, context, NOT_TENURED); | 9026 shared, context, NOT_TENURED); |
9027 return MakePair(*compiled, *receiver); | 9027 return MakePair(*compiled, *receiver); |
9028 } | 9028 } |
(...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11912 AssertNoAllocation no_gc; | 11912 AssertNoAllocation no_gc; |
11913 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); | 11913 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); |
11914 for (int i = 0; i < length; i++) { | 11914 for (int i = 0; i < length; i++) { |
11915 array->set(i, frame_inspector->GetParameter(i), mode); | 11915 array->set(i, frame_inspector->GetParameter(i), mode); |
11916 } | 11916 } |
11917 arguments->set_elements(*array); | 11917 arguments->set_elements(*array); |
11918 return arguments; | 11918 return arguments; |
11919 } | 11919 } |
11920 | 11920 |
11921 | 11921 |
11922 static const char kSourceStr[] = | 11922 // Compile and evaluate source for the given context. |
11923 "(function(arguments,__source__){return eval(__source__);})"; | 11923 static MaybeObject* DebugEvaluate(Isolate* isolate, |
| 11924 Handle<Context> context, |
| 11925 Handle<Object> context_extension, |
| 11926 Handle<Object> receiver, |
| 11927 Handle<String> source) { |
| 11928 if (context_extension->IsJSObject()) { |
| 11929 Handle<JSObject> extension = Handle<JSObject>::cast(context_extension); |
| 11930 Handle<JSFunction> closure(context->closure(), isolate); |
| 11931 context = isolate->factory()->NewWithContext(closure, context, extension); |
| 11932 } |
| 11933 |
| 11934 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( |
| 11935 source, |
| 11936 context, |
| 11937 context->IsNativeContext(), |
| 11938 CLASSIC_MODE, |
| 11939 NO_PARSE_RESTRICTION, |
| 11940 RelocInfo::kNoPosition); |
| 11941 if (shared.is_null()) return Failure::Exception(); |
| 11942 |
| 11943 Handle<JSFunction> eval_fun = |
| 11944 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 11945 shared, context, NOT_TENURED); |
| 11946 bool pending_exception; |
| 11947 Handle<Object> result = Execution::Call( |
| 11948 eval_fun, receiver, 0, NULL, &pending_exception); |
| 11949 |
| 11950 if (pending_exception) return Failure::Exception(); |
| 11951 |
| 11952 // Skip the global proxy as it has no properties and always delegates to the |
| 11953 // real global object. |
| 11954 if (result->IsJSGlobalProxy()) { |
| 11955 result = Handle<JSObject>(JSObject::cast(result->GetPrototype(isolate))); |
| 11956 } |
| 11957 |
| 11958 // Clear the oneshot breakpoints so that the debugger does not step further. |
| 11959 isolate->debug()->ClearStepping(); |
| 11960 return *result; |
| 11961 } |
11924 | 11962 |
11925 | 11963 |
11926 // Evaluate a piece of JavaScript in the context of a stack frame for | 11964 // Evaluate a piece of JavaScript in the context of a stack frame for |
11927 // debugging. This is accomplished by creating a new context which in its | 11965 // debugging. This is done by creating a new context which in its extension |
11928 // extension part has all the parameters and locals of the function on the | 11966 // part has all the parameters and locals of the function on the stack frame |
11929 // stack frame. A function which calls eval with the code to evaluate is then | 11967 // as well as a materialized arguments object. As this context replaces |
11930 // compiled in this context and called in this context. As this context | 11968 // the context of the function on the stack frame a new (empty) function |
11931 // replaces the context of the function on the stack frame a new (empty) | 11969 // is created as well to be used as the closure for the context. |
11932 // function is created as well to be used as the closure for the context. | 11970 // This closure as replacements for the one on the stack frame presenting |
11933 // This function and the context acts as replacements for the function on the | 11971 // the same view of the values of parameters and local variables as if the |
11934 // stack frame presenting the same view of the values of parameters and | 11972 // piece of JavaScript was evaluated at the point where the function on the |
11935 // local variables as if the piece of JavaScript was evaluated at the point | 11973 // stack frame is currently stopped when we compile and run the (direct) eval. |
11936 // where the function on the stack frame is currently stopped. | |
11937 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluate) { | 11974 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluate) { |
11938 HandleScope scope(isolate); | 11975 HandleScope scope(isolate); |
11939 | 11976 |
11940 // Check the execution state and decode arguments frame and source to be | 11977 // Check the execution state and decode arguments frame and source to be |
11941 // evaluated. | 11978 // evaluated. |
11942 ASSERT(args.length() == 6); | 11979 ASSERT(args.length() == 6); |
11943 Object* check_result; | 11980 Object* check_result; |
11944 { MaybeObject* maybe_check_result = Runtime_CheckExecutionState( | 11981 { MaybeObject* maybe_result = Runtime_CheckExecutionState( |
11945 RUNTIME_ARGUMENTS(isolate, args)); | 11982 RUNTIME_ARGUMENTS(isolate, args)); |
11946 if (!maybe_check_result->ToObject(&check_result)) { | 11983 if (!maybe_result->ToObject(&check_result)) return maybe_result; |
11947 return maybe_check_result; | |
11948 } | |
11949 } | 11984 } |
11950 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 11985 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
11951 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); | 11986 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); |
11952 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); | 11987 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); |
11953 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 4); | 11988 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 4); |
11954 Handle<Object> additional_context(args[5], isolate); | 11989 Handle<Object> context_extension(args[5], isolate); |
11955 | 11990 |
11956 // Handle the processing of break. | 11991 // Handle the processing of break. |
11957 DisableBreak disable_break_save(disable_break); | 11992 DisableBreak disable_break_save(disable_break); |
11958 | 11993 |
11959 // Get the frame where the debugging is performed. | 11994 // Get the frame where the debugging is performed. |
11960 StackFrame::Id id = UnwrapFrameId(wrapped_id); | 11995 StackFrame::Id id = UnwrapFrameId(wrapped_id); |
11961 JavaScriptFrameIterator it(isolate, id); | 11996 JavaScriptFrameIterator it(isolate, id); |
11962 JavaScriptFrame* frame = it.frame(); | 11997 JavaScriptFrame* frame = it.frame(); |
11963 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); | 11998 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); |
11964 Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); | 11999 Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); |
11965 Handle<ScopeInfo> scope_info(function->shared()->scope_info()); | |
11966 | 12000 |
11967 // Traverse the saved contexts chain to find the active context for the | 12001 // Traverse the saved contexts chain to find the active context for the |
11968 // selected frame. | 12002 // selected frame. |
11969 SaveContext* save = FindSavedContextForFrame(isolate, frame); | 12003 SaveContext* save = FindSavedContextForFrame(isolate, frame); |
11970 | 12004 |
11971 SaveContext savex(isolate); | 12005 SaveContext savex(isolate); |
11972 isolate->set_context(*(save->context())); | 12006 isolate->set_context(*(save->context())); |
11973 | 12007 |
11974 // Create the (empty) function replacing the function on the stack frame for | 12008 // Create the (empty) function replacing the function on the stack frame for |
11975 // the purpose of evaluating in the context created below. It is important | 12009 // the purpose of evaluating in the context created below. It is important |
11976 // that this function does not describe any parameters and local variables | 12010 // that this function does not describe any parameters and local variables |
11977 // in the context. If it does then this will cause problems with the lookup | 12011 // in the context. If it does then this will cause problems with the lookup |
11978 // in Context::Lookup, where context slots for parameters and local variables | 12012 // in Context::Lookup, where context slots for parameters and local variables |
11979 // are looked at before the extension object. | 12013 // are looked at before the extension object. |
11980 Handle<JSFunction> go_between = | 12014 Handle<JSFunction> go_between = |
11981 isolate->factory()->NewFunction(isolate->factory()->empty_string(), | 12015 isolate->factory()->NewFunction(isolate->factory()->empty_string(), |
11982 isolate->factory()->undefined_value()); | 12016 isolate->factory()->undefined_value()); |
11983 go_between->set_context(function->context()); | 12017 go_between->set_context(function->context()); |
11984 #ifdef DEBUG | 12018 #ifdef DEBUG |
11985 Handle<ScopeInfo> go_between_scope_info(go_between->shared()->scope_info()); | 12019 Handle<ScopeInfo> go_between_scope_info(go_between->shared()->scope_info()); |
11986 ASSERT(go_between_scope_info->ParameterCount() == 0); | 12020 ASSERT(go_between_scope_info->ParameterCount() == 0); |
11987 ASSERT(go_between_scope_info->ContextLocalCount() == 0); | 12021 ASSERT(go_between_scope_info->ContextLocalCount() == 0); |
11988 #endif | 12022 #endif |
11989 | 12023 |
11990 // Materialize the content of the local scope into a JSObject. | 12024 // Materialize the content of the local scope including the arguments object. |
11991 Handle<JSObject> local_scope = MaterializeLocalScopeWithFrameInspector( | 12025 Handle<JSObject> local_scope = MaterializeLocalScopeWithFrameInspector( |
11992 isolate, frame, &frame_inspector); | 12026 isolate, frame, &frame_inspector); |
11993 RETURN_IF_EMPTY_HANDLE(isolate, local_scope); | 12027 RETURN_IF_EMPTY_HANDLE(isolate, local_scope); |
11994 | 12028 |
| 12029 Handle<Context> frame_context(Context::cast(frame->context())); |
| 12030 Handle<Context> function_context; |
| 12031 Handle<ScopeInfo> scope_info(function->shared()->scope_info()); |
| 12032 if (scope_info->HasContext()) { |
| 12033 function_context = Handle<Context>(frame_context->declaration_context()); |
| 12034 } |
| 12035 Handle<Object> arguments = GetArgumentsObject(isolate, |
| 12036 frame, |
| 12037 &frame_inspector, |
| 12038 scope_info, |
| 12039 function_context); |
| 12040 SetProperty(isolate, |
| 12041 local_scope, |
| 12042 isolate->factory()->arguments_string(), |
| 12043 arguments, |
| 12044 ::NONE, |
| 12045 kNonStrictMode); |
| 12046 |
11995 // Allocate a new context for the debug evaluation and set the extension | 12047 // Allocate a new context for the debug evaluation and set the extension |
11996 // object build. | 12048 // object build. |
11997 Handle<Context> context = | 12049 Handle<Context> context = isolate->factory()->NewFunctionContext( |
11998 isolate->factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, | 12050 Context::MIN_CONTEXT_SLOTS, go_between); |
11999 go_between); | |
12000 | 12051 |
12001 // Use the materialized local scope in a with context. | 12052 // Use the materialized local scope in a with context. |
12002 context = | 12053 context = |
12003 isolate->factory()->NewWithContext(go_between, context, local_scope); | 12054 isolate->factory()->NewWithContext(go_between, context, local_scope); |
12004 | 12055 |
12005 // Copy any with contexts present and chain them in front of this context. | 12056 // Copy any with contexts present and chain them in front of this context. |
12006 Handle<Context> frame_context(Context::cast(frame->context())); | |
12007 Handle<Context> function_context; | |
12008 // Get the function's context if it has one. | |
12009 if (scope_info->HasContext()) { | |
12010 function_context = Handle<Context>(frame_context->declaration_context()); | |
12011 } | |
12012 context = CopyNestedScopeContextChain(isolate, | 12057 context = CopyNestedScopeContextChain(isolate, |
12013 go_between, | 12058 go_between, |
12014 context, | 12059 context, |
12015 frame, | 12060 frame, |
12016 inlined_jsframe_index); | 12061 inlined_jsframe_index); |
12017 if (context.is_null()) { | 12062 if (context.is_null()) { |
12018 ASSERT(isolate->has_pending_exception()); | 12063 ASSERT(isolate->has_pending_exception()); |
12019 MaybeObject* exception = isolate->pending_exception(); | 12064 MaybeObject* exception = isolate->pending_exception(); |
12020 isolate->clear_pending_exception(); | 12065 isolate->clear_pending_exception(); |
12021 return exception; | 12066 return exception; |
12022 } | 12067 } |
12023 | 12068 |
12024 if (additional_context->IsJSObject()) { | |
12025 Handle<JSObject> extension = Handle<JSObject>::cast(additional_context); | |
12026 context = | |
12027 isolate->factory()->NewWithContext(go_between, context, extension); | |
12028 } | |
12029 | |
12030 // Wrap the evaluation statement in a new function compiled in the newly | |
12031 // created context. The function has one parameter which has to be called | |
12032 // 'arguments'. This it to have access to what would have been 'arguments' in | |
12033 // the function being debugged. | |
12034 // function(arguments,__source__) {return eval(__source__);} | |
12035 | |
12036 Handle<String> function_source = | |
12037 isolate->factory()->NewStringFromAscii( | |
12038 Vector<const char>(kSourceStr, sizeof(kSourceStr) - 1)); | |
12039 | |
12040 // Currently, the eval code will be executed in non-strict mode, | |
12041 // even in the strict code context. | |
12042 Handle<SharedFunctionInfo> shared = | |
12043 Compiler::CompileEval(function_source, | |
12044 context, | |
12045 context->IsNativeContext(), | |
12046 CLASSIC_MODE, | |
12047 NO_PARSE_RESTRICTION, | |
12048 RelocInfo::kNoPosition); | |
12049 if (shared.is_null()) return Failure::Exception(); | |
12050 Handle<JSFunction> compiled_function = | |
12051 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context); | |
12052 | |
12053 // Invoke the result of the compilation to get the evaluation function. | |
12054 bool has_pending_exception; | |
12055 Handle<Object> receiver(frame->receiver(), isolate); | 12069 Handle<Object> receiver(frame->receiver(), isolate); |
12056 Handle<Object> evaluation_function = | 12070 return DebugEvaluate(isolate, context, context_extension, receiver, source); |
12057 Execution::Call(compiled_function, receiver, 0, NULL, | |
12058 &has_pending_exception); | |
12059 if (has_pending_exception) return Failure::Exception(); | |
12060 | |
12061 Handle<Object> arguments = GetArgumentsObject(isolate, | |
12062 frame, | |
12063 &frame_inspector, | |
12064 scope_info, | |
12065 function_context); | |
12066 | |
12067 // Check if eval is blocked in the context and temporarily allow it | |
12068 // for debugger. | |
12069 Handle<Context> native_context = Handle<Context>(context->native_context()); | |
12070 bool eval_disabled = | |
12071 native_context->allow_code_gen_from_strings()->IsFalse(); | |
12072 if (eval_disabled) { | |
12073 native_context->set_allow_code_gen_from_strings( | |
12074 isolate->heap()->true_value()); | |
12075 } | |
12076 // Invoke the evaluation function and return the result. | |
12077 Handle<Object> argv[] = { arguments, source }; | |
12078 Handle<Object> result = | |
12079 Execution::Call(Handle<JSFunction>::cast(evaluation_function), | |
12080 receiver, | |
12081 ARRAY_SIZE(argv), | |
12082 argv, | |
12083 &has_pending_exception); | |
12084 if (eval_disabled) { | |
12085 native_context->set_allow_code_gen_from_strings( | |
12086 isolate->heap()->false_value()); | |
12087 } | |
12088 if (has_pending_exception) return Failure::Exception(); | |
12089 | |
12090 // Skip the global proxy as it has no properties and always delegates to the | |
12091 // real global object. | |
12092 if (result->IsJSGlobalProxy()) { | |
12093 result = Handle<JSObject>(JSObject::cast(result->GetPrototype(isolate))); | |
12094 } | |
12095 | |
12096 return *result; | |
12097 } | 12071 } |
12098 | 12072 |
12099 | 12073 |
12100 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluateGlobal) { | 12074 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluateGlobal) { |
12101 HandleScope scope(isolate); | 12075 HandleScope scope(isolate); |
12102 | 12076 |
12103 // Check the execution state and decode arguments frame and source to be | 12077 // Check the execution state and decode arguments frame and source to be |
12104 // evaluated. | 12078 // evaluated. |
12105 ASSERT(args.length() == 4); | 12079 ASSERT(args.length() == 4); |
12106 Object* check_result; | 12080 Object* check_result; |
12107 { MaybeObject* maybe_check_result = Runtime_CheckExecutionState( | 12081 { MaybeObject* maybe_result = Runtime_CheckExecutionState( |
12108 RUNTIME_ARGUMENTS(isolate, args)); | 12082 RUNTIME_ARGUMENTS(isolate, args)); |
12109 if (!maybe_check_result->ToObject(&check_result)) { | 12083 if (!maybe_result->ToObject(&check_result)) return maybe_result; |
12110 return maybe_check_result; | |
12111 } | |
12112 } | 12084 } |
12113 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); | 12085 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
12114 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 2); | 12086 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 2); |
12115 Handle<Object> additional_context(args[3], isolate); | 12087 Handle<Object> context_extension(args[3], isolate); |
12116 | 12088 |
12117 // Handle the processing of break. | 12089 // Handle the processing of break. |
12118 DisableBreak disable_break_save(disable_break); | 12090 DisableBreak disable_break_save(disable_break); |
12119 | 12091 |
12120 // Enter the top context from before the debugger was invoked. | 12092 // Enter the top context from before the debugger was invoked. |
12121 SaveContext save(isolate); | 12093 SaveContext save(isolate); |
12122 SaveContext* top = &save; | 12094 SaveContext* top = &save; |
12123 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) { | 12095 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) { |
12124 top = top->prev(); | 12096 top = top->prev(); |
12125 } | 12097 } |
12126 if (top != NULL) { | 12098 if (top != NULL) { |
12127 isolate->set_context(*top->context()); | 12099 isolate->set_context(*top->context()); |
12128 } | 12100 } |
12129 | 12101 |
12130 // Get the native context now set to the top context from before the | 12102 // Get the native context now set to the top context from before the |
12131 // debugger was invoked. | 12103 // debugger was invoked. |
12132 Handle<Context> context = isolate->native_context(); | 12104 Handle<Context> context = isolate->native_context(); |
12133 | |
12134 bool is_global = true; | |
12135 | |
12136 if (additional_context->IsJSObject()) { | |
12137 // Create a new with context with the additional context information between | |
12138 // the context of the debugged function and the eval code to be executed. | |
12139 context = isolate->factory()->NewWithContext( | |
12140 Handle<JSFunction>(context->closure()), | |
12141 context, | |
12142 Handle<JSObject>::cast(additional_context)); | |
12143 is_global = false; | |
12144 } | |
12145 | |
12146 // Compile the source to be evaluated. | |
12147 // Currently, the eval code will be executed in non-strict mode, | |
12148 // even in the strict code context. | |
12149 Handle<SharedFunctionInfo> shared = | |
12150 Compiler::CompileEval(source, | |
12151 context, | |
12152 is_global, | |
12153 CLASSIC_MODE, | |
12154 NO_PARSE_RESTRICTION, | |
12155 RelocInfo::kNoPosition); | |
12156 if (shared.is_null()) return Failure::Exception(); | |
12157 Handle<JSFunction> compiled_function = | |
12158 Handle<JSFunction>( | |
12159 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, | |
12160 context)); | |
12161 | |
12162 // Invoke the result of the compilation to get the evaluation function. | |
12163 bool has_pending_exception; | |
12164 Handle<Object> receiver = isolate->global_object(); | 12105 Handle<Object> receiver = isolate->global_object(); |
12165 Handle<Object> result = | 12106 return DebugEvaluate(isolate, context, context_extension, receiver, source); |
12166 Execution::Call(compiled_function, receiver, 0, NULL, | |
12167 &has_pending_exception); | |
12168 // Clear the oneshot breakpoints so that the debugger does not step further. | |
12169 isolate->debug()->ClearStepping(); | |
12170 if (has_pending_exception) return Failure::Exception(); | |
12171 return *result; | |
12172 } | 12107 } |
12173 | 12108 |
12174 | 12109 |
12175 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetLoadedScripts) { | 12110 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetLoadedScripts) { |
12176 HandleScope scope(isolate); | 12111 HandleScope scope(isolate); |
12177 ASSERT(args.length() == 0); | 12112 ASSERT(args.length() == 0); |
12178 | 12113 |
12179 // Fill the script objects. | 12114 // Fill the script objects. |
12180 Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts(); | 12115 Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts(); |
12181 | 12116 |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13405 // Handle last resort GC and make sure to allow future allocations | 13340 // Handle last resort GC and make sure to allow future allocations |
13406 // to grow the heap without causing GCs (if possible). | 13341 // to grow the heap without causing GCs (if possible). |
13407 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13342 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13408 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13343 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13409 "Runtime::PerformGC"); | 13344 "Runtime::PerformGC"); |
13410 } | 13345 } |
13411 } | 13346 } |
13412 | 13347 |
13413 | 13348 |
13414 } } // namespace v8::internal | 13349 } } // namespace v8::internal |
OLD | NEW |