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

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

Issue 9567023: Fix crash in inline cache: forgot to GC properly RawICData. Various cleanups. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « no previous file | runtime/vm/code_patcher_ia32.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) 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 int num_arguments, 76 int num_arguments,
77 const Array& optional_arguments_names) { 77 const Array& optional_arguments_names) {
78 const intptr_t num_named_args = 78 const intptr_t num_named_args =
79 optional_arguments_names.IsNull() ? 0 : optional_arguments_names.Length(); 79 optional_arguments_names.IsNull() ? 0 : optional_arguments_names.Length();
80 const intptr_t num_pos_args = num_arguments - num_named_args; 80 const intptr_t num_pos_args = num_arguments - num_named_args;
81 81
82 // Build the argument descriptor array, which consists of the total number of 82 // Build the argument descriptor array, which consists of the total number of
83 // arguments, the number of positional arguments, alphabetically sorted 83 // arguments, the number of positional arguments, alphabetically sorted
84 // pairs of name/position, and a terminating null. 84 // pairs of name/position, and a terminating null.
85 const int descriptor_len = 3 + (2 * num_named_args); 85 const int descriptor_len = 3 + (2 * num_named_args);
86 Array& descriptor = Array::ZoneHandle(Array::New(descriptor_len)); 86 Array& descriptor = Array::ZoneHandle(Array::New(descriptor_len, Heap::kOld));
87 87
88 // Set total number of passed arguments. 88 // Set total number of passed arguments.
89 descriptor.SetAt(0, Smi::Handle(Smi::New(num_arguments))); 89 descriptor.SetAt(0, Smi::Handle(Smi::New(num_arguments)));
90 // Set number of positional arguments. 90 // Set number of positional arguments.
91 descriptor.SetAt(1, Smi::Handle(Smi::New(num_pos_args))); 91 descriptor.SetAt(1, Smi::Handle(Smi::New(num_pos_args)));
92 // Set alphabetically sorted pairs of name/position for named arguments. 92 // Set alphabetically sorted pairs of name/position for named arguments.
93 String& name = String::Handle(); 93 String& name = String::Handle();
94 Smi& pos = Smi::Handle(); 94 Smi& pos = Smi::Handle();
95 for (int i = 0; i < num_named_args; i++) { 95 for (int i = 0; i < num_named_args; i++) {
96 name ^= optional_arguments_names.At(i); 96 name ^= optional_arguments_names.At(i);
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 } 1188 }
1189 } 1189 }
1190 } 1190 }
1191 // The cache is null terminated, therefore the loop above should never 1191 // The cache is null terminated, therefore the loop above should never
1192 // terminate by itself. 1192 // terminate by itself.
1193 UNREACHABLE(); 1193 UNREACHABLE();
1194 return Code::null(); 1194 return Code::null();
1195 } 1195 }
1196 1196
1197 } // namespace dart 1197 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_patcher_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698