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

Side by Side Diff: vm/object.cc

Issue 8417003: Enhance the array access API to deal with any objct that implements the list interface. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month 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/dart_api_impl_test.cc ('k') | vm/object_store.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 core_lib.AddClass(cls); 550 core_lib.AddClass(cls);
551 type = Type::NewNonParameterizedType(cls); 551 type = Type::NewNonParameterizedType(cls);
552 object_store->set_string_interface(type); 552 object_store->set_string_interface(type);
553 553
554 name = String::NewSymbol("bool"); 554 name = String::NewSymbol("bool");
555 cls = Class::NewInterface(name, script); 555 cls = Class::NewInterface(name, script);
556 core_lib.AddClass(cls); 556 core_lib.AddClass(cls);
557 type = Type::NewNonParameterizedType(cls); 557 type = Type::NewNonParameterizedType(cls);
558 object_store->set_bool_interface(type); 558 object_store->set_bool_interface(type);
559 559
560 name = String::NewSymbol("List");
561 cls = Class::NewInterface(name, script);
562 core_lib.AddClass(cls);
563 type = Type::NewNonParameterizedType(cls);
564 object_store->set_list_interface(type);
565
560 // The classes 'Null', 'Dynamic', and 'void' are not registered in the class 566 // The classes 'Null', 'Dynamic', and 'void' are not registered in the class
561 // dictionary and are not named, but corresponding types are stored in the 567 // dictionary and are not named, but corresponding types are stored in the
562 // object store. 568 // object store.
563 cls = null_class_; 569 cls = null_class_;
564 type = Type::NewNonParameterizedType(cls); 570 type = Type::NewNonParameterizedType(cls);
565 object_store->set_null_type(type); 571 object_store->set_null_type(type);
566 572
567 cls = dynamic_class_; 573 cls = dynamic_class_;
568 type = Type::NewNonParameterizedType(cls); 574 type = Type::NewNonParameterizedType(cls);
569 object_store->set_dynamic_type(type); 575 object_store->set_dynamic_type(type);
(...skipping 6217 matching lines...) Expand 10 before | Expand all | Expand 10 after
6787 const String& str = String::Handle(pattern()); 6793 const String& str = String::Handle(pattern());
6788 const char* format = "JSRegExp: pattern=%s flags=%s"; 6794 const char* format = "JSRegExp: pattern=%s flags=%s";
6789 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 6795 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
6790 char* chars = reinterpret_cast<char*>( 6796 char* chars = reinterpret_cast<char*>(
6791 Isolate::Current()->current_zone()->Allocate(len + 1)); 6797 Isolate::Current()->current_zone()->Allocate(len + 1));
6792 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 6798 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
6793 return chars; 6799 return chars;
6794 } 6800 }
6795 6801
6796 } // namespace dart 6802 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698