v8  3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
json-parser.h
Go to the documentation of this file.
1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_JSON_PARSER_H_
29 #define V8_JSON_PARSER_H_
30 
31 #include "v8.h"
32 
33 #include "char-predicates-inl.h"
34 #include "v8conversions.h"
35 #include "messages.h"
36 #include "spaces-inl.h"
37 #include "token.h"
38 
39 namespace v8 {
40 namespace internal {
41 
42 // A simple json parser.
43 template <bool seq_ascii>
44 class JsonParser BASE_EMBEDDED {
45  public:
46  static Handle<Object> Parse(Handle<String> source, Zone* zone) {
47  return JsonParser().ParseJson(source, zone);
48  }
49 
50  static const int kEndOfString = -1;
51 
52  private:
53  // Parse a string containing a single JSON value.
54  Handle<Object> ParseJson(Handle<String> source, Zone* zone);
55 
56  inline void Advance() {
57  position_++;
58  if (position_ >= source_length_) {
59  c0_ = kEndOfString;
60  } else if (seq_ascii) {
61  c0_ = seq_source_->SeqAsciiStringGet(position_);
62  } else {
63  c0_ = source_->Get(position_);
64  }
65  }
66 
67  // The JSON lexical grammar is specified in the ECMAScript 5 standard,
68  // section 15.12.1.1. The only allowed whitespace characters between tokens
69  // are tab, carriage-return, newline and space.
70 
71  inline void AdvanceSkipWhitespace() {
72  do {
73  Advance();
74  } while (c0_ == '\t' || c0_ == '\r' || c0_ == '\n' || c0_ == ' ');
75  }
76 
77  inline void SkipWhitespace() {
78  while (c0_ == '\t' || c0_ == '\r' || c0_ == '\n' || c0_ == ' ') {
79  Advance();
80  }
81  }
82 
83  inline uc32 AdvanceGetChar() {
84  Advance();
85  return c0_;
86  }
87 
88  // Checks that current charater is c.
89  // If so, then consume c and skip whitespace.
90  inline bool MatchSkipWhiteSpace(uc32 c) {
91  if (c0_ == c) {
92  AdvanceSkipWhitespace();
93  return true;
94  }
95  return false;
96  }
97 
98  // A JSON string (production JSONString) is subset of valid JavaScript string
99  // literals. The string must only be double-quoted (not single-quoted), and
100  // the only allowed backslash-escapes are ", /, \, b, f, n, r, t and
101  // four-digit hex escapes (uXXXX). Any other use of backslashes is invalid.
102  Handle<String> ParseJsonString() {
103  return ScanJsonString<false>();
104  }
105  Handle<String> ParseJsonSymbol() {
106  return ScanJsonString<true>();
107  }
108  template <bool is_symbol>
109  Handle<String> ScanJsonString();
110  // Creates a new string and copies prefix[start..end] into the beginning
111  // of it. Then scans the rest of the string, adding characters after the
112  // prefix. Called by ScanJsonString when reaching a '\' or non-ASCII char.
113  template <typename StringType, typename SinkChar>
114  Handle<String> SlowScanJsonString(Handle<String> prefix, int start, int end);
115 
116  // A JSON number (production JSONNumber) is a subset of the valid JavaScript
117  // decimal number literals.
118  // It includes an optional minus sign, must have at least one
119  // digit before and after a decimal point, may not have prefixed zeros (unless
120  // the integer part is zero), and may include an exponent part (e.g., "e-10").
121  // Hexadecimal and octal numbers are not allowed.
122  Handle<Object> ParseJsonNumber();
123 
124  // Parse a single JSON value from input (grammar production JSONValue).
125  // A JSON value is either a (double-quoted) string literal, a number literal,
126  // one of "true", "false", or "null", or an object or array literal.
127  Handle<Object> ParseJsonValue();
128 
129  // Parse a JSON object literal (grammar production JSONObject).
130  // An object literal is a squiggly-braced and comma separated sequence
131  // (possibly empty) of key/value pairs, where the key is a JSON string
132  // literal, the value is a JSON value, and the two are separated by a colon.
133  // A JSON array doesn't allow numbers and identifiers as keys, like a
134  // JavaScript array.
135  Handle<Object> ParseJsonObject();
136 
137  // Parses a JSON array literal (grammar production JSONArray). An array
138  // literal is a square-bracketed and comma separated sequence (possibly empty)
139  // of JSON values.
140  // A JSON array doesn't allow leaving out values from the sequence, nor does
141  // it allow a terminal comma, like a JavaScript array does.
142  Handle<Object> ParseJsonArray();
143 
144 
145  // Mark that a parsing error has happened at the current token, and
146  // return a null handle. Primarily for readability.
147  inline Handle<Object> ReportUnexpectedCharacter() {
148  return Handle<Object>::null();
149  }
150 
151  inline Isolate* isolate() { return isolate_; }
152  inline Zone* zone() const { return zone_; }
153 
154  static const int kInitialSpecialStringLength = 1024;
155 
156 
157  private:
158  Handle<String> source_;
159  int source_length_;
160  Handle<SeqAsciiString> seq_source_;
161 
162  Isolate* isolate_;
163  uc32 c0_;
164  int position_;
165  Zone* zone_;
166 };
167 
168 template <bool seq_ascii>
169 Handle<Object> JsonParser<seq_ascii>::ParseJson(Handle<String> source,
170  Zone* zone) {
171  isolate_ = source->map()->GetHeap()->isolate();
172  zone_ = zone;
173  FlattenString(source);
174  source_ = source;
175  source_length_ = source_->length();
176 
177  // Optimized fast case where we only have ASCII characters.
178  if (seq_ascii) {
179  seq_source_ = Handle<SeqAsciiString>::cast(source_);
180  }
181 
182  // Set initial position right before the string.
183  position_ = -1;
184  // Advance to the first character (possibly EOS)
185  AdvanceSkipWhitespace();
186  Handle<Object> result = ParseJsonValue();
187  if (result.is_null() || c0_ != kEndOfString) {
188  // Parse failed. Current character is the unexpected token.
189 
190  const char* message;
191  Factory* factory = isolate()->factory();
192  Handle<JSArray> array;
193 
194  switch (c0_) {
195  case kEndOfString:
196  message = "unexpected_eos";
197  array = factory->NewJSArray(0);
198  break;
199  case '-':
200  case '0':
201  case '1':
202  case '2':
203  case '3':
204  case '4':
205  case '5':
206  case '6':
207  case '7':
208  case '8':
209  case '9':
210  message = "unexpected_token_number";
211  array = factory->NewJSArray(0);
212  break;
213  case '"':
214  message = "unexpected_token_string";
215  array = factory->NewJSArray(0);
216  break;
217  default:
218  message = "unexpected_token";
219  Handle<Object> name = LookupSingleCharacterStringFromCode(c0_);
220  Handle<FixedArray> element = factory->NewFixedArray(1);
221  element->set(0, *name);
222  array = factory->NewJSArrayWithElements(element);
223  break;
224  }
225 
226  MessageLocation location(factory->NewScript(source),
227  position_,
228  position_ + 1);
229  Handle<Object> result = factory->NewSyntaxError(message, array);
230  isolate()->Throw(*result, &location);
231  return Handle<Object>::null();
232  }
233  return result;
234 }
235 
236 
237 // Parse any JSON value.
238 template <bool seq_ascii>
239 Handle<Object> JsonParser<seq_ascii>::ParseJsonValue() {
240  switch (c0_) {
241  case '"':
242  return ParseJsonString();
243  case '-':
244  case '0':
245  case '1':
246  case '2':
247  case '3':
248  case '4':
249  case '5':
250  case '6':
251  case '7':
252  case '8':
253  case '9':
254  return ParseJsonNumber();
255  case 'f':
256  if (AdvanceGetChar() == 'a' && AdvanceGetChar() == 'l' &&
257  AdvanceGetChar() == 's' && AdvanceGetChar() == 'e') {
258  AdvanceSkipWhitespace();
259  return isolate()->factory()->false_value();
260  } else {
261  return ReportUnexpectedCharacter();
262  }
263  case 't':
264  if (AdvanceGetChar() == 'r' && AdvanceGetChar() == 'u' &&
265  AdvanceGetChar() == 'e') {
266  AdvanceSkipWhitespace();
267  return isolate()->factory()->true_value();
268  } else {
269  return ReportUnexpectedCharacter();
270  }
271  case 'n':
272  if (AdvanceGetChar() == 'u' && AdvanceGetChar() == 'l' &&
273  AdvanceGetChar() == 'l') {
274  AdvanceSkipWhitespace();
275  return isolate()->factory()->null_value();
276  } else {
277  return ReportUnexpectedCharacter();
278  }
279  case '{':
280  return ParseJsonObject();
281  case '[':
282  return ParseJsonArray();
283  default:
284  return ReportUnexpectedCharacter();
285  }
286 }
287 
288 
289 // Parse a JSON object. Position must be right at '{'.
290 template <bool seq_ascii>
291 Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
292  Handle<JSFunction> object_constructor(
293  isolate()->global_context()->object_function());
294  Handle<JSObject> json_object =
295  isolate()->factory()->NewJSObject(object_constructor);
296  ASSERT_EQ(c0_, '{');
297 
298  AdvanceSkipWhitespace();
299  if (c0_ != '}') {
300  do {
301  if (c0_ != '"') return ReportUnexpectedCharacter();
302  Handle<String> key = ParseJsonSymbol();
303  if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter();
304  AdvanceSkipWhitespace();
305  Handle<Object> value = ParseJsonValue();
306  if (value.is_null()) return ReportUnexpectedCharacter();
307 
308  uint32_t index;
309  if (key->AsArrayIndex(&index)) {
310  JSObject::SetOwnElement(json_object, index, value, kNonStrictMode);
311  } else if (key->Equals(isolate()->heap()->Proto_symbol())) {
312  SetPrototype(json_object, value);
313  } else {
315  json_object, key, value, NONE);
316  }
317  } while (MatchSkipWhiteSpace(','));
318  if (c0_ != '}') {
319  return ReportUnexpectedCharacter();
320  }
321  }
322  AdvanceSkipWhitespace();
323  return json_object;
324 }
325 
326 // Parse a JSON array. Position must be right at '['.
327 template <bool seq_ascii>
328 Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() {
329  ZoneScope zone_scope(isolate(), DELETE_ON_EXIT);
330  ZoneList<Handle<Object> > elements(4, zone());
331  ASSERT_EQ(c0_, '[');
332 
333  AdvanceSkipWhitespace();
334  if (c0_ != ']') {
335  do {
336  Handle<Object> element = ParseJsonValue();
337  if (element.is_null()) return ReportUnexpectedCharacter();
338  elements.Add(element, zone());
339  } while (MatchSkipWhiteSpace(','));
340  if (c0_ != ']') {
341  return ReportUnexpectedCharacter();
342  }
343  }
344  AdvanceSkipWhitespace();
345  // Allocate a fixed array with all the elements.
346  Handle<FixedArray> fast_elements =
347  isolate()->factory()->NewFixedArray(elements.length());
348  for (int i = 0, n = elements.length(); i < n; i++) {
349  fast_elements->set(i, *elements[i]);
350  }
351  return isolate()->factory()->NewJSArrayWithElements(fast_elements);
352 }
353 
354 
355 template <bool seq_ascii>
356 Handle<Object> JsonParser<seq_ascii>::ParseJsonNumber() {
357  bool negative = false;
358  int beg_pos = position_;
359  if (c0_ == '-') {
360  Advance();
361  negative = true;
362  }
363  if (c0_ == '0') {
364  Advance();
365  // Prefix zero is only allowed if it's the only digit before
366  // a decimal point or exponent.
367  if ('0' <= c0_ && c0_ <= '9') return ReportUnexpectedCharacter();
368  } else {
369  int i = 0;
370  int digits = 0;
371  if (c0_ < '1' || c0_ > '9') return ReportUnexpectedCharacter();
372  do {
373  i = i * 10 + c0_ - '0';
374  digits++;
375  Advance();
376  } while (c0_ >= '0' && c0_ <= '9');
377  if (c0_ != '.' && c0_ != 'e' && c0_ != 'E' && digits < 10) {
378  SkipWhitespace();
379  return Handle<Smi>(Smi::FromInt((negative ? -i : i)), isolate());
380  }
381  }
382  if (c0_ == '.') {
383  Advance();
384  if (c0_ < '0' || c0_ > '9') return ReportUnexpectedCharacter();
385  do {
386  Advance();
387  } while (c0_ >= '0' && c0_ <= '9');
388  }
389  if (AsciiAlphaToLower(c0_) == 'e') {
390  Advance();
391  if (c0_ == '-' || c0_ == '+') Advance();
392  if (c0_ < '0' || c0_ > '9') return ReportUnexpectedCharacter();
393  do {
394  Advance();
395  } while (c0_ >= '0' && c0_ <= '9');
396  }
397  int length = position_ - beg_pos;
398  double number;
399  if (seq_ascii) {
400  Vector<const char> chars(seq_source_->GetChars() + beg_pos, length);
401  number = StringToDouble(isolate()->unicode_cache(),
402  chars,
403  NO_FLAGS, // Hex, octal or trailing junk.
404  OS::nan_value());
405  } else {
406  Vector<char> buffer = Vector<char>::New(length);
407  String::WriteToFlat(*source_, buffer.start(), beg_pos, position_);
408  Vector<const char> result =
409  Vector<const char>(reinterpret_cast<const char*>(buffer.start()),
410  length);
411  number = StringToDouble(isolate()->unicode_cache(),
412  result,
413  NO_FLAGS, // Hex, octal or trailing junk.
414  0.0);
415  buffer.Dispose();
416  }
417  SkipWhitespace();
418  return isolate()->factory()->NewNumber(number);
419 }
420 
421 
422 template <typename StringType>
423 inline void SeqStringSet(Handle<StringType> seq_str, int i, uc32 c);
424 
425 template <>
426 inline void SeqStringSet(Handle<SeqTwoByteString> seq_str, int i, uc32 c) {
427  seq_str->SeqTwoByteStringSet(i, c);
428 }
429 
430 template <>
431 inline void SeqStringSet(Handle<SeqAsciiString> seq_str, int i, uc32 c) {
432  seq_str->SeqAsciiStringSet(i, c);
433 }
434 
435 template <typename StringType>
436 inline Handle<StringType> NewRawString(Factory* factory, int length);
437 
438 template <>
439 inline Handle<SeqTwoByteString> NewRawString(Factory* factory, int length) {
440  return factory->NewRawTwoByteString(length, NOT_TENURED);
441 }
442 
443 template <>
444 inline Handle<SeqAsciiString> NewRawString(Factory* factory, int length) {
445  return factory->NewRawAsciiString(length, NOT_TENURED);
446 }
447 
448 
449 // Scans the rest of a JSON string starting from position_ and writes
450 // prefix[start..end] along with the scanned characters into a
451 // sequential string of type StringType.
452 template <bool seq_ascii>
453 template <typename StringType, typename SinkChar>
454 Handle<String> JsonParser<seq_ascii>::SlowScanJsonString(
455  Handle<String> prefix, int start, int end) {
456  int count = end - start;
457  int max_length = count + source_length_ - position_;
458  int length = Min(max_length, Max(kInitialSpecialStringLength, 2 * count));
459  Handle<StringType> seq_str = NewRawString<StringType>(isolate()->factory(),
460  length);
461  // Copy prefix into seq_str.
462  SinkChar* dest = seq_str->GetChars();
463  String::WriteToFlat(*prefix, dest, start, end);
464 
465  while (c0_ != '"') {
466  // Check for control character (0x00-0x1f) or unterminated string (<0).
467  if (c0_ < 0x20) return Handle<String>::null();
468  if (count >= length) {
469  // We need to create a longer sequential string for the result.
470  return SlowScanJsonString<StringType, SinkChar>(seq_str, 0, count);
471  }
472  if (c0_ != '\\') {
473  // If the sink can contain UC16 characters, or source_ contains only
474  // ASCII characters, there's no need to test whether we can store the
475  // character. Otherwise check whether the UC16 source character can fit
476  // in the ASCII sink.
477  if (sizeof(SinkChar) == kUC16Size ||
478  seq_ascii ||
479  c0_ <= kMaxAsciiCharCode) {
480  SeqStringSet(seq_str, count++, c0_);
481  Advance();
482  } else {
483  // StringType is SeqAsciiString and we just read a non-ASCII char.
484  return SlowScanJsonString<SeqTwoByteString, uc16>(seq_str, 0, count);
485  }
486  } else {
487  Advance(); // Advance past the \.
488  switch (c0_) {
489  case '"':
490  case '\\':
491  case '/':
492  SeqStringSet(seq_str, count++, c0_);
493  break;
494  case 'b':
495  SeqStringSet(seq_str, count++, '\x08');
496  break;
497  case 'f':
498  SeqStringSet(seq_str, count++, '\x0c');
499  break;
500  case 'n':
501  SeqStringSet(seq_str, count++, '\x0a');
502  break;
503  case 'r':
504  SeqStringSet(seq_str, count++, '\x0d');
505  break;
506  case 't':
507  SeqStringSet(seq_str, count++, '\x09');
508  break;
509  case 'u': {
510  uc32 value = 0;
511  for (int i = 0; i < 4; i++) {
512  Advance();
513  int digit = HexValue(c0_);
514  if (digit < 0) {
515  return Handle<String>::null();
516  }
517  value = value * 16 + digit;
518  }
519  if (sizeof(SinkChar) == kUC16Size || value <= kMaxAsciiCharCode) {
520  SeqStringSet(seq_str, count++, value);
521  break;
522  } else {
523  // StringType is SeqAsciiString and we just read a non-ASCII char.
524  position_ -= 6; // Rewind position_ to \ in \uxxxx.
525  Advance();
526  return SlowScanJsonString<SeqTwoByteString, uc16>(seq_str,
527  0,
528  count);
529  }
530  }
531  default:
532  return Handle<String>::null();
533  }
534  Advance();
535  }
536  }
537  // Shrink seq_string length to count.
538  if (isolate()->heap()->InNewSpace(*seq_str)) {
539  isolate()->heap()->new_space()->
540  template ShrinkStringAtAllocationBoundary<StringType>(
541  *seq_str, count);
542  } else {
543  int string_size = StringType::SizeFor(count);
544  int allocated_string_size = StringType::SizeFor(length);
545  int delta = allocated_string_size - string_size;
546  Address start_filler_object = seq_str->address() + string_size;
547  seq_str->set_length(count);
548  isolate()->heap()->CreateFillerObjectAt(start_filler_object, delta);
549  }
550  ASSERT_EQ('"', c0_);
551  // Advance past the last '"'.
552  AdvanceSkipWhitespace();
553  return seq_str;
554 }
555 
556 
557 template <bool seq_ascii>
558 template <bool is_symbol>
559 Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
560  ASSERT_EQ('"', c0_);
561  Advance();
562  if (c0_ == '"') {
563  AdvanceSkipWhitespace();
564  return Handle<String>(isolate()->heap()->empty_string());
565  }
566  int beg_pos = position_;
567  // Fast case for ASCII only without escape characters.
568  do {
569  // Check for control character (0x00-0x1f) or unterminated string (<0).
570  if (c0_ < 0x20) return Handle<String>::null();
571  if (c0_ != '\\') {
572  if (seq_ascii || c0_ <= kMaxAsciiCharCode) {
573  Advance();
574  } else {
575  return SlowScanJsonString<SeqTwoByteString, uc16>(source_,
576  beg_pos,
577  position_);
578  }
579  } else {
580  return SlowScanJsonString<SeqAsciiString, char>(source_,
581  beg_pos,
582  position_);
583  }
584  } while (c0_ != '"');
585  int length = position_ - beg_pos;
586  Handle<String> result;
587  if (seq_ascii && is_symbol) {
588  result = isolate()->factory()->LookupAsciiSymbol(seq_source_,
589  beg_pos,
590  length);
591  } else {
592  result = isolate()->factory()->NewRawAsciiString(length);
593  char* dest = SeqAsciiString::cast(*result)->GetChars();
594  String::WriteToFlat(*source_, dest, beg_pos, position_);
595  }
596  ASSERT_EQ('"', c0_);
597  // Advance past the last '"'.
598  AdvanceSkipWhitespace();
599  return result;
600 }
601 
602 } } // namespace v8::internal
603 
604 #endif // V8_JSON_PARSER_H_
byte * Address
Definition: globals.h:172
void FlattenString(Handle< String > string)
Definition: handles.cc:211
static Smi * FromInt(int value)
Definition: objects-inl.h:973
Handle< SeqAsciiString > NewRawAsciiString(int length, PretenureFlag pretenure=NOT_TENURED)
Definition: factory.cc:225
value format" "after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false, "print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false, "print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false, "report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true, "garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true, "flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true, "use incremental marking") DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") DEFINE_bool(trace_incremental_marking, false, "trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true, "Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false, "Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true, "use inline caching") DEFINE_bool(native_code_counters, false, "generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false, "Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true, "Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false, "Never perform compaction on full GC-testing only") DEFINE_bool(compact_code_space, true, "Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true, "Flush inline caches prior to mark compact collection and" "flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0, "Default seed for initializing random generator" "(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true, "allows verbose printing") DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") DEFINE_bool(trace_sim, false, "Trace simulator execution") DEFINE_bool(check_icache, false, "Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator(4 or 8, 8 is default)") DEFINE_bool(trace_exception, false, "print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false, "preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true, "randomize hashes to avoid predictable hash collisions" "(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0, "Fixed seed to use to hash property keys(0 means random)" "(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false, "activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") DEFINE_int(testing_int_flag, 13, "testing_int_flag") DEFINE_float(testing_float_flag, 2.5, "float-flag") DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") DEFINE_string(testing_serialization_file, "/tmp/serdes", "file in which to serialize heap") DEFINE_bool(help, false, "Print usage message, including flags, on console") DEFINE_bool(dump_counters, false, "Dump counters on exit") DEFINE_string(map_counters, "", "Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT, "Pass all remaining arguments to the script.Alias for\"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#43"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2#define FLAG_MODE_DEFINE_DEFAULTS#1"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flag-definitions.h"1#define FLAG_FULL(ftype, ctype, nam, def, cmt)#define FLAG_READONLY(ftype, ctype, nam, def, cmt)#define DEFINE_implication(whenflag, thenflag)#define DEFINE_bool(nam, def, cmt)#define DEFINE_int(nam, def, cmt)#define DEFINE_float(nam, def, cmt)#define DEFINE_string(nam, def, cmt)#define DEFINE_args(nam, def, cmt)#define FLAG DEFINE_bool(use_strict, false,"enforce strict mode") DEFINE_bool(es5_readonly, false,"activate correct semantics for inheriting readonliness") DEFINE_bool(es52_globals, false,"activate new semantics for global var declarations") DEFINE_bool(harmony_typeof, false,"enable harmony semantics for typeof") DEFINE_bool(harmony_scoping, false,"enable harmony block scoping") DEFINE_bool(harmony_modules, false,"enable harmony modules (implies block scoping)") DEFINE_bool(harmony_proxies, false,"enable harmony proxies") DEFINE_bool(harmony_collections, false,"enable harmony collections (sets, maps, and weak maps)") DEFINE_bool(harmony, false,"enable all harmony features (except typeof)") DEFINE_implication(harmony, harmony_scoping) DEFINE_implication(harmony, harmony_modules) DEFINE_implication(harmony, harmony_proxies) DEFINE_implication(harmony, harmony_collections) DEFINE_implication(harmony_modules, harmony_scoping) DEFINE_bool(packed_arrays, false,"optimizes arrays that have no holes") DEFINE_bool(smi_only_arrays, true,"tracks arrays with only smi values") DEFINE_bool(clever_optimizations, true,"Optimize object size, Array shift, DOM strings and string +") DEFINE_bool(unbox_double_arrays, true,"automatically unbox arrays of doubles") DEFINE_bool(string_slices, true,"use string slices") DEFINE_bool(crankshaft, true,"use crankshaft") DEFINE_string(hydrogen_filter,"","optimization filter") DEFINE_bool(use_range, true,"use hydrogen range analysis") DEFINE_bool(eliminate_dead_phis, true,"eliminate dead phis") DEFINE_bool(use_gvn, true,"use hydrogen global value numbering") DEFINE_bool(use_canonicalizing, true,"use hydrogen instruction canonicalizing") DEFINE_bool(use_inlining, true,"use function inlining") DEFINE_int(max_inlined_source_size, 600,"maximum source size in bytes considered for a single inlining") DEFINE_int(max_inlined_nodes, 196,"maximum number of AST nodes considered for a single inlining") DEFINE_int(max_inlined_nodes_cumulative, 196,"maximum cumulative number of AST nodes considered for inlining") DEFINE_bool(loop_invariant_code_motion, true,"loop invariant code motion") DEFINE_bool(collect_megamorphic_maps_from_stub_cache, true,"crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false,"print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false,"trace generated hydrogen to file") DEFINE_string(trace_phase,"Z","trace generated IR for specified phases") DEFINE_bool(trace_inlining, false,"trace inlining decisions") DEFINE_bool(trace_alloc, false,"trace register allocator") DEFINE_bool(trace_all_uses, false,"trace all use positions") DEFINE_bool(trace_range, false,"trace range analysis") DEFINE_bool(trace_gvn, false,"trace global value numbering") DEFINE_bool(trace_representation, false,"trace representation types") DEFINE_bool(stress_pointer_maps, false,"pointer map for every instruction") DEFINE_bool(stress_environments, false,"environment for every instruction") DEFINE_int(deopt_every_n_times, 0,"deoptimize every n times a deopt point is passed") DEFINE_bool(trap_on_deopt, false,"put a break point before deoptimizing") DEFINE_bool(deoptimize_uncommon_cases, true,"deoptimize uncommon cases") DEFINE_bool(polymorphic_inlining, true,"polymorphic inlining") DEFINE_bool(use_osr, true,"use on-stack replacement") DEFINE_bool(array_bounds_checks_elimination, false,"perform array bounds checks elimination") DEFINE_bool(array_index_dehoisting, false,"perform array index dehoisting") DEFINE_bool(trace_osr, false,"trace on-stack replacement") DEFINE_int(stress_runs, 0,"number of stress runs") DEFINE_bool(optimize_closures, true,"optimize closures") DEFINE_bool(inline_construct, true,"inline constructor calls") DEFINE_bool(inline_arguments, true,"inline functions with arguments object") DEFINE_int(loop_weight, 1,"loop weight for representation inference") DEFINE_bool(optimize_for_in, true,"optimize functions containing for-in loops") DEFINE_bool(experimental_profiler, true,"enable all profiler experiments") DEFINE_bool(watch_ic_patching, false,"profiler considers IC stability") DEFINE_int(frame_count, 1,"number of stack frames inspected by the profiler") DEFINE_bool(self_optimization, false,"primitive functions trigger their own optimization") DEFINE_bool(direct_self_opt, false,"call recompile stub directly when self-optimizing") DEFINE_bool(retry_self_opt, false,"re-try self-optimization if it failed") DEFINE_bool(count_based_interrupts, false,"trigger profiler ticks based on counting instead of timing") DEFINE_bool(interrupt_at_exit, false,"insert an interrupt check at function exit") DEFINE_bool(weighted_back_edges, false,"weight back edges by jump distance for interrupt triggering") DEFINE_int(interrupt_budget, 5900,"execution budget before interrupt is triggered") DEFINE_int(type_info_threshold, 15,"percentage of ICs that must have type info to allow optimization") DEFINE_int(self_opt_count, 130,"call count before self-optimization") DEFINE_implication(experimental_profiler, watch_ic_patching) DEFINE_implication(experimental_profiler, self_optimization) DEFINE_implication(experimental_profiler, retry_self_opt) DEFINE_implication(experimental_profiler, count_based_interrupts) DEFINE_implication(experimental_profiler, interrupt_at_exit) DEFINE_implication(experimental_profiler, weighted_back_edges) DEFINE_bool(trace_opt_verbose, false,"extra verbose compilation tracing") DEFINE_implication(trace_opt_verbose, trace_opt) DEFINE_bool(debug_code, false,"generate extra code (assertions) for debugging") DEFINE_bool(code_comments, false,"emit comments in code disassembly") DEFINE_bool(enable_sse2, true,"enable use of SSE2 instructions if available") DEFINE_bool(enable_sse3, true,"enable use of SSE3 instructions if available") DEFINE_bool(enable_sse4_1, true,"enable use of SSE4.1 instructions if available") DEFINE_bool(enable_cmov, true,"enable use of CMOV instruction if available") DEFINE_bool(enable_rdtsc, true,"enable use of RDTSC instruction if available") DEFINE_bool(enable_sahf, true,"enable use of SAHF instruction if available (X64 only)") DEFINE_bool(enable_vfp3, true,"enable use of VFP3 instructions if available - this implies ""enabling ARMv7 instructions (ARM only)") DEFINE_bool(enable_armv7, true,"enable use of ARMv7 instructions if available (ARM only)") DEFINE_bool(enable_fpu, true,"enable use of MIPS FPU instructions if available (MIPS only)") DEFINE_string(expose_natives_as, NULL,"expose natives in global object") DEFINE_string(expose_debug_as, NULL,"expose debug in global object") DEFINE_bool(expose_gc, false,"expose gc extension") DEFINE_bool(expose_externalize_string, false,"expose externalize string extension") DEFINE_int(stack_trace_limit, 10,"number of stack frames to capture") DEFINE_bool(builtins_in_stack_traces, false,"show built-in functions in stack traces") DEFINE_bool(disable_native_files, false,"disable builtin natives files") DEFINE_bool(inline_new, true,"use fast inline allocation") DEFINE_bool(stack_trace_on_abort, true,"print a stack trace if an assertion failure occurs") DEFINE_bool(trace, false,"trace function calls") DEFINE_bool(mask_constants_with_cookie, true,"use random jit cookie to mask large constants") DEFINE_bool(lazy, true,"use lazy compilation") DEFINE_bool(trace_opt, false,"trace lazy optimization") DEFINE_bool(trace_opt_stats, false,"trace lazy optimization statistics") DEFINE_bool(opt, true,"use adaptive optimizations") DEFINE_bool(always_opt, false,"always try to optimize functions") DEFINE_bool(prepare_always_opt, false,"prepare for turning on always opt") DEFINE_bool(trace_deopt, false,"trace deoptimization") DEFINE_int(min_preparse_length, 1024,"minimum length for automatic enable preparsing") DEFINE_bool(always_full_compiler, false,"try to use the dedicated run-once backend for all code") DEFINE_bool(trace_bailout, false,"print reasons for falling back to using the classic V8 backend") DEFINE_bool(compilation_cache, true,"enable compilation cache") DEFINE_bool(cache_prototype_transitions, true,"cache prototype transitions") DEFINE_bool(trace_debug_json, false,"trace debugging JSON request/response") DEFINE_bool(debugger_auto_break, true,"automatically set the debug break flag when debugger commands are ""in the queue") DEFINE_bool(enable_liveedit, true,"enable liveedit experimental feature") DEFINE_bool(break_on_abort, true,"always cause a debug break before aborting") DEFINE_int(stack_size, kPointerSize *123,"default size of stack region v8 is allowed to use (in kBytes)") DEFINE_int(max_stack_trace_source_length, 300,"maximum length of function source code printed in a stack trace.") DEFINE_bool(always_inline_smi_code, false,"always inline smi code in non-opt code") DEFINE_int(max_new_space_size, 0,"max size of the new generation (in kBytes)") DEFINE_int(max_old_space_size, 0,"max size of the old generation (in Mbytes)") DEFINE_int(max_executable_size, 0,"max size of executable memory (in Mbytes)") DEFINE_bool(gc_global, false,"always perform global GCs") DEFINE_int(gc_interval,-1,"garbage collect after <n> allocations") DEFINE_bool(trace_gc, false,"print one trace line following each garbage collection") DEFINE_bool(trace_gc_nvp, false,"print one detailed trace line in name=value format ""after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false,"print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false,"print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false,"report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true,"garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true,"flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true,"use incremental marking") DEFINE_bool(incremental_marking_steps, true,"do incremental marking steps") DEFINE_bool(trace_incremental_marking, false,"trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true,"Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false,"Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true,"use inline caching") DEFINE_bool(native_code_counters, false,"generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false,"Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true,"Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false,"Never perform compaction on full GC - testing only") DEFINE_bool(compact_code_space, true,"Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true,"Flush inline caches prior to mark compact collection and ""flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0,"Default seed for initializing random generator ""(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true,"allows verbose printing") DEFINE_bool(allow_natives_syntax, false,"allow natives syntax") DEFINE_bool(trace_sim, false,"Trace simulator execution") DEFINE_bool(check_icache, false,"Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0,"Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8,"Stack alingment in bytes in simulator (4 or 8, 8 is default)") DEFINE_bool(trace_exception, false,"print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false,"preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true,"randomize hashes to avoid predictable hash collisions ""(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0,"Fixed seed to use to hash property keys (0 means random)""(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false,"activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true,"generate optimized regexp code") DEFINE_bool(testing_bool_flag, true,"testing_bool_flag") DEFINE_int(testing_int_flag, 13,"testing_int_flag") DEFINE_float(testing_float_flag, 2.5,"float-flag") DEFINE_string(testing_string_flag,"Hello, world!","string-flag") DEFINE_int(testing_prng_seed, 42,"Seed used for threading test randomness") DEFINE_string(testing_serialization_file,"/tmp/serdes","file in which to serialize heap") DEFINE_bool(help, false,"Print usage message, including flags, on console") DEFINE_bool(dump_counters, false,"Dump counters on exit") DEFINE_string(map_counters,"","Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT,"Pass all remaining arguments to the script. Alias for \"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#47"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2 namespace{struct Flag{enum FlagType{TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING, TYPE_ARGS} name
Definition: flags.cc:1349
static Handle< T > cast(Handle< S > that)
Definition: handles.h:81
int AsciiAlphaToLower(uc32 c)
int32_t uc32
Definition: globals.h:274
static Handle< Object > SetOwnElement(Handle< JSObject > object, uint32_t index, Handle< Object > value, StrictModeFlag strict_mode)
Definition: objects.cc:9651
double StringToDouble(UnicodeCache *unicode_cache, const char *str, int flags, double empty_string_val)
Definition: conversions.cc:41
static Handle< Object > Parse(Handle< String > source, Zone *zone)
Definition: json-parser.h:46
Handle< SeqTwoByteString > NewRawTwoByteString(int length, PretenureFlag pretenure=NOT_TENURED)
Definition: factory.cc:234
Handle< Object > LookupSingleCharacterStringFromCode(uint32_t index)
Definition: handles.cc:318
static SeqAsciiString * cast(Object *obj)
int HexValue(uc32 c)
Definition: scanner.h:66
static Handle< Object > SetLocalPropertyIgnoreAttributes(Handle< JSObject > object, Handle< String > key, Handle< Object > value, PropertyAttributes attributes)
Definition: objects.cc:2924
Definition: v8.h:104
static Vector< T > New(int length)
Definition: utils.h:369
#define BASE_EMBEDDED
Definition: allocation.h:68
static void WriteToFlat(String *source, sinkchar *sink, int from, int to)
Definition: objects.cc:6819
static double nan_value()
static Handle< T > null()
Definition: handles.h:86
#define ASSERT_EQ(v1, v2)
Definition: checks.h:271
Handle< StringType > NewRawString(Factory *factory, int length)
Definition: json-parser.h:439
Handle< Object > SetPrototype(Handle< JSFunction > function, Handle< Object > prototype)
Definition: handles.cc:221
void SeqStringSet(Handle< StringType > seq_str, int i, uc32 c)
const uc32 kMaxAsciiCharCode
Definition: globals.h:277
const int kUC16Size
Definition: globals.h:276