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

Side by Side Diff: vm/flags.cc

Issue 8439061: Support command line parameters to specify a url to file name mapping. This is used during snapsh... (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/flags.h ('k') | no next file » | 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/flags.h" 5 #include "vm/flags.h"
6 6
7 #include "vm/assert.h" 7 #include "vm/assert.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 static bool IsValidFlag(const char* name, 219 static bool IsValidFlag(const char* name,
220 const char* prefix, 220 const char* prefix,
221 intptr_t prefix_length) { 221 intptr_t prefix_length) {
222 intptr_t name_length = strlen(name); 222 intptr_t name_length = strlen(name);
223 return ((name_length > prefix_length) && 223 return ((name_length > prefix_length) &&
224 (strncmp(name, prefix, prefix_length) == 0)); 224 (strncmp(name, prefix, prefix_length) == 0));
225 } 225 }
226 226
227 227
228 void Flags::ProcessCommandLineFlags(int number_of_vm_flags, char** vm_flags) { 228 void Flags::ProcessCommandLineFlags(int number_of_vm_flags,
229 const char** vm_flags) {
229 const char* kPrefix = "--"; 230 const char* kPrefix = "--";
230 const intptr_t kPrefixLen = strlen(kPrefix); 231 const intptr_t kPrefixLen = strlen(kPrefix);
231 232
232 int i = 0; 233 int i = 0;
233 while ((i < number_of_vm_flags) && 234 while ((i < number_of_vm_flags) &&
234 IsValidFlag(vm_flags[i], kPrefix, kPrefixLen)) { 235 IsValidFlag(vm_flags[i], kPrefix, kPrefixLen)) {
235 const char* option = vm_flags[i] + kPrefixLen; 236 const char* option = vm_flags[i] + kPrefixLen;
236 Parse(option); 237 Parse(option);
237 i++; 238 i++;
238 } 239 }
(...skipping 21 matching lines...) Expand all
260 OS::Print("Flag settings:\n"); 261 OS::Print("Flag settings:\n");
261 Flag* flag = Flags::flags_; 262 Flag* flag = Flags::flags_;
262 while (flag != NULL) { 263 while (flag != NULL) {
263 flag->Print(); 264 flag->Print();
264 flag = flag->next_; 265 flag = flag->next_;
265 } 266 }
266 } 267 }
267 } 268 }
268 269
269 } // namespace dart 270 } // namespace dart
OLDNEW
« no previous file with comments | « vm/flags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698