OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 315 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
316 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 316 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
317 bool HasPointerMap() const { return pointer_map_.is_set(); } | 317 bool HasPointerMap() const { return pointer_map_.is_set(); } |
318 | 318 |
319 virtual bool HasResult() const = 0; | 319 virtual bool HasResult() const = 0; |
320 | 320 |
321 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 321 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
322 HValue* hydrogen_value() const { return hydrogen_value_; } | 322 HValue* hydrogen_value() const { return hydrogen_value_; } |
323 | 323 |
| 324 void set_deoptimization_environment(LEnvironment* env) { |
| 325 deoptimization_environment_.set(env); |
| 326 } |
| 327 LEnvironment* deoptimization_environment() const { |
| 328 return deoptimization_environment_.get(); |
| 329 } |
| 330 bool HasDeoptimizationEnvironment() const { |
| 331 return deoptimization_environment_.is_set(); |
| 332 } |
| 333 |
324 private: | 334 private: |
325 SetOncePointer<LEnvironment> environment_; | 335 SetOncePointer<LEnvironment> environment_; |
326 SetOncePointer<LPointerMap> pointer_map_; | 336 SetOncePointer<LPointerMap> pointer_map_; |
327 HValue* hydrogen_value_; | 337 HValue* hydrogen_value_; |
| 338 SetOncePointer<LEnvironment> deoptimization_environment_; |
328 }; | 339 }; |
329 | 340 |
330 | 341 |
331 template<typename ElementType, int NumElements> | 342 template<typename ElementType, int NumElements> |
332 class OperandContainer { | 343 class OperandContainer { |
333 public: | 344 public: |
334 OperandContainer() { | 345 OperandContainer() { |
335 for (int i = 0; i < NumElements; i++) elems_[i] = NULL; | 346 for (int i = 0; i < NumElements; i++) elems_[i] = NULL; |
336 } | 347 } |
337 int length() { return NumElements; } | 348 int length() { return NumElements; } |
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 LChunkBuilder(HGraph* graph, LAllocator* allocator) | 1874 LChunkBuilder(HGraph* graph, LAllocator* allocator) |
1864 : chunk_(NULL), | 1875 : chunk_(NULL), |
1865 graph_(graph), | 1876 graph_(graph), |
1866 status_(UNUSED), | 1877 status_(UNUSED), |
1867 current_instruction_(NULL), | 1878 current_instruction_(NULL), |
1868 current_block_(NULL), | 1879 current_block_(NULL), |
1869 next_block_(NULL), | 1880 next_block_(NULL), |
1870 argument_count_(0), | 1881 argument_count_(0), |
1871 allocator_(allocator), | 1882 allocator_(allocator), |
1872 position_(RelocInfo::kNoPosition), | 1883 position_(RelocInfo::kNoPosition), |
| 1884 instructions_pending_deoptimization_environment_(NULL), |
1873 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } | 1885 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } |
1874 | 1886 |
1875 // Build the sequence for the graph. | 1887 // Build the sequence for the graph. |
1876 LChunk* Build(); | 1888 LChunk* Build(); |
1877 | 1889 |
1878 // Declare methods that deal with the individual node types. | 1890 // Declare methods that deal with the individual node types. |
1879 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 1891 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
1880 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 1892 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
1881 #undef DECLARE_DO | 1893 #undef DECLARE_DO |
1882 | 1894 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 | 1983 |
1972 // By default we assume that instruction sequences generated for calls | 1984 // By default we assume that instruction sequences generated for calls |
1973 // cannot deoptimize eagerly and we do not attach environment to this | 1985 // cannot deoptimize eagerly and we do not attach environment to this |
1974 // instruction. | 1986 // instruction. |
1975 LInstruction* MarkAsCall( | 1987 LInstruction* MarkAsCall( |
1976 LInstruction* instr, | 1988 LInstruction* instr, |
1977 HInstruction* hinstr, | 1989 HInstruction* hinstr, |
1978 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 1990 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
1979 LInstruction* MarkAsSaveDoubles(LInstruction* instr); | 1991 LInstruction* MarkAsSaveDoubles(LInstruction* instr); |
1980 | 1992 |
| 1993 LInstruction* SetInstructionPendingDeoptimizationEnvironment( |
| 1994 LInstruction* instr, int ast_id); |
| 1995 void ClearInstructionPendingDeoptimizationEnvironment(); |
| 1996 |
1981 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); | 1997 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); |
1982 | 1998 |
1983 void VisitInstruction(HInstruction* current); | 1999 void VisitInstruction(HInstruction* current); |
1984 | 2000 |
1985 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2001 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
1986 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 2002 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
1987 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2003 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
1988 LInstruction* DoArithmeticD(Token::Value op, | 2004 LInstruction* DoArithmeticD(Token::Value op, |
1989 HArithmeticBinaryOperation* instr); | 2005 HArithmeticBinaryOperation* instr); |
1990 LInstruction* DoArithmeticT(Token::Value op, | 2006 LInstruction* DoArithmeticT(Token::Value op, |
1991 HArithmeticBinaryOperation* instr); | 2007 HArithmeticBinaryOperation* instr); |
1992 | 2008 |
1993 LChunk* chunk_; | 2009 LChunk* chunk_; |
1994 HGraph* const graph_; | 2010 HGraph* const graph_; |
1995 Status status_; | 2011 Status status_; |
1996 HInstruction* current_instruction_; | 2012 HInstruction* current_instruction_; |
1997 HBasicBlock* current_block_; | 2013 HBasicBlock* current_block_; |
1998 HBasicBlock* next_block_; | 2014 HBasicBlock* next_block_; |
1999 int argument_count_; | 2015 int argument_count_; |
2000 LAllocator* allocator_; | 2016 LAllocator* allocator_; |
2001 int position_; | 2017 int position_; |
| 2018 LInstruction* instructions_pending_deoptimization_environment_; |
2002 int pending_deoptimization_ast_id_; | 2019 int pending_deoptimization_ast_id_; |
2003 | 2020 |
2004 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2021 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2005 }; | 2022 }; |
2006 | 2023 |
2007 #undef DECLARE_HYDROGEN_ACCESSOR | 2024 #undef DECLARE_HYDROGEN_ACCESSOR |
2008 #undef DECLARE_INSTRUCTION | 2025 #undef DECLARE_INSTRUCTION |
2009 #undef DECLARE_CONCRETE_INSTRUCTION | 2026 #undef DECLARE_CONCRETE_INSTRUCTION |
2010 | 2027 |
2011 } } // namespace v8::internal | 2028 } } // namespace v8::internal |
2012 | 2029 |
2013 #endif // V8_IA32_LITHIUM_IA32_H_ | 2030 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |