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

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

Issue 10317026: Inline type checks for complex uninstantiated types, e.g., List<T>. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 const intptr_t token_index = signature_function.token_index(); 1317 const intptr_t token_index = signature_function.token_index();
1318 Class& result = Class::Handle(New<Closure>(name, script, token_index)); 1318 Class& result = Class::Handle(New<Closure>(name, script, token_index));
1319 const Type& super_type = Type::Handle(Type::ObjectType()); 1319 const Type& super_type = Type::Handle(Type::ObjectType());
1320 ASSERT(!super_type.IsNull()); 1320 ASSERT(!super_type.IsNull());
1321 result.set_super_type(super_type); 1321 result.set_super_type(super_type);
1322 result.set_signature_function(signature_function); 1322 result.set_signature_function(signature_function);
1323 result.set_type_parameters(type_parameters); 1323 result.set_type_parameters(type_parameters);
1324 result.set_type_parameter_bounds(type_parameter_bounds); 1324 result.set_type_parameter_bounds(type_parameter_bounds);
1325 result.SetFields(Array::Handle(Array::Empty())); 1325 result.SetFields(Array::Handle(Array::Empty()));
1326 result.SetFunctions(Array::Handle(Array::Empty())); 1326 result.SetFunctions(Array::Handle(Array::Empty()));
1327 result.set_type_arguments_instance_field_offset(
1328 Closure::type_arguments_offset());
1327 // Implements interface "Function". 1329 // Implements interface "Function".
1328 const Type& function_interface = Type::Handle(Type::FunctionInterface()); 1330 const Type& function_interface = Type::Handle(Type::FunctionInterface());
1329 const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld)); 1331 const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld));
1330 interfaces.SetAt(0, function_interface); 1332 interfaces.SetAt(0, function_interface);
1331 result.set_interfaces(interfaces); 1333 result.set_interfaces(interfaces);
1332 // Unless the signature function already has a signature class, create a 1334 // Unless the signature function already has a signature class, create a
1333 // canonical signature class by having the signature function point back to 1335 // canonical signature class by having the signature function point back to
1334 // the signature class. 1336 // the signature class.
1335 if (signature_function.signature_class() == Object::null()) { 1337 if (signature_function.signature_class() == Object::null()) {
1336 signature_function.set_signature_class(result); 1338 signature_function.set_signature_class(result);
(...skipping 8056 matching lines...) Expand 10 before | Expand all | Expand 10 after
9393 const String& str = String::Handle(pattern()); 9395 const String& str = String::Handle(pattern());
9394 const char* format = "JSRegExp: pattern=%s flags=%s"; 9396 const char* format = "JSRegExp: pattern=%s flags=%s";
9395 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 9397 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
9396 char* chars = reinterpret_cast<char*>( 9398 char* chars = reinterpret_cast<char*>(
9397 Isolate::Current()->current_zone()->Allocate(len + 1)); 9399 Isolate::Current()->current_zone()->Allocate(len + 1));
9398 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 9400 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
9399 return chars; 9401 return chars;
9400 } 9402 }
9401 9403
9402 } // namespace dart 9404 } // namespace dart
OLDNEW
« runtime/vm/code_generator_x64.cc ('K') | « runtime/vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698