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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Second fill all stack locals. | 131 // Second fill all stack locals. |
132 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { | 132 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { |
133 Handle<String> name(scope_info->StackLocalName(i)); | 133 Handle<String> name(scope_info->StackLocalName(i)); |
134 if (ScopeInfo::VariableIsSynthetic(*name)) continue; | 134 if (ScopeInfo::VariableIsSynthetic(*name)) continue; |
135 Handle<Object> value = GetExpression(scope_info->StackLocalIndex(i)); | 135 Handle<Object> value = GetExpression(scope_info->StackLocalIndex(i)); |
136 // TODO(yangguo): We convert optimized out values to {undefined} when they | 136 // TODO(yangguo): We convert optimized out values to {undefined} when they |
137 // are passed to the debugger. Eventually we should handle them somehow. | 137 // are passed to the debugger. Eventually we should handle them somehow. |
138 if (value->IsTheHole(isolate_)) { | 138 if (value->IsTheHole(isolate_)) { |
139 value = isolate_->factory()->undefined_value(); | 139 value = isolate_->factory()->undefined_value(); |
140 } | 140 } |
141 if (value->IsOptimizedOut(isolate_)) { | 141 if (value->IsOptimizedOut()) value = isolate_->factory()->undefined_value(); |
142 value = isolate_->factory()->undefined_value(); | |
143 } | |
144 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); | 142 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); |
145 } | 143 } |
146 } | 144 } |
147 | 145 |
148 | 146 |
149 void FrameInspector::MaterializeStackLocals(Handle<JSObject> target, | 147 void FrameInspector::MaterializeStackLocals(Handle<JSObject> target, |
150 Handle<JSFunction> function) { | 148 Handle<JSFunction> function) { |
151 Handle<SharedFunctionInfo> shared(function->shared()); | 149 Handle<SharedFunctionInfo> shared(function->shared()); |
152 Handle<ScopeInfo> scope_info(shared->scope_info()); | 150 Handle<ScopeInfo> scope_info(shared->scope_info()); |
153 MaterializeStackLocals(target, scope_info); | 151 MaterializeStackLocals(target, scope_info); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; | 219 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; |
222 if (++count == index) return i; | 220 if (++count == index) return i; |
223 } | 221 } |
224 } | 222 } |
225 return -1; | 223 return -1; |
226 } | 224 } |
227 | 225 |
228 | 226 |
229 } // namespace internal | 227 } // namespace internal |
230 } // namespace v8 | 228 } // namespace v8 |
OLD | NEW |