Chromium Code Reviews| 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/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/ast-value-factory.h" | 9 #include "src/ast-value-factory.h" |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1482 | 1482 |
| 1483 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } | 1483 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } |
| 1484 | 1484 |
| 1485 // Return an AST id for a property that is used in simulate instructions. | 1485 // Return an AST id for a property that is used in simulate instructions. |
| 1486 BailoutId GetIdForProperty(int i) { return BailoutId(local_id(i + 1)); } | 1486 BailoutId GetIdForProperty(int i) { return BailoutId(local_id(i + 1)); } |
| 1487 | 1487 |
| 1488 // Unlike other AST nodes, this number of bailout IDs allocated for an | 1488 // Unlike other AST nodes, this number of bailout IDs allocated for an |
| 1489 // ObjectLiteral can vary, so num_ids() is not a static method. | 1489 // ObjectLiteral can vary, so num_ids() is not a static method. |
| 1490 int num_ids() const { return parent_num_ids() + 1 + properties()->length(); } | 1490 int num_ids() const { return parent_num_ids() + 1 + properties()->length(); } |
| 1491 | 1491 |
| 1492 bool has_computed_property_names() const { | |
| 1493 return boilerplate_properties_ == 0 && properties_->length() > 0; | |
|
adamk
2015/08/24 18:00:53
I don't think the LHS of this expression is correc
adamk
2015/08/24 18:14:29
Hmm, local testing suggests I'm wrong about this f
adamk
2015/08/24 18:16:37
Sorry for the noise, I've confirmed that this is e
| |
| 1494 } | |
| 1495 | |
| 1492 // Object literals need one feedback slot for each non-trivial value, as well | 1496 // Object literals need one feedback slot for each non-trivial value, as well |
| 1493 // as some slots for home objects. | 1497 // as some slots for home objects. |
| 1494 FeedbackVectorRequirements ComputeFeedbackRequirements( | 1498 FeedbackVectorRequirements ComputeFeedbackRequirements( |
| 1495 Isolate* isolate, const ICSlotCache* cache) override; | 1499 Isolate* isolate, const ICSlotCache* cache) override; |
| 1496 void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot, | 1500 void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot, |
| 1497 ICSlotCache* cache) override { | 1501 ICSlotCache* cache) override { |
| 1498 slot_ = slot; | 1502 slot_ = slot; |
| 1499 } | 1503 } |
| 1500 Code::Kind FeedbackICSlotKind(int index) override { return Code::STORE_IC; } | 1504 Code::Kind FeedbackICSlotKind(int index) override { return Code::STORE_IC; } |
| 1501 FeedbackVectorICSlot GetNthSlot(int n) const { | 1505 FeedbackVectorICSlot GetNthSlot(int n) const { |
| (...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3635 | 3639 |
| 3636 private: | 3640 private: |
| 3637 Zone* zone_; | 3641 Zone* zone_; |
| 3638 AstValueFactory* ast_value_factory_; | 3642 AstValueFactory* ast_value_factory_; |
| 3639 }; | 3643 }; |
| 3640 | 3644 |
| 3641 | 3645 |
| 3642 } } // namespace v8::internal | 3646 } } // namespace v8::internal |
| 3643 | 3647 |
| 3644 #endif // V8_AST_H_ | 3648 #endif // V8_AST_H_ |
| OLD | NEW |