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

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

Issue 1128803002: Lazily generate local var descriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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 | « runtime/vm/parser_test.cc ('k') | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "include/dart_debugger_api.h" 7 #include "include/dart_debugger_api.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 360 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
361 EXPECT_VALID(result); 361 EXPECT_VALID(result);
362 const Class& class_a = Class::Handle(GetClass(vmlib, "A")); 362 const Class& class_a = Class::Handle(GetClass(vmlib, "A"));
363 EXPECT(!class_a.IsNull()); 363 EXPECT(!class_a.IsNull());
364 const Function& function_c = Function::Handle(GetFunction(class_a, "c")); 364 const Function& function_c = Function::Handle(GetFunction(class_a, "c"));
365 EXPECT(!function_c.IsNull()); 365 EXPECT(!function_c.IsNull());
366 const Code& code_c = Code::Handle(function_c.CurrentCode()); 366 const Code& code_c = Code::Handle(function_c.CurrentCode());
367 EXPECT(!code_c.IsNull()); 367 EXPECT(!code_c.IsNull());
368 368
369 const LocalVarDescriptors& descriptors = 369 const LocalVarDescriptors& descriptors =
370 LocalVarDescriptors::Handle(code_c.var_descriptors()); 370 LocalVarDescriptors::Handle(code_c.GetLocalVarDescriptors());
371 // Generate an ID for this object. 371 // Generate an ID for this object.
372 ObjectIdRing* ring = isolate->object_id_ring(); 372 ObjectIdRing* ring = isolate->object_id_ring();
373 intptr_t id = ring->GetIdForObject(descriptors.raw()); 373 intptr_t id = ring->GetIdForObject(descriptors.raw());
374 374
375 // Build a mock message handler and wrap it in a dart port. 375 // Build a mock message handler and wrap it in a dart port.
376 ServiceTestMessageHandler handler; 376 ServiceTestMessageHandler handler;
377 Dart_Port port_id = PortMap::CreatePort(&handler); 377 Dart_Port port_id = PortMap::CreatePort(&handler);
378 Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id)); 378 Dart_Handle port = Api::NewHandle(isolate, SendPort::New(port_id));
379 EXPECT_VALID(port); 379 EXPECT_VALID(port);
380 EXPECT_VALID(Dart_SetField(lib, NewString("port"), port)); 380 EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]"); 588 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]");
589 Service::HandleIsolateMessage(isolate, service_msg); 589 Service::HandleIsolateMessage(isolate, service_msg);
590 handler.HandleNextMessage(); 590 handler.HandleNextMessage();
591 // Expect error. 591 // Expect error.
592 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); 592 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
593 } 593 }
594 594
595 #endif // !defined(TARGET_ARCH_ARM64) 595 #endif // !defined(TARGET_ARCH_ARM64)
596 596
597 } // namespace dart 597 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/parser_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698