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

Side by Side Diff: src/ast.h

Issue 1123383005: Rely on ExpressionClassifier to match valid arrow function formals (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // True iff the expression is the null literal. 356 // True iff the expression is the null literal.
357 bool IsNullLiteral() const; 357 bool IsNullLiteral() const;
358 358
359 // True if we can prove that the expression is the undefined literal. 359 // True if we can prove that the expression is the undefined literal.
360 bool IsUndefinedLiteral(Isolate* isolate) const; 360 bool IsUndefinedLiteral(Isolate* isolate) const;
361 361
362 // Expression type bounds 362 // Expression type bounds
363 Bounds bounds() const { return bounds_; } 363 Bounds bounds() const { return bounds_; }
364 void set_bounds(Bounds bounds) { bounds_ = bounds; } 364 void set_bounds(Bounds bounds) { bounds_ = bounds; }
365 365
366 // Whether the expression is parenthesized
367 bool is_single_parenthesized() const {
368 return IsSingleParenthesizedField::decode(bit_field_);
369 }
370 bool is_multi_parenthesized() const {
371 return IsMultiParenthesizedField::decode(bit_field_);
372 }
373 void increase_parenthesization_level() {
374 bit_field_ = IsMultiParenthesizedField::update(bit_field_,
375 is_single_parenthesized());
376 bit_field_ = IsSingleParenthesizedField::update(bit_field_, true);
377 }
378
379 // Type feedback information for assignments and properties. 366 // Type feedback information for assignments and properties.
380 virtual bool IsMonomorphic() { 367 virtual bool IsMonomorphic() {
381 UNREACHABLE(); 368 UNREACHABLE();
382 return false; 369 return false;
383 } 370 }
384 virtual SmallMapList* GetReceiverTypes() { 371 virtual SmallMapList* GetReceiverTypes() {
385 UNREACHABLE(); 372 UNREACHABLE();
386 return NULL; 373 return NULL;
387 } 374 }
388 virtual KeyedAccessStoreMode GetStoreMode() const { 375 virtual KeyedAccessStoreMode GetStoreMode() const {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 DCHECK(!BailoutId(base_id_).IsNone()); 407 DCHECK(!BailoutId(base_id_).IsNone());
421 return base_id_; 408 return base_id_;
422 } 409 }
423 410
424 private: 411 private:
425 int local_id(int n) const { return base_id() + parent_num_ids() + n; } 412 int local_id(int n) const { return base_id() + parent_num_ids() + n; }
426 413
427 int base_id_; 414 int base_id_;
428 Bounds bounds_; 415 Bounds bounds_;
429 class ToBooleanTypesField : public BitField16<byte, 0, 8> {}; 416 class ToBooleanTypesField : public BitField16<byte, 0, 8> {};
430 class IsSingleParenthesizedField : public BitField16<bool, 8, 1> {};
431 class IsMultiParenthesizedField : public BitField16<bool, 9, 1> {};
432 uint16_t bit_field_; 417 uint16_t bit_field_;
433 // Ends with 16-bit field; deriving classes in turn begin with 418 // Ends with 16-bit field; deriving classes in turn begin with
434 // 16-bit fields for optimum packing efficiency. 419 // 16-bit fields for optimum packing efficiency.
435 }; 420 };
436 421
437 422
438 class BreakableStatement : public Statement { 423 class BreakableStatement : public Statement {
439 public: 424 public:
440 enum BreakableType { 425 enum BreakableType {
441 TARGET_FOR_ANONYMOUS, 426 TARGET_FOR_ANONYMOUS,
(...skipping 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after
3502 3487
3503 private: 3488 private:
3504 Zone* zone_; 3489 Zone* zone_;
3505 AstValueFactory* ast_value_factory_; 3490 AstValueFactory* ast_value_factory_;
3506 }; 3491 };
3507 3492
3508 3493
3509 } } // namespace v8::internal 3494 } } // namespace v8::internal
3510 3495
3511 #endif // V8_AST_H_ 3496 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698