| 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_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
| 9 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
| 10 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 return nullptr; | 1783 return nullptr; |
| 1784 } | 1784 } |
| 1785 | 1785 |
| 1786 bool IsMonomorphic() const { | 1786 bool IsMonomorphic() const { |
| 1787 if (expression()->IsProperty()) { | 1787 if (expression()->IsProperty()) { |
| 1788 return expression()->AsProperty()->IsMonomorphic(); | 1788 return expression()->AsProperty()->IsMonomorphic(); |
| 1789 } | 1789 } |
| 1790 return !target_.is_null(); | 1790 return !target_.is_null(); |
| 1791 } | 1791 } |
| 1792 | 1792 |
| 1793 bool global_call() const { | |
| 1794 VariableProxy* proxy = expression_->AsVariableProxy(); | |
| 1795 return proxy != NULL && proxy->var()->IsUnallocatedOrGlobalSlot(); | |
| 1796 } | |
| 1797 | |
| 1798 bool known_global_function() const { | |
| 1799 return global_call() && !target_.is_null(); | |
| 1800 } | |
| 1801 | |
| 1802 Handle<JSFunction> target() { return target_; } | 1793 Handle<JSFunction> target() { return target_; } |
| 1803 | 1794 |
| 1804 Handle<AllocationSite> allocation_site() { return allocation_site_; } | 1795 Handle<AllocationSite> allocation_site() { return allocation_site_; } |
| 1805 | 1796 |
| 1806 void SetKnownGlobalTarget(Handle<JSFunction> target) { | 1797 void SetKnownGlobalTarget(Handle<JSFunction> target) { |
| 1807 target_ = target; | 1798 target_ = target; |
| 1808 set_is_uninitialized(false); | 1799 set_is_uninitialized(false); |
| 1809 } | 1800 } |
| 1810 void set_target(Handle<JSFunction> target) { target_ = target; } | 1801 void set_target(Handle<JSFunction> target) { target_ = target; } |
| 1811 void set_allocation_site(Handle<AllocationSite> site) { | 1802 void set_allocation_site(Handle<AllocationSite> site) { |
| (...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3451 : NULL; \ | 3442 : NULL; \ |
| 3452 } | 3443 } |
| 3453 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3444 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3454 #undef DECLARE_NODE_FUNCTIONS | 3445 #undef DECLARE_NODE_FUNCTIONS |
| 3455 | 3446 |
| 3456 | 3447 |
| 3457 } // namespace internal | 3448 } // namespace internal |
| 3458 } // namespace v8 | 3449 } // namespace v8 |
| 3459 | 3450 |
| 3460 #endif // V8_AST_AST_H_ | 3451 #endif // V8_AST_AST_H_ |
| OLD | NEW |