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
ast.cc
Go to the documentation of this file.
1 // Copyright 2012 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 #include "ast.h"
29 
30 #include <math.h> // For isfinite.
31 #include "builtins.h"
32 #include "conversions.h"
33 #include "hashmap.h"
34 #include "parser.h"
35 #include "property-details.h"
36 #include "property.h"
37 #include "scopes.h"
38 #include "string-stream.h"
39 #include "type-info.h"
40 
41 namespace v8 {
42 namespace internal {
43 
44 // ----------------------------------------------------------------------------
45 // All the Accept member functions for each syntax tree node type.
46 
47 #define DECL_ACCEPT(type) \
48  void type::Accept(AstVisitor* v) { v->Visit##type(this); }
50 #undef DECL_ACCEPT
51 
52 
53 // ----------------------------------------------------------------------------
54 // Implementation of other node functionality.
55 
56 
58  return AsLiteral() != NULL && AsLiteral()->handle()->IsSmi();
59 }
60 
61 
63  return AsLiteral() != NULL && AsLiteral()->handle()->IsString();
64 }
65 
66 
68  return AsLiteral() != NULL && AsLiteral()->handle()->IsNull();
69 }
70 
71 
73  : Expression(isolate),
74  name_(var->name()),
75  var_(NULL), // Will be set by the call to BindTo.
76  is_this_(var->is_this()),
77  is_trivial_(false),
78  is_lvalue_(false),
79  position_(RelocInfo::kNoPosition),
80  interface_(var->interface()) {
81  BindTo(var);
82 }
83 
84 
87  bool is_this,
88  int position,
89  Interface* interface)
90  : Expression(isolate),
91  name_(name),
92  var_(NULL),
93  is_this_(is_this),
94  is_trivial_(false),
95  is_lvalue_(false),
96  position_(position),
97  interface_(interface) {
98  // Names must be canonicalized for fast equality checks.
99  ASSERT(name->IsSymbol());
100 }
101 
102 
104  ASSERT(var_ == NULL); // must be bound only once
105  ASSERT(var != NULL); // must bind
106  ASSERT((is_this() && var->is_this()) || name_.is_identical_to(var->name()));
107  // Ideally CONST-ness should match. However, this is very hard to achieve
108  // because we don't know the exact semantics of conflicting (const and
109  // non-const) multiple variable declarations, const vars introduced via
110  // eval() etc. Const-ness and variable declarations are a complete mess
111  // in JS. Sigh...
112  var_ = var;
113  var->set_is_used(true);
114 }
115 
116 
118  Token::Value op,
119  Expression* target,
120  Expression* value,
121  int pos)
122  : Expression(isolate),
123  op_(op),
124  target_(target),
125  value_(value),
126  pos_(pos),
127  binary_operation_(NULL),
128  compound_load_id_(kNoNumber),
129  assignment_id_(GetNextId(isolate)),
130  block_start_(false),
131  block_end_(false),
132  is_monomorphic_(false) { }
133 
134 
136  switch (op_) {
137  case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
138  case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR;
139  case Token::ASSIGN_BIT_AND: return Token::BIT_AND;
140  case Token::ASSIGN_SHL: return Token::SHL;
141  case Token::ASSIGN_SAR: return Token::SAR;
142  case Token::ASSIGN_SHR: return Token::SHR;
143  case Token::ASSIGN_ADD: return Token::ADD;
144  case Token::ASSIGN_SUB: return Token::SUB;
145  case Token::ASSIGN_MUL: return Token::MUL;
146  case Token::ASSIGN_DIV: return Token::DIV;
147  case Token::ASSIGN_MOD: return Token::MOD;
148  default: UNREACHABLE();
149  }
150  return Token::ILLEGAL;
151 }
152 
153 
155  return scope()->AllowsLazyCompilation();
156 }
157 
158 
160  return scope()->start_position();
161 }
162 
163 
165  return scope()->end_position();
166 }
167 
168 
170  return scope()->language_mode();
171 }
172 
173 
175  Expression* value,
176  Isolate* isolate) {
177  emit_store_ = true;
178  key_ = key;
179  value_ = value;
180  Object* k = *key->handle();
181  if (k->IsSymbol() &&
182  isolate->heap()->Proto_symbol()->Equals(String::cast(k))) {
183  kind_ = PROTOTYPE;
184  } else if (value_->AsMaterializedLiteral() != NULL) {
185  kind_ = MATERIALIZED_LITERAL;
186  } else if (value_->AsLiteral() != NULL) {
187  kind_ = CONSTANT;
188  } else {
189  kind_ = COMPUTED;
190  }
191 }
192 
193 
195  emit_store_ = true;
196  value_ = value;
197  kind_ = is_getter ? GETTER : SETTER;
198 }
199 
200 
202  return kind_ == CONSTANT ||
203  (kind_ == MATERIALIZED_LITERAL &&
205 }
206 
207 
209  emit_store_ = emit_store;
210 }
211 
212 
214  return emit_store_;
215 }
216 
217 
218 bool IsEqualString(void* first, void* second) {
219  ASSERT((*reinterpret_cast<String**>(first))->IsString());
220  ASSERT((*reinterpret_cast<String**>(second))->IsString());
221  Handle<String> h1(reinterpret_cast<String**>(first));
222  Handle<String> h2(reinterpret_cast<String**>(second));
223  return (*h1)->Equals(*h2);
224 }
225 
226 
227 bool IsEqualNumber(void* first, void* second) {
228  ASSERT((*reinterpret_cast<Object**>(first))->IsNumber());
229  ASSERT((*reinterpret_cast<Object**>(second))->IsNumber());
230 
231  Handle<Object> h1(reinterpret_cast<Object**>(first));
232  Handle<Object> h2(reinterpret_cast<Object**>(second));
233  if (h1->IsSmi()) {
234  return h2->IsSmi() && *h1 == *h2;
235  }
236  if (h2->IsSmi()) return false;
239  ASSERT(isfinite(n1->value()));
240  ASSERT(isfinite(n2->value()));
241  return n1->value() == n2->value();
242 }
243 
244 
246  ZoneAllocationPolicy allocator(zone);
247 
249  allocator);
250  for (int i = properties()->length() - 1; i >= 0; i--) {
251  ObjectLiteral::Property* property = properties()->at(i);
252  Literal* literal = property->key();
253  if (literal->handle()->IsNull()) continue;
254  uint32_t hash = literal->Hash();
255  // If the key of a computed property is in the table, do not emit
256  // a store for the property later.
257  if (property->kind() == ObjectLiteral::Property::COMPUTED &&
258  table.Lookup(literal, hash, false, allocator) != NULL) {
259  property->set_emit_store(false);
260  } else {
261  // Add key to the table.
262  table.Lookup(literal, hash, true, allocator);
263  }
264  }
265 }
266 
267 
268 void TargetCollector::AddTarget(Label* target, Zone* zone) {
269  // Add the label to the collector, but discard duplicates.
270  int length = targets_.length();
271  for (int i = 0; i < length; i++) {
272  if (targets_[i] == target) return;
273  }
274  targets_.Add(target, zone);
275 }
276 
277 
279  switch (op_) {
280  case Token::BIT_NOT:
281  case Token::SUB:
282  return true;
283  default:
284  return false;
285  }
286 }
287 
288 
290  switch (op_) {
291  case Token::COMMA:
292  case Token::OR:
293  case Token::AND:
294  return false;
295  case Token::BIT_OR:
296  case Token::BIT_XOR:
297  case Token::BIT_AND:
298  case Token::SHL:
299  case Token::SAR:
300  case Token::SHR:
301  case Token::ADD:
302  case Token::SUB:
303  case Token::MUL:
304  case Token::DIV:
305  case Token::MOD:
306  return true;
307  default:
308  UNREACHABLE();
309  }
310  return false;
311 }
312 
313 
314 static bool IsTypeof(Expression* expr) {
315  UnaryOperation* maybe_unary = expr->AsUnaryOperation();
316  return maybe_unary != NULL && maybe_unary->op() == Token::TYPEOF;
317 }
318 
319 
320 // Check for the pattern: typeof <expression> equals <string literal>.
321 static bool MatchLiteralCompareTypeof(Expression* left,
322  Token::Value op,
323  Expression* right,
324  Expression** expr,
326  if (IsTypeof(left) && right->IsStringLiteral() && Token::IsEqualityOp(op)) {
327  *expr = left->AsUnaryOperation()->expression();
328  *check = Handle<String>::cast(right->AsLiteral()->handle());
329  return true;
330  }
331  return false;
332 }
333 
334 
336  Handle<String>* check) {
337  return MatchLiteralCompareTypeof(left_, op_, right_, expr, check) ||
338  MatchLiteralCompareTypeof(right_, op_, left_, expr, check);
339 }
340 
341 
342 static bool IsVoidOfLiteral(Expression* expr) {
343  UnaryOperation* maybe_unary = expr->AsUnaryOperation();
344  return maybe_unary != NULL &&
345  maybe_unary->op() == Token::VOID &&
346  maybe_unary->expression()->AsLiteral() != NULL;
347 }
348 
349 
350 // Check for the pattern: void <literal> equals <expression>
351 static bool MatchLiteralCompareUndefined(Expression* left,
352  Token::Value op,
353  Expression* right,
354  Expression** expr) {
355  if (IsVoidOfLiteral(left) && Token::IsEqualityOp(op)) {
356  *expr = right;
357  return true;
358  }
359  return false;
360 }
361 
362 
364  return MatchLiteralCompareUndefined(left_, op_, right_, expr) ||
365  MatchLiteralCompareUndefined(right_, op_, left_, expr);
366 }
367 
368 
369 // Check for the pattern: null equals <expression>
370 static bool MatchLiteralCompareNull(Expression* left,
371  Token::Value op,
372  Expression* right,
373  Expression** expr) {
374  if (left->IsNullLiteral() && Token::IsEqualityOp(op)) {
375  *expr = right;
376  return true;
377  }
378  return false;
379 }
380 
381 
383  return MatchLiteralCompareNull(left_, op_, right_, expr) ||
384  MatchLiteralCompareNull(right_, op_, left_, expr);
385 }
386 
387 
388 // ----------------------------------------------------------------------------
389 // Inlining support
390 
392  return proxy()->var()->IsStackAllocated();
393 }
394 
396  return false;
397 }
398 
399 
400 // ----------------------------------------------------------------------------
401 // Recording of type feedback
402 
403 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle,
404  Zone* zone) {
405  // Record type feedback from the oracle in the AST.
406  is_uninitialized_ = oracle->LoadIsUninitialized(this);
407  if (is_uninitialized_) return;
408 
409  is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this);
410  receiver_types_.Clear();
411  if (key()->IsPropertyName()) {
412  if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_ArrayLength)) {
413  is_array_length_ = true;
414  } else if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_StringLength)) {
415  is_string_length_ = true;
416  } else if (oracle->LoadIsBuiltin(this,
417  Builtins::kLoadIC_FunctionPrototype)) {
418  is_function_prototype_ = true;
419  } else {
420  Literal* lit_key = key()->AsLiteral();
421  ASSERT(lit_key != NULL && lit_key->handle()->IsString());
423  oracle->LoadReceiverTypes(this, name, &receiver_types_);
424  }
425  } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
426  is_string_access_ = true;
427  } else if (is_monomorphic_) {
428  receiver_types_.Add(oracle->LoadMonomorphicReceiverType(this),
429  zone);
430  } else if (oracle->LoadIsMegamorphicWithTypeInfo(this)) {
431  receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
432  oracle->CollectKeyedReceiverTypes(this->id(), &receiver_types_);
433  }
434 }
435 
436 
437 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle,
438  Zone* zone) {
439  Property* prop = target()->AsProperty();
440  ASSERT(prop != NULL);
441  is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this);
442  receiver_types_.Clear();
443  if (prop->key()->IsPropertyName()) {
444  Literal* lit_key = prop->key()->AsLiteral();
445  ASSERT(lit_key != NULL && lit_key->handle()->IsString());
447  oracle->StoreReceiverTypes(this, name, &receiver_types_);
448  } else if (is_monomorphic_) {
449  // Record receiver type for monomorphic keyed stores.
450  receiver_types_.Add(oracle->StoreMonomorphicReceiverType(this), zone);
451  } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) {
452  receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
453  oracle->CollectKeyedReceiverTypes(this->id(), &receiver_types_);
454  }
455 }
456 
457 
458 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle,
459  Zone* zone) {
460  is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this);
461  receiver_types_.Clear();
462  if (is_monomorphic_) {
463  // Record receiver type for monomorphic keyed stores.
464  receiver_types_.Add(oracle->StoreMonomorphicReceiverType(this), zone);
465  } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) {
466  receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
467  oracle->CollectKeyedReceiverTypes(this->id(), &receiver_types_);
468  }
469 }
470 
471 
472 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
473  TypeInfo info = oracle->SwitchType(this);
474  if (info.IsSmi()) {
475  compare_type_ = SMI_ONLY;
476  } else if (info.IsSymbol()) {
477  compare_type_ = SYMBOL_ONLY;
478  } else if (info.IsNonSymbol()) {
479  compare_type_ = STRING_ONLY;
480  } else if (info.IsNonPrimitive()) {
481  compare_type_ = OBJECT_ONLY;
482  } else {
483  ASSERT(compare_type_ == NONE);
484  }
485 }
486 
487 
489  // If there is an interceptor, we can't compute the target for a direct call.
490  if (type->has_named_interceptor()) return false;
491 
492  if (check_type_ == RECEIVER_MAP_CHECK) {
493  // For primitive checks the holder is set up to point to the corresponding
494  // prototype object, i.e. one step of the algorithm below has been already
495  // performed. For non-primitive checks we clear it to allow computing
496  // targets for polymorphic calls.
497  holder_ = Handle<JSObject>::null();
498  }
499  LookupResult lookup(type->GetIsolate());
500  while (true) {
501  type->LookupInDescriptors(NULL, *name, &lookup);
502  if (lookup.IsFound()) {
503  switch (lookup.type()) {
504  case CONSTANT_FUNCTION:
505  // We surely know the target for a constant function.
506  target_ =
507  Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type));
508  return true;
509  case NORMAL:
510  case FIELD:
511  case CALLBACKS:
512  case HANDLER:
513  case INTERCEPTOR:
514  // We don't know the target.
515  return false;
516  case MAP_TRANSITION:
517  case CONSTANT_TRANSITION:
518  case NULL_DESCRIPTOR:
519  // Perhaps something interesting is up in the prototype chain...
520  break;
521  }
522  }
523  // If we reach the end of the prototype chain, we don't know the target.
524  if (!type->prototype()->IsJSObject()) return false;
525  // Go up the prototype chain, recording where we are currently.
526  holder_ = Handle<JSObject>(JSObject::cast(type->prototype()));
527  type = Handle<Map>(holder()->map());
528  }
529 }
530 
531 
533  LookupResult* lookup) {
534  target_ = Handle<JSFunction>::null();
536  ASSERT(lookup->IsFound() &&
537  lookup->type() == NORMAL &&
538  lookup->holder() == *global);
539  cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(lookup));
540  if (cell_->value()->IsJSFunction()) {
541  Handle<JSFunction> candidate(JSFunction::cast(cell_->value()));
542  // If the function is in new space we assume it's more likely to
543  // change and thus prefer the general IC code.
544  if (!HEAP->InNewSpace(*candidate)) {
545  target_ = candidate;
546  return true;
547  }
548  }
549  return false;
550 }
551 
552 
553 void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle,
554  CallKind call_kind) {
555  is_monomorphic_ = oracle->CallIsMonomorphic(this);
556  Property* property = expression()->AsProperty();
557  if (property == NULL) {
558  // Function call. Specialize for monomorphic calls.
559  if (is_monomorphic_) target_ = oracle->GetCallTarget(this);
560  } else {
561  // Method call. Specialize for the receiver types seen at runtime.
562  Literal* key = property->key()->AsLiteral();
563  ASSERT(key != NULL && key->handle()->IsString());
565  receiver_types_.Clear();
566  oracle->CallReceiverTypes(this, name, call_kind, &receiver_types_);
567 #ifdef DEBUG
569  int length = receiver_types_.length();
570  for (int i = 0; i < length; i++) {
571  Handle<Map> map = receiver_types_.at(i);
572  ASSERT(!map.is_null() && *map != NULL);
573  }
574  }
575 #endif
576  check_type_ = oracle->GetCallCheckType(this);
577  if (is_monomorphic_) {
578  Handle<Map> map;
579  if (receiver_types_.length() > 0) {
580  ASSERT(check_type_ == RECEIVER_MAP_CHECK);
581  map = receiver_types_.at(0);
582  } else {
583  ASSERT(check_type_ != RECEIVER_MAP_CHECK);
584  holder_ = Handle<JSObject>(
585  oracle->GetPrototypeForPrimitiveCheck(check_type_));
586  map = Handle<Map>(holder_->map());
587  }
588  is_monomorphic_ = ComputeTarget(map, name);
589  }
590  }
591 }
592 
593 
594 void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
595  is_monomorphic_ = oracle->CallNewIsMonomorphic(this);
596  if (is_monomorphic_) {
597  target_ = oracle->GetCallNewTarget(this);
598  }
599 }
600 
601 
602 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
603  TypeInfo info = oracle->CompareType(this);
604  if (info.IsSmi()) {
605  compare_type_ = SMI_ONLY;
606  } else if (info.IsNonPrimitive()) {
607  compare_type_ = OBJECT_ONLY;
608  } else {
609  ASSERT(compare_type_ == NONE);
610  }
611 }
612 
613 
614 void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
615  receiver_type_ = oracle->ObjectLiteralStoreIsMonomorphic(this)
616  ? oracle->GetObjectLiteralStoreMap(this)
617  : Handle<Map>::null();
618 }
619 
620 
621 // ----------------------------------------------------------------------------
622 // Implementation of AstVisitor
623 
624 bool AstVisitor::CheckStackOverflow() {
625  if (stack_overflow_) return true;
626  StackLimitCheck check(isolate_);
627  if (!check.HasOverflowed()) return false;
628  return (stack_overflow_ = true);
629 }
630 
631 
632 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) {
633  for (int i = 0; i < declarations->length(); i++) {
634  Visit(declarations->at(i));
635  }
636 }
637 
638 
639 void AstVisitor::VisitStatements(ZoneList<Statement*>* statements) {
640  for (int i = 0; i < statements->length(); i++) {
641  Visit(statements->at(i));
642  }
643 }
644 
645 
646 void AstVisitor::VisitExpressions(ZoneList<Expression*>* expressions) {
647  for (int i = 0; i < expressions->length(); i++) {
648  // The variable statement visiting code may pass NULL expressions
649  // to this code. Maybe this should be handled by introducing an
650  // undefined expression or literal? Revisit this code if this
651  // changes
652  Expression* expression = expressions->at(i);
653  if (expression != NULL) Visit(expression);
654  }
655 }
656 
657 
658 // ----------------------------------------------------------------------------
659 // Regular expressions
660 
661 #define MAKE_ACCEPT(Name) \
662  void* RegExp##Name::Accept(RegExpVisitor* visitor, void* data) { \
663  return visitor->Visit##Name(this, data); \
664  }
666 #undef MAKE_ACCEPT
667 
668 #define MAKE_TYPE_CASE(Name) \
669  RegExp##Name* RegExpTree::As##Name() { \
670  return NULL; \
671  } \
672  bool RegExpTree::Is##Name() { return false; }
674 #undef MAKE_TYPE_CASE
675 
676 #define MAKE_TYPE_CASE(Name) \
677  RegExp##Name* RegExp##Name::As##Name() { \
678  return this; \
679  } \
680  bool RegExp##Name::Is##Name() { return true; }
682 #undef MAKE_TYPE_CASE
683 
684 
685 static Interval ListCaptureRegisters(ZoneList<RegExpTree*>* children) {
686  Interval result = Interval::Empty();
687  for (int i = 0; i < children->length(); i++)
688  result = result.Union(children->at(i)->CaptureRegisters());
689  return result;
690 }
691 
692 
694  return ListCaptureRegisters(nodes());
695 }
696 
697 
699  return ListCaptureRegisters(alternatives());
700 }
701 
702 
704  return body()->CaptureRegisters();
705 }
706 
707 
709  Interval self(StartRegister(index()), EndRegister(index()));
710  return self.Union(body()->CaptureRegisters());
711 }
712 
713 
715  return body()->CaptureRegisters();
716 }
717 
718 
721 }
722 
723 
726 }
727 
728 
730  ZoneList<RegExpTree*>* nodes = this->nodes();
731  for (int i = 0; i < nodes->length(); i++) {
732  RegExpTree* node = nodes->at(i);
733  if (node->IsAnchoredAtStart()) { return true; }
734  if (node->max_match() > 0) { return false; }
735  }
736  return false;
737 }
738 
739 
741  ZoneList<RegExpTree*>* nodes = this->nodes();
742  for (int i = nodes->length() - 1; i >= 0; i--) {
743  RegExpTree* node = nodes->at(i);
744  if (node->IsAnchoredAtEnd()) { return true; }
745  if (node->max_match() > 0) { return false; }
746  }
747  return false;
748 }
749 
750 
752  ZoneList<RegExpTree*>* alternatives = this->alternatives();
753  for (int i = 0; i < alternatives->length(); i++) {
754  if (!alternatives->at(i)->IsAnchoredAtStart())
755  return false;
756  }
757  return true;
758 }
759 
760 
762  ZoneList<RegExpTree*>* alternatives = this->alternatives();
763  for (int i = 0; i < alternatives->length(); i++) {
764  if (!alternatives->at(i)->IsAnchoredAtEnd())
765  return false;
766  }
767  return true;
768 }
769 
770 
772  return is_positive() && body()->IsAnchoredAtStart();
773 }
774 
775 
777  return body()->IsAnchoredAtStart();
778 }
779 
780 
782  return body()->IsAnchoredAtEnd();
783 }
784 
785 
786 // Convert regular expression trees to a simple sexp representation.
787 // This representation should be different from the input grammar
788 // in as many cases as possible, to make it more difficult for incorrect
789 // parses to look as correct ones which is likely if the input and
790 // output formats are alike.
791 class RegExpUnparser: public RegExpVisitor {
792  public:
793  explicit RegExpUnparser(Zone* zone);
794  void VisitCharacterRange(CharacterRange that);
795  SmartArrayPointer<const char> ToString() { return stream_.ToCString(); }
796 #define MAKE_CASE(Name) virtual void* Visit##Name(RegExp##Name*, void* data);
798 #undef MAKE_CASE
799  private:
800  StringStream* stream() { return &stream_; }
801  HeapStringAllocator alloc_;
802  StringStream stream_;
803  Zone* zone_;
804 };
805 
806 
807 RegExpUnparser::RegExpUnparser(Zone* zone) : stream_(&alloc_), zone_(zone) {
808 }
809 
810 
811 void* RegExpUnparser::VisitDisjunction(RegExpDisjunction* that, void* data) {
812  stream()->Add("(|");
813  for (int i = 0; i < that->alternatives()->length(); i++) {
814  stream()->Add(" ");
815  that->alternatives()->at(i)->Accept(this, data);
816  }
817  stream()->Add(")");
818  return NULL;
819 }
820 
821 
822 void* RegExpUnparser::VisitAlternative(RegExpAlternative* that, void* data) {
823  stream()->Add("(:");
824  for (int i = 0; i < that->nodes()->length(); i++) {
825  stream()->Add(" ");
826  that->nodes()->at(i)->Accept(this, data);
827  }
828  stream()->Add(")");
829  return NULL;
830 }
831 
832 
834  stream()->Add("%k", that.from());
835  if (!that.IsSingleton()) {
836  stream()->Add("-%k", that.to());
837  }
838 }
839 
840 
841 
842 void* RegExpUnparser::VisitCharacterClass(RegExpCharacterClass* that,
843  void* data) {
844  if (that->is_negated())
845  stream()->Add("^");
846  stream()->Add("[");
847  for (int i = 0; i < that->ranges(zone_)->length(); i++) {
848  if (i > 0) stream()->Add(" ");
849  VisitCharacterRange(that->ranges(zone_)->at(i));
850  }
851  stream()->Add("]");
852  return NULL;
853 }
854 
855 
856 void* RegExpUnparser::VisitAssertion(RegExpAssertion* that, void* data) {
857  switch (that->type()) {
859  stream()->Add("@^i");
860  break;
862  stream()->Add("@$i");
863  break;
865  stream()->Add("@^l");
866  break;
868  stream()->Add("@$l");
869  break;
871  stream()->Add("@b");
872  break;
874  stream()->Add("@B");
875  break;
876  }
877  return NULL;
878 }
879 
880 
881 void* RegExpUnparser::VisitAtom(RegExpAtom* that, void* data) {
882  stream()->Add("'");
883  Vector<const uc16> chardata = that->data();
884  for (int i = 0; i < chardata.length(); i++) {
885  stream()->Add("%k", chardata[i]);
886  }
887  stream()->Add("'");
888  return NULL;
889 }
890 
891 
892 void* RegExpUnparser::VisitText(RegExpText* that, void* data) {
893  if (that->elements()->length() == 1) {
894  that->elements()->at(0).data.u_atom->Accept(this, data);
895  } else {
896  stream()->Add("(!");
897  for (int i = 0; i < that->elements()->length(); i++) {
898  stream()->Add(" ");
899  that->elements()->at(i).data.u_atom->Accept(this, data);
900  }
901  stream()->Add(")");
902  }
903  return NULL;
904 }
905 
906 
907 void* RegExpUnparser::VisitQuantifier(RegExpQuantifier* that, void* data) {
908  stream()->Add("(# %i ", that->min());
909  if (that->max() == RegExpTree::kInfinity) {
910  stream()->Add("- ");
911  } else {
912  stream()->Add("%i ", that->max());
913  }
914  stream()->Add(that->is_greedy() ? "g " : that->is_possessive() ? "p " : "n ");
915  that->body()->Accept(this, data);
916  stream()->Add(")");
917  return NULL;
918 }
919 
920 
921 void* RegExpUnparser::VisitCapture(RegExpCapture* that, void* data) {
922  stream()->Add("(^ ");
923  that->body()->Accept(this, data);
924  stream()->Add(")");
925  return NULL;
926 }
927 
928 
929 void* RegExpUnparser::VisitLookahead(RegExpLookahead* that, void* data) {
930  stream()->Add("(-> ");
931  stream()->Add(that->is_positive() ? "+ " : "- ");
932  that->body()->Accept(this, data);
933  stream()->Add(")");
934  return NULL;
935 }
936 
937 
938 void* RegExpUnparser::VisitBackReference(RegExpBackReference* that,
939  void* data) {
940  stream()->Add("(<- %i)", that->index());
941  return NULL;
942 }
943 
944 
945 void* RegExpUnparser::VisitEmpty(RegExpEmpty* that, void* data) {
946  stream()->Put('%');
947  return NULL;
948 }
949 
950 
952  RegExpUnparser unparser(zone);
953  Accept(&unparser, NULL);
954  return unparser.ToString();
955 }
956 
957 
959  : alternatives_(alternatives) {
960  ASSERT(alternatives->length() > 1);
961  RegExpTree* first_alternative = alternatives->at(0);
962  min_match_ = first_alternative->min_match();
963  max_match_ = first_alternative->max_match();
964  for (int i = 1; i < alternatives->length(); i++) {
965  RegExpTree* alternative = alternatives->at(i);
966  min_match_ = Min(min_match_, alternative->min_match());
967  max_match_ = Max(max_match_, alternative->max_match());
968  }
969 }
970 
971 
972 static int IncreaseBy(int previous, int increase) {
973  if (RegExpTree::kInfinity - previous < increase) {
974  return RegExpTree::kInfinity;
975  } else {
976  return previous + increase;
977  }
978 }
979 
981  : nodes_(nodes) {
982  ASSERT(nodes->length() > 1);
983  min_match_ = 0;
984  max_match_ = 0;
985  for (int i = 0; i < nodes->length(); i++) {
986  RegExpTree* node = nodes->at(i);
987  int node_min_match = node->min_match();
988  min_match_ = IncreaseBy(min_match_, node_min_match);
989  int node_max_match = node->max_match();
990  max_match_ = IncreaseBy(max_match_, node_max_match);
991  }
992 }
993 
994 
996  Expression* label,
997  ZoneList<Statement*>* statements,
998  int pos)
999  : label_(label),
1000  statements_(statements),
1001  position_(pos),
1002  compare_type_(NONE),
1003  compare_id_(AstNode::GetNextId(isolate)),
1004  entry_id_(AstNode::GetNextId(isolate)) {
1005 }
1006 
1007 
1008 #define REGULAR_NODE(NodeType) \
1009  void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
1010  increase_node_count(); \
1011  }
1012 #define DONT_OPTIMIZE_NODE(NodeType) \
1013  void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
1014  increase_node_count(); \
1015  add_flag(kDontOptimize); \
1016  add_flag(kDontInline); \
1017  add_flag(kDontSelfOptimize); \
1018  }
1019 #define DONT_INLINE_NODE(NodeType) \
1020  void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
1021  increase_node_count(); \
1022  add_flag(kDontInline); \
1023  }
1024 #define DONT_SELFOPTIMIZE_NODE(NodeType) \
1025  void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
1026  increase_node_count(); \
1027  add_flag(kDontSelfOptimize); \
1028  }
1029 
1030 REGULAR_NODE(VariableDeclaration)
1031 REGULAR_NODE(FunctionDeclaration)
1033 REGULAR_NODE(ExpressionStatement)
1034 REGULAR_NODE(EmptyStatement)
1035 REGULAR_NODE(IfStatement)
1036 REGULAR_NODE(ContinueStatement)
1037 REGULAR_NODE(BreakStatement)
1038 REGULAR_NODE(ReturnStatement)
1039 REGULAR_NODE(SwitchStatement)
1040 REGULAR_NODE(Conditional)
1041 REGULAR_NODE(Literal)
1042 REGULAR_NODE(ObjectLiteral)
1043 REGULAR_NODE(Assignment)
1044 REGULAR_NODE(Throw)
1045 REGULAR_NODE(Property)
1046 REGULAR_NODE(UnaryOperation)
1047 REGULAR_NODE(CountOperation)
1048 REGULAR_NODE(BinaryOperation)
1049 REGULAR_NODE(CompareOperation)
1050 REGULAR_NODE(ThisFunction)
1051 REGULAR_NODE(Call)
1052 REGULAR_NODE(CallNew)
1053 // In theory, for VariableProxy we'd have to add:
1054 // if (node->var()->IsLookupSlot()) add_flag(kDontInline);
1055 // But node->var() is usually not bound yet at VariableProxy creation time, and
1056 // LOOKUP variables only result from constructs that cannot be inlined anyway.
1057 REGULAR_NODE(VariableProxy)
1058 
1059 DONT_OPTIMIZE_NODE(ModuleDeclaration)
1060 DONT_OPTIMIZE_NODE(ImportDeclaration)
1061 DONT_OPTIMIZE_NODE(ExportDeclaration)
1062 DONT_OPTIMIZE_NODE(ModuleLiteral)
1063 DONT_OPTIMIZE_NODE(ModuleVariable)
1064 DONT_OPTIMIZE_NODE(ModulePath)
1065 DONT_OPTIMIZE_NODE(ModuleUrl)
1066 DONT_OPTIMIZE_NODE(WithStatement)
1067 DONT_OPTIMIZE_NODE(TryCatchStatement)
1068 DONT_OPTIMIZE_NODE(TryFinallyStatement)
1069 DONT_OPTIMIZE_NODE(DebuggerStatement)
1070 DONT_OPTIMIZE_NODE(SharedFunctionInfoLiteral)
1071 
1072 DONT_INLINE_NODE(FunctionLiteral)
1073 DONT_INLINE_NODE(RegExpLiteral) // TODO(1322): Allow materialized literals.
1074 DONT_INLINE_NODE(ArrayLiteral) // TODO(1322): Allow materialized literals.
1075 
1080 
1081 void AstConstructionVisitor::VisitCallRuntime(CallRuntime* node) {
1082  increase_node_count();
1083  if (node->is_jsruntime()) {
1084  // Don't try to inline JS runtime calls because we don't (currently) even
1085  // optimize them.
1086  add_flag(kDontInline);
1087  } else if (node->function()->intrinsic_type == Runtime::INLINE &&
1088  (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) ||
1089  node->name()->IsEqualTo(CStrVector("_Arguments")))) {
1090  // Don't inline the %_ArgumentsLength or %_Arguments because their
1091  // implementation will not work. There is no stack frame to get them
1092  // from.
1093  add_flag(kDontInline);
1094  }
1095 }
1096 
1097 #undef REGULAR_NODE
1098 #undef DONT_OPTIMIZE_NODE
1099 #undef DONT_INLINE_NODE
1100 #undef DONT_SELFOPTIMIZE_NODE
1101 
1102 
1103 Handle<String> Literal::ToString() {
1104  if (handle_->IsString()) return Handle<String>::cast(handle_);
1105  ASSERT(handle_->IsNumber());
1106  char arr[100];
1107  Vector<char> buffer(arr, ARRAY_SIZE(arr));
1108  const char* str;
1109  if (handle_->IsSmi()) {
1110  // Optimization only, the heap number case would subsume this.
1111  OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
1112  str = arr;
1113  } else {
1114  str = DoubleToCString(handle_->Number(), buffer);
1115  }
1116  return FACTORY->NewStringFromAscii(CStrVector(str));
1117 }
1118 
1119 
1120 } } // namespace v8::internal
bool ComputeGlobalTarget(Handle< GlobalObject > global, LookupResult *lookup)
Definition: ast.cc:532
bool FLAG_enable_slow_asserts
bool IsStringLiteral()
Definition: ast.cc:62
virtual bool IsAnchoredAtStart()
Definition: ast.cc:771
virtual bool IsAnchoredAtEnd()
Definition: ast.cc:724
#define MAKE_TYPE_CASE(Name)
Definition: ast.cc:676
#define FOR_EACH_REG_EXP_TREE_TYPE(VISIT)
Definition: jsregexp.h:394
void RecordTypeFeedback(TypeFeedbackOracle *oracle, CallKind call_kind)
Definition: ast.cc:553
virtual bool ResultOverwriteAllowed()
Definition: ast.cc:289
#define DONT_SELFOPTIMIZE_NODE(NodeType)
Definition: ast.cc:1024
static String * cast(Object *obj)
SmartArrayPointer< const char > ToString()
Definition: ast.cc:795
RegExpUnparser(Zone *zone)
Definition: ast.cc:807
ZoneList< CharacterRange > * ranges(Zone *zone)
Definition: ast.h:2353
VariableProxy(Isolate *isolate, Variable *var)
Definition: ast.cc:72
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
T Max(T a, T b)
Definition: utils.h:222
virtual bool IsAnchoredAtStart()
Definition: ast.cc:751
bool is_identical_to(const Handle< T > other) const
Definition: handles.h:67
uint32_t Hash()
Definition: ast.h:1256
virtual bool IsAnchoredAtEnd()
Definition: ast.cc:761
DONT_INLINE_NODE(RegExpLiteral) DONT_INLINE_NODE(ArrayLiteral) void AstConstructionVisitor
Definition: ast.cc:1073
SmartArrayPointer< const char > ToString(Zone *zone)
Definition: ast.cc:951
#define DECL_ACCEPT(type)
Definition: ast.cc:47
virtual bool ResultOverwriteAllowed()
Definition: ast.cc:278
virtual bool IsAnchoredAtEnd()
Definition: ast.h:2213
virtual bool IsAnchoredAtStart()
Definition: ast.cc:776
void RecordTypeFeedback(TypeFeedbackOracle *oracle)
Definition: ast.cc:614
#define ASSERT(condition)
Definition: checks.h:270
void RecordTypeFeedback(TypeFeedbackOracle *oracle)
Definition: ast.cc:594
static bool IsCompileTimeValue(Expression *expression)
Definition: parser.cc:3902
Expression(Isolate *isolate)
Definition: ast.h:362
virtual MaterializedLiteral * AsMaterializedLiteral()
Definition: ast.h:228
virtual bool IsInlineable() const
Definition: ast.cc:395
bool is_this() const
Definition: variables.h:136
virtual Interval CaptureRegisters()
Definition: ast.cc:714
virtual Interval CaptureRegisters()
Definition: ast.cc:708
void RecordTypeFeedback(TypeFeedbackOracle *oracle, Zone *znoe)
Definition: ast.cc:458
static Interval Empty()
Definition: jsregexp.h:695
Token::Value binary_op() const
Definition: ast.cc:135
bool is_this() const
Definition: ast.h:1485
Handle< String > name() const
Definition: variables.h:96
static Smi * cast(Object *object)
void Add(Vector< const char > format, Vector< FmtElm > elms)
bool AllowsLazyCompilation() const
Definition: scopes.cc:640
virtual bool IsInlineable() const
Definition: ast.cc:391
void set_emit_store(bool emit_store)
Definition: ast.cc:208
virtual bool IsAnchoredAtStart()
Definition: ast.cc:729
virtual Interval CaptureRegisters()
Definition: ast.cc:698
int start_position() const
Definition: scopes.h:262
Variable * var() const
Definition: ast.h:1484
#define UNREACHABLE()
Definition: checks.h:50
void RecordTypeFeedback(TypeFeedbackOracle *oracle)
Definition: ast.cc:602
bool IsLiteralCompareNull(Expression **expr)
Definition: ast.cc:382
void RecordTypeFeedback(TypeFeedbackOracle *oracle, Zone *zone)
Definition: ast.cc:437
bool IsEqualString(void *first, void *second)
Definition: ast.cc:218
#define REGULAR_NODE(NodeType)
Definition: ast.cc:1008
Interval Union(Interval that)
Definition: jsregexp.h:681
LanguageMode language_mode() const
Definition: ast.cc:169
static const int kInfinity
Definition: ast.h:2206
int end_position() const
Definition: ast.cc:164
const char * DoubleToCString(double v, Vector< char > buffer)
Definition: conversions.cc:68
ZoneList< RegExpTree * > * alternatives()
Definition: ast.h:2242
virtual int min_match()=0
RegExpAlternative(ZoneList< RegExpTree * > *nodes)
Definition: ast.cc:980
void CalculateEmitStore(Zone *zone)
Definition: ast.cc:245
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
Definition: hashmap.h:130
Handle< String > name_
Definition: ast.h:1507
ZoneList< Property * > * properties() const
Definition: ast.h:1360
#define MAKE_CASE(Name)
Definition: ast.cc:796
Token::Value op() const
Definition: ast.h:1711
int end_position() const
Definition: scopes.h:266
Expression * key() const
Definition: ast.h:1526
virtual bool IsAnchoredAtEnd()
Definition: ast.cc:740
static bool IsEqualityOp(Value op)
Definition: token.h:222
bool IsEqualNumber(void *first, void *second)
Definition: ast.cc:227
virtual bool IsPropertyName()
Definition: ast.h:327
Handle< Object > handle() const
Definition: ast.h:1252
Vector< const char > CStrVector(const char *data)
Definition: utils.h:525
#define AST_NODE_LIST(V)
Definition: ast.h:115
void AddTarget(Label *target, Zone *zone)
Definition: ast.cc:268
virtual Interval CaptureRegisters()
Definition: ast.cc:693
Scope * scope() const
Definition: ast.h:2044
static int SNPrintF(Vector< char > str, const char *format,...)
virtual Interval CaptureRegisters()
Definition: ast.cc:703
Assignment(Isolate *isolate, Token::Value op, Expression *target, Expression *value, int pos)
Definition: ast.cc:117
bool IsLiteralCompareTypeof(Expression **expr, Handle< String > *check)
Definition: ast.cc:335
virtual void * Accept(RegExpVisitor *visitor, void *data)=0
bool is_null() const
Definition: handles.h:87
CaseClause(Isolate *isolate, Expression *label, ZoneList< Statement * > *statements, int pos)
Definition: ast.cc:995
void VisitCharacterRange(CharacterRange that)
Definition: ast.cc:833
virtual bool IsAnchoredAtStart()
Definition: ast.h:2212
int start_position() const
Definition: ast.cc:159
bool IsLiteralCompareUndefined(Expression **expr)
Definition: ast.cc:363
static Handle< T > null()
Definition: handles.h:86
bool ComputeTarget(Handle< Map > type, Handle< String > name)
Definition: ast.cc:488
RegExpDisjunction(ZoneList< RegExpTree * > *alternatives)
Definition: ast.cc:958
#define HEAP
Definition: isolate.h:1408
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
Definition: flags.cc:274
void BindTo(Variable *var)
Definition: ast.cc:103
void set_is_used(bool flag)
Definition: variables.h:106
#define FACTORY
Definition: isolate.h:1409
void RecordTypeFeedback(TypeFeedbackOracle *oracle)
Definition: ast.cc:472
Expression * expression() const
Definition: ast.h:1712
#define MAKE_ACCEPT(Name)
Definition: ast.cc:661
LanguageMode language_mode() const
Definition: scopes.h:316
const char * name_
Definition: flags.cc:1352
static bool Match(void *literal1, void *literal2)
Definition: ast.h:1258
const int kMaxKeyedPolymorphism
Definition: type-info.h:39
T Min(T a, T b)
Definition: utils.h:229
virtual bool IsAnchoredAtEnd()
Definition: ast.cc:781
virtual int max_match()=0
#define VOID
void check(i::Vector< const char > string)
bool IsNullLiteral()
Definition: ast.cc:67
#define DONT_OPTIMIZE_NODE(NodeType)
Definition: ast.cc:1012
#define ARRAY_SIZE(a)
Definition: globals.h:295
Property(Literal *key, Expression *value, Isolate *isolate)
Definition: ast.cc:174
static JSObject * cast(Object *obj)
FlagType type() const
Definition: flags.cc:1358
int isfinite(double x)
virtual bool IsAnchoredAtStart()
Definition: ast.cc:719
static JSFunction * cast(Object *obj)