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

Side by Side Diff: runtime/vm/debugger_api_impl_test.cc

Issue 27339003: When a value has been optimized away by the compiler, set its value to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/thread.h" 9 #include "vm/thread.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // Set up the breakpoint. 446 // Set up the breakpoint.
447 Dart_SetPausedEventHandler(InspectOptimizedStack_Breakpoint); 447 Dart_SetPausedEventHandler(InspectOptimizedStack_Breakpoint);
448 SetBreakpointAtEntry("", "breakpointNow"); 448 SetBreakpointAtEntry("", "breakpointNow");
449 449
450 // Run the code and inspect the stack. 450 // Run the code and inspect the stack.
451 stack_buffer[0] = '\0'; 451 stack_buffer[0] = '\0';
452 dart_args[0] = Dart_True(); 452 dart_args[0] = Dart_True();
453 dart_args[1] = Dart_NewInteger(kLowThreshold); 453 dart_args[1] = Dart_NewInteger(kLowThreshold);
454 EXPECT_VALID(Dart_Invoke(script_lib, NewString("test"), 2, dart_args)); 454 EXPECT_VALID(Dart_Invoke(script_lib, NewString("test"), 2, dart_args));
455 if (optimize) { 455 if (optimize) {
456 // Note that several variables have the value 'null' in the
457 // optimized case. This is because these values were determined
458 // to be dead by the optimizing compiler and their values were not
459 // preserved by the deopt information.
460 EXPECT_STREQ("[0] breakpointNow { }\n" 456 EXPECT_STREQ("[0] breakpointNow { }\n"
461 "[1] helper { a = 5 b = 99 stop = null }\n" 457 "[1] helper { a = 5 b = 99 stop = <optimized out> }\n"
462 "[2] anotherMiddleMan { one = null two = null stop = null }\n" 458 "[2] anotherMiddleMan { one = <optimized out> "
459 "two = <optimized out> stop = <optimized out> }\n"
463 "[3] middleMan { x = 5 limit = 100 stop = true value = 24255" 460 "[3] middleMan { x = 5 limit = 100 stop = true value = 24255"
464 " i = 99 }\n" 461 " i = 99 }\n"
465 "[4] test { stop = true limit = 100 }\n", 462 "[4] test { stop = true limit = 100 }\n",
466 stack_buffer); 463 stack_buffer);
467 } else { 464 } else {
468 EXPECT_STREQ("[0] breakpointNow { }\n" 465 EXPECT_STREQ("[0] breakpointNow { }\n"
469 "[1] helper { a = 5 b = 99 stop = true }\n" 466 "[1] helper { a = 5 b = 99 stop = true }\n"
470 "[2] anotherMiddleMan { one = 5 two = 99 stop = true }\n" 467 "[2] anotherMiddleMan { one = 5 two = 99 stop = true }\n"
471 "[3] middleMan { x = 5 limit = 100 stop = true value = 24255" 468 "[3] middleMan { x = 5 limit = 100 stop = true value = 24255"
472 " i = 99 }\n" 469 " i = 99 }\n"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 Dart_SetPausedEventHandler(InspectOptimizedStack_Breakpoint); 539 Dart_SetPausedEventHandler(InspectOptimizedStack_Breakpoint);
543 SetBreakpointAtEntry("", "breakpointNow"); 540 SetBreakpointAtEntry("", "breakpointNow");
544 541
545 // Run the code and inspect the stack. 542 // Run the code and inspect the stack.
546 stack_buffer[0] = '\0'; 543 stack_buffer[0] = '\0';
547 dart_args[0] = Dart_True(); 544 dart_args[0] = Dart_True();
548 dart_args[1] = Dart_NewInteger(kLowThreshold); 545 dart_args[1] = Dart_NewInteger(kLowThreshold);
549 EXPECT_VALID(Dart_Invoke(script_lib, NewString("test"), 2, dart_args)); 546 EXPECT_VALID(Dart_Invoke(script_lib, NewString("test"), 2, dart_args));
550 if (optimize) { 547 if (optimize) {
551 EXPECT_STREQ("[0] breakpointNow { }\n" 548 EXPECT_STREQ("[0] breakpointNow { }\n"
552 "[1] helper { a = 50 b = 99 stop = null }\n" 549 "[1] helper { a = 50 b = 99 stop = <optimized out> }\n"
553 "[2] <anonymous closure> { x = 5 i = 99 stop = true" 550 "[2] <anonymous closure> { x = 5 i = 99 stop = true"
554 " value = null }\n" 551 " value = <optimized out> }\n"
555 "[3] anotherMiddleMan { func = null }\n" 552 "[3] anotherMiddleMan { func = <optimized out> }\n"
556 "[4] middleMan { x = 5 limit = 100 stop = true" 553 "[4] middleMan { x = 5 limit = 100 stop = true"
557 " value = 242550 i = 99 }\n" 554 " value = 242550 i = 99 }\n"
558 "[5] test { stop = true limit = 100 }\n", 555 "[5] test { stop = true limit = 100 }\n",
559 stack_buffer); 556 stack_buffer);
560 } else { 557 } else {
561 EXPECT_STREQ("[0] breakpointNow { }\n" 558 EXPECT_STREQ("[0] breakpointNow { }\n"
562 "[1] helper { a = 50 b = 99 stop = true }\n" 559 "[1] helper { a = 50 b = 99 stop = true }\n"
563 "[2] <anonymous closure> { x = 5 i = 99 stop = true" 560 "[2] <anonymous closure> { x = 5 i = 99 stop = true"
564 " value = 10 }\n" 561 " value = 10 }\n"
565 "[3] anotherMiddleMan {" 562 "[3] anotherMiddleMan {"
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2017 2014
2018 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj); 2015 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj);
2019 Dart_Handle super_type = Dart_GetSupertype(list_type); 2016 Dart_Handle super_type = Dart_GetSupertype(list_type);
2020 EXPECT(!Dart_IsError(super_type)); 2017 EXPECT(!Dart_IsError(super_type));
2021 super_type = Dart_GetSupertype(super_type); 2018 super_type = Dart_GetSupertype(super_type);
2022 EXPECT(!Dart_IsError(super_type)); 2019 EXPECT(!Dart_IsError(super_type));
2023 EXPECT(super_type == Dart_Null()); 2020 EXPECT(super_type == Dart_Null());
2024 } 2021 }
2025 2022
2026 } // namespace dart 2023 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698