| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/debug/debug-frames.h" | 5 #include "src/debug/debug-frames.h" |
| 6 | 6 |
| 7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 | 103 |
| 104 // Create a plain JSObject which materializes the local scope for the specified | 104 // Create a plain JSObject which materializes the local scope for the specified |
| 105 // frame. | 105 // frame. |
| 106 void FrameInspector::MaterializeStackLocals(Handle<JSObject> target, | 106 void FrameInspector::MaterializeStackLocals(Handle<JSObject> target, |
| 107 Handle<ScopeInfo> scope_info) { | 107 Handle<ScopeInfo> scope_info) { |
| 108 HandleScope scope(isolate_); | 108 HandleScope scope(isolate_); |
| 109 // First fill all parameters. | 109 // First fill all parameters. |
| 110 for (int i = 0; i < scope_info->ParameterCount(); ++i) { | 110 for (int i = 0; i < scope_info->ParameterCount(); ++i) { |
| 111 // Do not materialize the parameter if it is shadowed by a context local. | 111 // Do not materialize the parameter if it is shadowed by a context local. |
| 112 // TODO(yangguo): check whether this is necessary, now that we materialize |
| 113 // context locals as well. |
| 112 Handle<String> name(scope_info->ParameterName(i)); | 114 Handle<String> name(scope_info->ParameterName(i)); |
| 113 if (ParameterIsShadowedByContextLocal(scope_info, name)) continue; | 115 if (ParameterIsShadowedByContextLocal(scope_info, name)) continue; |
| 114 | 116 |
| 115 Handle<Object> value(i < GetParametersCount() | 117 Handle<Object> value(i < GetParametersCount() |
| 116 ? GetParameter(i) | 118 ? GetParameter(i) |
| 117 : isolate_->heap()->undefined_value(), | 119 : isolate_->heap()->undefined_value(), |
| 118 isolate_); | 120 isolate_); |
| 119 DCHECK(!value->IsTheHole()); | 121 DCHECK(!value->IsTheHole()); |
| 120 | 122 |
| 121 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); | 123 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; | 211 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; |
| 210 if (++count == index) return i; | 212 if (++count == index) return i; |
| 211 } | 213 } |
| 212 } | 214 } |
| 213 return -1; | 215 return -1; |
| 214 } | 216 } |
| 215 | 217 |
| 216 | 218 |
| 217 } // namespace internal | 219 } // namespace internal |
| 218 } // namespace v8 | 220 } // namespace v8 |
| OLD | NEW |