Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: src/debug/debug-frames.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing wrongly wrapped lines Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); 128 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check();
129 } 129 }
130 130
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()) value = isolate_->factory()->undefined_value(); 138 if (value->IsTheHole(isolate_)) {
139 value = isolate_->factory()->undefined_value();
140 }
139 if (value->IsOptimizedOut()) value = isolate_->factory()->undefined_value(); 141 if (value->IsOptimizedOut()) value = isolate_->factory()->undefined_value();
140 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check(); 142 JSObject::SetOwnPropertyIgnoreAttributes(target, name, value, NONE).Check();
141 } 143 }
142 } 144 }
143 145
144 146
145 void FrameInspector::MaterializeStackLocals(Handle<JSObject> target, 147 void FrameInspector::MaterializeStackLocals(Handle<JSObject> target,
146 Handle<JSFunction> function) { 148 Handle<JSFunction> function) {
147 Handle<SharedFunctionInfo> shared(function->shared()); 149 Handle<SharedFunctionInfo> shared(function->shared());
148 Handle<ScopeInfo> scope_info(shared->scope_info()); 150 Handle<ScopeInfo> scope_info(shared->scope_info());
(...skipping 21 matching lines...) Expand all
170 Handle<Object> value = 172 Handle<Object> value =
171 Object::GetPropertyOrElement(target, name).ToHandleChecked(); 173 Object::GetPropertyOrElement(target, name).ToHandleChecked();
172 frame_->SetParameterValue(i, *value); 174 frame_->SetParameterValue(i, *value);
173 } 175 }
174 176
175 // Stack locals. 177 // Stack locals.
176 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { 178 for (int i = 0; i < scope_info->StackLocalCount(); ++i) {
177 Handle<String> name(scope_info->StackLocalName(i)); 179 Handle<String> name(scope_info->StackLocalName(i));
178 if (ScopeInfo::VariableIsSynthetic(*name)) continue; 180 if (ScopeInfo::VariableIsSynthetic(*name)) continue;
179 int index = scope_info->StackLocalIndex(i); 181 int index = scope_info->StackLocalIndex(i);
180 if (frame_->GetExpression(index)->IsTheHole()) continue; 182 if (frame_->GetExpression(index)->IsTheHole(isolate_)) continue;
181 Handle<Object> value = 183 Handle<Object> value =
182 Object::GetPropertyOrElement(target, name).ToHandleChecked(); 184 Object::GetPropertyOrElement(target, name).ToHandleChecked();
183 frame_->SetExpression(index, *value); 185 frame_->SetExpression(index, *value);
184 } 186 }
185 } 187 }
186 188
187 189
188 bool FrameInspector::ParameterIsShadowedByContextLocal( 190 bool FrameInspector::ParameterIsShadowedByContextLocal(
189 Handle<ScopeInfo> info, Handle<String> parameter_name) { 191 Handle<ScopeInfo> info, Handle<String> parameter_name) {
190 VariableMode mode; 192 VariableMode mode;
(...skipping 26 matching lines...) Expand all
217 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue; 219 if (!frames[i].function()->shared()->IsSubjectToDebugging()) continue;
218 if (++count == index) return i; 220 if (++count == index) return i;
219 } 221 }
220 } 222 }
221 return -1; 223 return -1;
222 } 224 }
223 225
224 226
225 } // namespace internal 227 } // namespace internal
226 } // namespace v8 228 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698