| 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 10729 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 10740   Object* GetParameter(int index) { | 10740   Object* GetParameter(int index) { | 
| 10741     return is_optimized_ | 10741     return is_optimized_ | 
| 10742         ? deoptimized_frame_->GetParameter(index) | 10742         ? deoptimized_frame_->GetParameter(index) | 
| 10743         : frame_->GetParameter(index); | 10743         : frame_->GetParameter(index); | 
| 10744   } | 10744   } | 
| 10745   Object* GetExpression(int index) { | 10745   Object* GetExpression(int index) { | 
| 10746     return is_optimized_ | 10746     return is_optimized_ | 
| 10747         ? deoptimized_frame_->GetExpression(index) | 10747         ? deoptimized_frame_->GetExpression(index) | 
| 10748         : frame_->GetExpression(index); | 10748         : frame_->GetExpression(index); | 
| 10749   } | 10749   } | 
| 10750   Address GetPc() { | 10750   int GetSourcePosition() { | 
| 10751     return is_optimized_ | 10751     return is_optimized_ | 
| 10752         ? deoptimized_frame_->GetPc() | 10752         ? deoptimized_frame_->GetSourcePosition() | 
| 10753         : frame_->pc(); | 10753         : frame_->LookupCode()->SourcePosition(frame_->pc()); | 
| 10754   } | 10754   } | 
| 10755 | 10755 | 
| 10756   // To inspect all the provided arguments the frame might need to be | 10756   // To inspect all the provided arguments the frame might need to be | 
| 10757   // replaced with the arguments frame. | 10757   // replaced with the arguments frame. | 
| 10758   void SetArgumentsFrame(JavaScriptFrame* frame) { | 10758   void SetArgumentsFrame(JavaScriptFrame* frame) { | 
| 10759     ASSERT(has_adapted_arguments_); | 10759     ASSERT(has_adapted_arguments_); | 
| 10760     frame_ = frame; | 10760     frame_ = frame; | 
| 10761     is_optimized_ = frame_->is_optimized(); | 10761     is_optimized_ = frame_->is_optimized(); | 
| 10762     ASSERT(!is_optimized_); | 10762     ASSERT(!is_optimized_); | 
| 10763   } | 10763   } | 
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 10851   FrameInspector frame_inspector(it.frame(), inlined_jsframe_index, isolate); | 10851   FrameInspector frame_inspector(it.frame(), inlined_jsframe_index, isolate); | 
| 10852 | 10852 | 
| 10853   // Traverse the saved contexts chain to find the active context for the | 10853   // Traverse the saved contexts chain to find the active context for the | 
| 10854   // selected frame. | 10854   // selected frame. | 
| 10855   SaveContext* save = FindSavedContextForFrame(isolate, it.frame()); | 10855   SaveContext* save = FindSavedContextForFrame(isolate, it.frame()); | 
| 10856 | 10856 | 
| 10857   // Get the frame id. | 10857   // Get the frame id. | 
| 10858   Handle<Object> frame_id(WrapFrameId(it.frame()->id()), isolate); | 10858   Handle<Object> frame_id(WrapFrameId(it.frame()->id()), isolate); | 
| 10859 | 10859 | 
| 10860   // Find source position in unoptimized code. | 10860   // Find source position in unoptimized code. | 
| 10861   Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); | 10861   int position = frame_inspector.GetSourcePosition(); | 
| 10862   Handle<SharedFunctionInfo> shared(function->shared()); |  | 
| 10863   int position = shared->code()->SourcePosition(frame_inspector.GetPc()); |  | 
| 10864 | 10862 | 
| 10865   // Check for constructor frame. Inlined frames cannot be construct calls. | 10863   // Check for constructor frame. Inlined frames cannot be construct calls. | 
| 10866   bool inlined_frame = is_optimized && inlined_jsframe_index != 0; | 10864   bool inlined_frame = is_optimized && inlined_jsframe_index != 0; | 
| 10867   bool constructor = !inlined_frame && it.frame()->IsConstructor(); | 10865   bool constructor = !inlined_frame && it.frame()->IsConstructor(); | 
| 10868 | 10866 | 
| 10869   // Get scope info and read from it for local variable information. | 10867   // Get scope info and read from it for local variable information. | 
|  | 10868   Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); | 
|  | 10869   Handle<SharedFunctionInfo> shared(function->shared()); | 
| 10870   Handle<ScopeInfo> scope_info(shared->scope_info()); | 10870   Handle<ScopeInfo> scope_info(shared->scope_info()); | 
| 10871   ASSERT(*scope_info != ScopeInfo::Empty()); | 10871   ASSERT(*scope_info != ScopeInfo::Empty()); | 
| 10872 | 10872 | 
| 10873   // Get the locals names and values into a temporary array. | 10873   // Get the locals names and values into a temporary array. | 
| 10874   // | 10874   // | 
| 10875   // TODO(1240907): Hide compiler-introduced stack variables | 10875   // TODO(1240907): Hide compiler-introduced stack variables | 
| 10876   // (e.g. .result)?  For users of the debugger, they will probably be | 10876   // (e.g. .result)?  For users of the debugger, they will probably be | 
| 10877   // confusing. | 10877   // confusing. | 
| 10878   Handle<FixedArray> locals = | 10878   Handle<FixedArray> locals = | 
| 10879       isolate->factory()->NewFixedArray(scope_info->LocalCount() * 2); | 10879       isolate->factory()->NewFixedArray(scope_info->LocalCount() * 2); | 
| (...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 13649   } else { | 13649   } else { | 
| 13650     // Handle last resort GC and make sure to allow future allocations | 13650     // Handle last resort GC and make sure to allow future allocations | 
| 13651     // to grow the heap without causing GCs (if possible). | 13651     // to grow the heap without causing GCs (if possible). | 
| 13652     isolate->counters()->gc_last_resort_from_js()->Increment(); | 13652     isolate->counters()->gc_last_resort_from_js()->Increment(); | 
| 13653     isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13653     isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 
| 13654   } | 13654   } | 
| 13655 } | 13655 } | 
| 13656 | 13656 | 
| 13657 | 13657 | 
| 13658 } }  // namespace v8::internal | 13658 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|