| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 class StaticCallInstr : public TemplateDefinition<0> { | 1978 class StaticCallInstr : public TemplateDefinition<0> { |
| 1979 public: | 1979 public: |
| 1980 StaticCallInstr(intptr_t token_pos, | 1980 StaticCallInstr(intptr_t token_pos, |
| 1981 const Function& function, | 1981 const Function& function, |
| 1982 const Array& argument_names, | 1982 const Array& argument_names, |
| 1983 ZoneGrowableArray<PushArgumentInstr*>* arguments) | 1983 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
| 1984 : token_pos_(token_pos), | 1984 : token_pos_(token_pos), |
| 1985 function_(function), | 1985 function_(function), |
| 1986 argument_names_(argument_names), | 1986 argument_names_(argument_names), |
| 1987 arguments_(arguments), | 1987 arguments_(arguments), |
| 1988 recognized_(MethodRecognizer::kUnknown) { | 1988 recognized_(MethodRecognizer::kUnknown), |
| 1989 result_cid_(kDynamicCid) { |
| 1989 ASSERT(function.IsZoneHandle()); | 1990 ASSERT(function.IsZoneHandle()); |
| 1990 ASSERT(argument_names.IsZoneHandle()); | 1991 ASSERT(argument_names.IsZoneHandle()); |
| 1991 } | 1992 } |
| 1992 | 1993 |
| 1993 DECLARE_INSTRUCTION(StaticCall) | 1994 DECLARE_INSTRUCTION(StaticCall) |
| 1994 virtual RawAbstractType* CompileType() const; | 1995 virtual RawAbstractType* CompileType() const; |
| 1995 | 1996 |
| 1996 // Accessors forwarded to the AST node. | 1997 // Accessors forwarded to the AST node. |
| 1997 const Function& function() const { return function_; } | 1998 const Function& function() const { return function_; } |
| 1998 const Array& argument_names() const { return argument_names_; } | 1999 const Array& argument_names() const { return argument_names_; } |
| 1999 intptr_t token_pos() const { return token_pos_; } | 2000 intptr_t token_pos() const { return token_pos_; } |
| 2000 | 2001 |
| 2001 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 2002 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
| 2002 PushArgumentInstr* ArgumentAt(intptr_t index) const { | 2003 PushArgumentInstr* ArgumentAt(intptr_t index) const { |
| 2003 return (*arguments_)[index]; | 2004 return (*arguments_)[index]; |
| 2004 } | 2005 } |
| 2005 | 2006 |
| 2006 MethodRecognizer::Kind recognized() const { return recognized_; } | 2007 MethodRecognizer::Kind recognized() const { return recognized_; } |
| 2007 void set_recognized(MethodRecognizer::Kind kind) { recognized_ = kind; } | 2008 void set_recognized(MethodRecognizer::Kind kind) { recognized_ = kind; } |
| 2008 | 2009 |
| 2009 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2010 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2010 | 2011 |
| 2011 virtual bool CanDeoptimize() const { return true; } | 2012 virtual bool CanDeoptimize() const { return true; } |
| 2012 virtual intptr_t ResultCid() const { return kDynamicCid; } | 2013 virtual intptr_t ResultCid() const { return result_cid_; } |
| 2014 void set_result_cid(intptr_t value) { result_cid_ = value; } |
| 2013 | 2015 |
| 2014 private: | 2016 private: |
| 2015 const intptr_t token_pos_; | 2017 const intptr_t token_pos_; |
| 2016 const Function& function_; | 2018 const Function& function_; |
| 2017 const Array& argument_names_; | 2019 const Array& argument_names_; |
| 2018 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | 2020 ZoneGrowableArray<PushArgumentInstr*>* arguments_; |
| 2019 MethodRecognizer::Kind recognized_; | 2021 MethodRecognizer::Kind recognized_; |
| 2022 intptr_t result_cid_; // For some library functions we know the result. |
| 2020 | 2023 |
| 2021 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); | 2024 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); |
| 2022 }; | 2025 }; |
| 2023 | 2026 |
| 2024 | 2027 |
| 2025 class LoadLocalInstr : public TemplateDefinition<0> { | 2028 class LoadLocalInstr : public TemplateDefinition<0> { |
| 2026 public: | 2029 public: |
| 2027 LoadLocalInstr(const LocalVariable& local, intptr_t context_level) | 2030 LoadLocalInstr(const LocalVariable& local, intptr_t context_level) |
| 2028 : local_(local), | 2031 : local_(local), |
| 2029 context_level_(context_level) { } | 2032 context_level_(context_level) { } |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3301 ForwardInstructionIterator* current_iterator_; | 3304 ForwardInstructionIterator* current_iterator_; |
| 3302 | 3305 |
| 3303 private: | 3306 private: |
| 3304 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3307 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3305 }; | 3308 }; |
| 3306 | 3309 |
| 3307 | 3310 |
| 3308 } // namespace dart | 3311 } // namespace dart |
| 3309 | 3312 |
| 3310 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3313 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |