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 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 // implemented in JavaScript (see "v8natives.js"). | 1954 // implemented in JavaScript (see "v8natives.js"). |
1955 class CallRuntime final : public Expression { | 1955 class CallRuntime final : public Expression { |
1956 public: | 1956 public: |
1957 ZoneList<Expression*>* arguments() const { return arguments_; } | 1957 ZoneList<Expression*>* arguments() const { return arguments_; } |
1958 bool is_jsruntime() const { return function_ == NULL; } | 1958 bool is_jsruntime() const { return function_ == NULL; } |
1959 | 1959 |
1960 int context_index() const { | 1960 int context_index() const { |
1961 DCHECK(is_jsruntime()); | 1961 DCHECK(is_jsruntime()); |
1962 return context_index_; | 1962 return context_index_; |
1963 } | 1963 } |
| 1964 int set_context_index(int index) { |
| 1965 DCHECK(is_jsruntime()); |
| 1966 return context_index_ = index; |
| 1967 } |
1964 const Runtime::Function* function() const { | 1968 const Runtime::Function* function() const { |
1965 DCHECK(!is_jsruntime()); | 1969 DCHECK(!is_jsruntime()); |
1966 return function_; | 1970 return function_; |
1967 } | 1971 } |
1968 | 1972 |
1969 static int num_ids() { return parent_num_ids() + 1; } | 1973 static int num_ids() { return parent_num_ids() + 1; } |
1970 BailoutId CallId() { return BailoutId(local_id(0)); } | 1974 BailoutId CallId() { return BailoutId(local_id(0)); } |
1971 | 1975 |
1972 const char* debug_name() { | 1976 const char* debug_name() { |
1973 return is_jsruntime() ? "(context function)" : function_->name; | 1977 return is_jsruntime() ? "(context function)" : function_->name; |
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 : NULL; \ | 3456 : NULL; \ |
3453 } | 3457 } |
3454 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3458 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3455 #undef DECLARE_NODE_FUNCTIONS | 3459 #undef DECLARE_NODE_FUNCTIONS |
3456 | 3460 |
3457 | 3461 |
3458 } // namespace internal | 3462 } // namespace internal |
3459 } // namespace v8 | 3463 } // namespace v8 |
3460 | 3464 |
3461 #endif // V8_AST_AST_H_ | 3465 #endif // V8_AST_AST_H_ |
OLD | NEW |