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

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

Issue 11299020: Make creation of list literal more resilient to changes in the underlying (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler_macros.h" 7 #include "vm/assembler_macros.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 String::Handle(Class::Handle(function.Owner()).Name()); 76 String::Handle(Class::Handle(function.Owner()).Name());
77 OS::Print("< Exiting '%s.%s'\n", 77 OS::Print("< Exiting '%s.%s'\n",
78 class_name.ToCString(), function_name.ToCString()); 78 class_name.ToCString(), function_name.ToCString());
79 } 79 }
80 80
81 81
82 // Allocation of a fixed length array of given element type. 82 // Allocation of a fixed length array of given element type.
83 // This runtime entry is never called for allocating a List of a generic type, 83 // This runtime entry is never called for allocating a List of a generic type,
84 // because a prior run time call instantiates the element type if necessary. 84 // because a prior run time call instantiates the element type if necessary.
85 // Arg0: array length. 85 // Arg0: array length.
86 // Arg1: array element type. 86 // Arg1: array type arguments, i.e. vector of 1 type, the element type.
87 // Return value: newly allocated array of length arg0. 87 // Return value: newly allocated array of length arg0.
88 DEFINE_RUNTIME_ENTRY(AllocateArray, 2) { 88 DEFINE_RUNTIME_ENTRY(AllocateArray, 2) {
89 ASSERT(arguments.ArgCount() == kAllocateArrayRuntimeEntry.argument_count()); 89 ASSERT(arguments.ArgCount() == kAllocateArrayRuntimeEntry.argument_count());
90 const Smi& length = Smi::CheckedHandle(arguments.ArgAt(0)); 90 const Smi& length = Smi::CheckedHandle(arguments.ArgAt(0));
91 const Array& array = Array::Handle(Array::New(length.Value())); 91 const Array& array = Array::Handle(Array::New(length.Value()));
92 arguments.SetReturn(array); 92 arguments.SetReturn(array);
93 AbstractTypeArguments& element_type = 93 AbstractTypeArguments& element_type =
94 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1)); 94 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1));
95 // An Array is raw or takes only one type argument. 95 // An Array is raw or takes only one type argument.
96 ASSERT(element_type.IsNull() || 96 ASSERT(element_type.IsNull() ||
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 intptr_t line, column; 1944 intptr_t line, column;
1945 script.GetTokenLocation(token_pos, &line, &column); 1945 script.GetTokenLocation(token_pos, &line, &column);
1946 String& line_string = String::Handle(script.GetLine(line)); 1946 String& line_string = String::Handle(script.GetLine(line));
1947 OS::Print(" Function: %s\n", top_function.ToFullyQualifiedCString()); 1947 OS::Print(" Function: %s\n", top_function.ToFullyQualifiedCString());
1948 OS::Print(" Line %"Pd": '%s'\n", line, line_string.ToCString()); 1948 OS::Print(" Line %"Pd": '%s'\n", line, line_string.ToCString());
1949 } 1949 }
1950 } 1950 }
1951 1951
1952 1952
1953 } // namespace dart 1953 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698