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

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

Issue 1810483002: Introduce "optimized_out" oddball marker for compilers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debugger. Created 4 years, 9 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
« no previous file with comments | « src/objects-debug.cc ('k') | src/types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/debug/debug-evaluate.h" 9 #include "src/debug/debug-evaluate.h"
10 #include "src/debug/debug-frames.h" 10 #include "src/debug/debug-frames.h"
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 Handle<FixedArray> locals = 547 Handle<FixedArray> locals =
548 isolate->factory()->NewFixedArray(local_count * 2); 548 isolate->factory()->NewFixedArray(local_count * 2);
549 549
550 // Fill in the values of the locals. 550 // Fill in the values of the locals.
551 int local = 0; 551 int local = 0;
552 int i = 0; 552 int i = 0;
553 for (; i < scope_info->StackLocalCount(); ++i) { 553 for (; i < scope_info->StackLocalCount(); ++i) {
554 // Use the value from the stack. 554 // Use the value from the stack.
555 if (scope_info->LocalIsSynthetic(i)) continue; 555 if (scope_info->LocalIsSynthetic(i)) continue;
556 locals->set(local * 2, scope_info->LocalName(i)); 556 locals->set(local * 2, scope_info->LocalName(i));
557 locals->set(local * 2 + 1, *(frame_inspector.GetExpression(i))); 557 Handle<Object> value = frame_inspector.GetExpression(i);
558 // TODO(yangguo): We convert optimized out values to {undefined} when they
559 // are passed to the debugger. Eventually we should handle them somehow.
560 if (value->IsOptimizedOut()) value = isolate->factory()->undefined_value();
561 locals->set(local * 2 + 1, *value);
558 local++; 562 local++;
559 } 563 }
560 if (local < local_count) { 564 if (local < local_count) {
561 // Get the context containing declarations. 565 // Get the context containing declarations.
562 Handle<Context> context( 566 Handle<Context> context(
563 Handle<Context>::cast(frame_inspector.GetContext())->closure_context()); 567 Handle<Context>::cast(frame_inspector.GetContext())->closure_context());
564 for (; i < scope_info->LocalCount(); ++i) { 568 for (; i < scope_info->LocalCount(); ++i) {
565 if (scope_info->LocalIsSynthetic(i)) continue; 569 if (scope_info->LocalIsSynthetic(i)) continue;
566 Handle<String> name(scope_info->LocalName(i)); 570 Handle<String> name(scope_info->LocalName(i));
567 VariableMode mode; 571 VariableMode mode;
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 return Smi::FromInt(isolate->debug()->is_active()); 1652 return Smi::FromInt(isolate->debug()->is_active());
1649 } 1653 }
1650 1654
1651 1655
1652 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1656 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1653 UNIMPLEMENTED(); 1657 UNIMPLEMENTED();
1654 return NULL; 1658 return NULL;
1655 } 1659 }
1656 } // namespace internal 1660 } // namespace internal
1657 } // namespace v8 1661 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698