| OLD | NEW |
| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 UNREACHABLE(); | 372 UNREACHABLE(); |
| 373 return STANDARD_STORE; | 373 return STANDARD_STORE; |
| 374 } | 374 } |
| 375 virtual IcCheckType GetKeyType() const { | 375 virtual IcCheckType GetKeyType() const { |
| 376 UNREACHABLE(); | 376 UNREACHABLE(); |
| 377 return ELEMENT; | 377 return ELEMENT; |
| 378 } | 378 } |
| 379 | 379 |
| 380 // TODO(rossberg): this should move to its own AST node eventually. | 380 // TODO(rossberg): this should move to its own AST node eventually. |
| 381 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); | 381 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); |
| 382 byte to_boolean_types() const { | 382 uint16_t to_boolean_types() const { |
| 383 return ToBooleanTypesField::decode(bit_field_); | 383 return ToBooleanTypesField::decode(bit_field_); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void set_base_id(int id) { base_id_ = id; } | 386 void set_base_id(int id) { base_id_ = id; } |
| 387 static int num_ids() { return parent_num_ids() + 2; } | 387 static int num_ids() { return parent_num_ids() + 2; } |
| 388 BailoutId id() const { return BailoutId(local_id(0)); } | 388 BailoutId id() const { return BailoutId(local_id(0)); } |
| 389 TypeFeedbackId test_id() const { return TypeFeedbackId(local_id(1)); } | 389 TypeFeedbackId test_id() const { return TypeFeedbackId(local_id(1)); } |
| 390 | 390 |
| 391 protected: | 391 protected: |
| 392 Expression(Zone* zone, int pos) | 392 Expression(Zone* zone, int pos) |
| 393 : AstNode(pos), | 393 : AstNode(pos), |
| 394 base_id_(BailoutId::None().ToInt()), | 394 base_id_(BailoutId::None().ToInt()), |
| 395 bounds_(Bounds::Unbounded(zone)), | 395 bounds_(Bounds::Unbounded(zone)), |
| 396 bit_field_(0) {} | 396 bit_field_(0) {} |
| 397 static int parent_num_ids() { return 0; } | 397 static int parent_num_ids() { return 0; } |
| 398 void set_to_boolean_types(byte types) { | 398 void set_to_boolean_types(uint16_t types) { |
| 399 bit_field_ = ToBooleanTypesField::update(bit_field_, types); | 399 bit_field_ = ToBooleanTypesField::update(bit_field_, types); |
| 400 } | 400 } |
| 401 | 401 |
| 402 int base_id() const { | 402 int base_id() const { |
| 403 DCHECK(!BailoutId(base_id_).IsNone()); | 403 DCHECK(!BailoutId(base_id_).IsNone()); |
| 404 return base_id_; | 404 return base_id_; |
| 405 } | 405 } |
| 406 | 406 |
| 407 private: | 407 private: |
| 408 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 408 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| 409 | 409 |
| 410 int base_id_; | 410 int base_id_; |
| 411 Bounds bounds_; | 411 Bounds bounds_; |
| 412 class ToBooleanTypesField : public BitField16<byte, 0, 8> {}; | 412 class ToBooleanTypesField : public BitField16<uint16_t, 0, 9> {}; |
| 413 uint16_t bit_field_; | 413 uint16_t bit_field_; |
| 414 // Ends with 16-bit field; deriving classes in turn begin with | 414 // Ends with 16-bit field; deriving classes in turn begin with |
| 415 // 16-bit fields for optimum packing efficiency. | 415 // 16-bit fields for optimum packing efficiency. |
| 416 }; | 416 }; |
| 417 | 417 |
| 418 | 418 |
| 419 class BreakableStatement : public Statement { | 419 class BreakableStatement : public Statement { |
| 420 public: | 420 public: |
| 421 enum BreakableType { | 421 enum BreakableType { |
| 422 TARGET_FOR_ANONYMOUS, | 422 TARGET_FOR_ANONYMOUS, |
| (...skipping 3181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3604 | 3604 |
| 3605 private: | 3605 private: |
| 3606 Zone* zone_; | 3606 Zone* zone_; |
| 3607 AstValueFactory* ast_value_factory_; | 3607 AstValueFactory* ast_value_factory_; |
| 3608 }; | 3608 }; |
| 3609 | 3609 |
| 3610 | 3610 |
| 3611 } } // namespace v8::internal | 3611 } } // namespace v8::internal |
| 3612 | 3612 |
| 3613 #endif // V8_AST_H_ | 3613 #endif // V8_AST_H_ |
| OLD | NEW |