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

Side by Side Diff: vm/debugger_api_impl.cc

Issue 10783035: Create frequently used symbols in the vm isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 | « vm/debugger.cc ('k') | vm/exceptions.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 (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 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/debugger.h" 9 #include "vm/debugger.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
11 #include "vm/object_store.h" 11 #include "vm/object_store.h"
12 #include "vm/symbols.h"
12 13
13 namespace dart { 14 namespace dart {
14 15
15 #define UNWRAP_AND_CHECK_PARAM(type, var, param) \ 16 #define UNWRAP_AND_CHECK_PARAM(type, var, param) \
16 type& var = type::Handle(); \ 17 type& var = type::Handle(); \
17 do { \ 18 do { \
18 const Object& tmp = Object::Handle(Api::UnwrapHandle(param)); \ 19 const Object& tmp = Object::Handle(Api::UnwrapHandle(param)); \
19 if (tmp.IsNull()) { \ 20 if (tmp.IsNull()) { \
20 return Api::NewError("%s expects argument '%s' to be non-null.", \ 21 return Api::NewError("%s expects argument '%s' to be non-null.", \
21 CURRENT_FUNC, #param); \ 22 CURRENT_FUNC, #param); \
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 ASSERT(Smi::IsValid(imported.index())); 604 ASSERT(Smi::IsValid(imported.index()));
604 import_list.Add(Smi::Handle(Smi::New(imported.index()))); 605 import_list.Add(Smi::Handle(Smi::New(imported.index())));
605 } 606 }
606 LibraryPrefixIterator it(lib); 607 LibraryPrefixIterator it(lib);
607 LibraryPrefix& prefix = LibraryPrefix::Handle(isolate); 608 LibraryPrefix& prefix = LibraryPrefix::Handle(isolate);
608 while (it.HasNext()) { 609 while (it.HasNext()) {
609 prefix = it.GetNext(); 610 prefix = it.GetNext();
610 prefix_name = prefix.name(); 611 prefix_name = prefix.name();
611 ASSERT(!prefix_name.IsNull()); 612 ASSERT(!prefix_name.IsNull());
612 prefix_name = String::Concat(prefix_name, 613 prefix_name = String::Concat(prefix_name,
613 String::Handle(isolate, String::New("."))); 614 String::Handle(isolate, Symbols::Dot()));
614 for (int i = 0; i < prefix.num_libs(); i++) { 615 for (int i = 0; i < prefix.num_libs(); i++) {
615 imported = prefix.GetLibrary(i); 616 imported = prefix.GetLibrary(i);
616 import_list.Add(prefix_name); 617 import_list.Add(prefix_name);
617 import_list.Add(Smi::Handle(Smi::New(imported.index()))); 618 import_list.Add(Smi::Handle(Smi::New(imported.index())));
618 } 619 }
619 } 620 }
620 return Api::NewHandle(isolate, Array::MakeArray(import_list)); 621 return Api::NewHandle(isolate, Array::MakeArray(import_list));
621 } 622 }
622 623
623 624
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (lib.IsNull()) { 683 if (lib.IsNull()) {
683 return Api::NewError("%s: %d is not a valid library id", 684 return Api::NewError("%s: %d is not a valid library id",
684 CURRENT_FUNC, library_id); 685 CURRENT_FUNC, library_id);
685 } 686 }
686 lib.set_debuggable(is_debuggable); 687 lib.set_debuggable(is_debuggable);
687 return Api::True(isolate); 688 return Api::True(isolate);
688 } 689 }
689 690
690 691
691 } // namespace dart 692 } // namespace dart
OLDNEW
« no previous file with comments | « vm/debugger.cc ('k') | vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698