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 11531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11542 if (scope_info->HasHeapAllocatedLocals()) { | 11542 if (scope_info->HasHeapAllocatedLocals()) { |
11543 VariableMode mode; | 11543 VariableMode mode; |
11544 InitializationFlag init_flag; | 11544 InitializationFlag init_flag; |
11545 index = scope_info->ContextSlotIndex( | 11545 index = scope_info->ContextSlotIndex( |
11546 isolate->heap()->arguments_string(), &mode, &init_flag); | 11546 isolate->heap()->arguments_string(), &mode, &init_flag); |
11547 if (index != -1) { | 11547 if (index != -1) { |
11548 return Handle<Object>(function_context->get(index), isolate); | 11548 return Handle<Object>(function_context->get(index), isolate); |
11549 } | 11549 } |
11550 } | 11550 } |
11551 | 11551 |
11552 Handle<JSFunction> function(JSFunction::cast(frame_inspector->GetFunction())); | 11552 // FunctionGetArguments can't return a non-Object. |
11553 int length = frame_inspector->GetParametersCount(); | 11553 return Handle<JSObject>(JSObject::cast( |
11554 Handle<JSObject> arguments = | 11554 Accessors::FunctionGetArguments(frame_inspector->GetFunction(), |
11555 isolate->factory()->NewArgumentsObject(function, length); | 11555 NULL)->ToObjectUnchecked()), isolate); |
11556 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length); | |
11557 | |
11558 AssertNoAllocation no_gc; | |
11559 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); | |
11560 for (int i = 0; i < length; i++) { | |
11561 array->set(i, frame_inspector->GetParameter(i), mode); | |
11562 } | |
11563 arguments->set_elements(*array); | |
11564 return arguments; | |
11565 } | 11556 } |
11566 | 11557 |
11567 | 11558 |
11568 // Compile and evaluate source for the given context. | 11559 // Compile and evaluate source for the given context. |
11569 static MaybeObject* DebugEvaluate(Isolate* isolate, | 11560 static MaybeObject* DebugEvaluate(Isolate* isolate, |
11570 Handle<Context> context, | 11561 Handle<Context> context, |
11571 Handle<Object> context_extension, | 11562 Handle<Object> context_extension, |
11572 Handle<Object> receiver, | 11563 Handle<Object> receiver, |
11573 Handle<String> source) { | 11564 Handle<String> source) { |
11574 if (context_extension->IsJSObject()) { | 11565 if (context_extension->IsJSObject()) { |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12986 // Handle last resort GC and make sure to allow future allocations | 12977 // Handle last resort GC and make sure to allow future allocations |
12987 // to grow the heap without causing GCs (if possible). | 12978 // to grow the heap without causing GCs (if possible). |
12988 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12979 isolate->counters()->gc_last_resort_from_js()->Increment(); |
12989 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 12980 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
12990 "Runtime::PerformGC"); | 12981 "Runtime::PerformGC"); |
12991 } | 12982 } |
12992 } | 12983 } |
12993 | 12984 |
12994 | 12985 |
12995 } } // namespace v8::internal | 12986 } } // namespace v8::internal |
OLD | NEW |