| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_DEOPT_INSTRUCTIONS_H_ | 5 #ifndef VM_DEOPT_INSTRUCTIONS_H_ |
| 6 #define VM_DEOPT_INSTRUCTIONS_H_ | 6 #define VM_DEOPT_INSTRUCTIONS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 | 290 |
| 291 // Builds a deoptimization info table, one DeoptInfo at a time. Call AddXXX | 291 // Builds a deoptimization info table, one DeoptInfo at a time. Call AddXXX |
| 292 // methods in the order of their target, starting wih deoptimized code | 292 // methods in the order of their target, starting wih deoptimized code |
| 293 // continuation pc and ending with the first argument of the deoptimized | 293 // continuation pc and ending with the first argument of the deoptimized |
| 294 // code. Call CreateDeoptInfo to write the accumulated instructions into | 294 // code. Call CreateDeoptInfo to write the accumulated instructions into |
| 295 // the heap and reset the builder's internal state for the next DeoptInfo. | 295 // the heap and reset the builder's internal state for the next DeoptInfo. |
| 296 class DeoptInfoBuilder : public ValueObject { | 296 class DeoptInfoBuilder : public ValueObject { |
| 297 public: | 297 public: |
| 298 explicit DeoptInfoBuilder(const intptr_t num_args); | 298 DeoptInfoBuilder(Isolate* isolate, const intptr_t num_args); |
| 299 | 299 |
| 300 // 'object_table' holds all objects referred to by DeoptInstr in | 300 // 'object_table' holds all objects referred to by DeoptInstr in |
| 301 // all DeoptInfo instances for a single Code object. | 301 // all DeoptInfo instances for a single Code object. |
| 302 const GrowableObjectArray& object_table() { return object_table_; } | 302 const GrowableObjectArray& object_table() { return object_table_; } |
| 303 | 303 |
| 304 // Return address before instruction. | 304 // Return address before instruction. |
| 305 void AddReturnAddress(const Code& code, | 305 void AddReturnAddress(const Code& code, |
| 306 intptr_t deopt_id, | 306 intptr_t deopt_id, |
| 307 intptr_t dest_index); | 307 intptr_t dest_index); |
| 308 | 308 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 intptr_t FindOrAddObjectInTable(const Object& obj) const; | 343 intptr_t FindOrAddObjectInTable(const Object& obj) const; |
| 344 intptr_t FindMaterialization(MaterializeObjectInstr* mat) const; | 344 intptr_t FindMaterialization(MaterializeObjectInstr* mat) const; |
| 345 intptr_t CalculateStackIndex(const Location& source_loc) const; | 345 intptr_t CalculateStackIndex(const Location& source_loc) const; |
| 346 | 346 |
| 347 intptr_t FrameSize() const { | 347 intptr_t FrameSize() const { |
| 348 return instructions_.length() - frame_start_; | 348 return instructions_.length() - frame_start_; |
| 349 } | 349 } |
| 350 | 350 |
| 351 void AddConstant(const Object& obj, intptr_t dest_index); | 351 void AddConstant(const Object& obj, intptr_t dest_index); |
| 352 | 352 |
| 353 Isolate* isolate() const { return isolate_; } |
| 354 |
| 355 Isolate* isolate_; |
| 356 |
| 353 GrowableArray<DeoptInstr*> instructions_; | 357 GrowableArray<DeoptInstr*> instructions_; |
| 354 const GrowableObjectArray& object_table_; | 358 const GrowableObjectArray& object_table_; |
| 355 const intptr_t num_args_; | 359 const intptr_t num_args_; |
| 356 | 360 |
| 357 // Used to compress entries by sharing suffixes. | 361 // Used to compress entries by sharing suffixes. |
| 358 TrieNode* trie_root_; | 362 TrieNode* trie_root_; |
| 359 intptr_t current_info_number_; | 363 intptr_t current_info_number_; |
| 360 | 364 |
| 361 intptr_t frame_start_; | 365 intptr_t frame_start_; |
| 362 GrowableArray<MaterializeObjectInstr*> materializations_; | 366 GrowableArray<MaterializeObjectInstr*> materializations_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 392 DeoptInfo* info, | 396 DeoptInfo* info, |
| 393 Smi* reason); | 397 Smi* reason); |
| 394 | 398 |
| 395 private: | 399 private: |
| 396 static const intptr_t kEntrySize = 3; | 400 static const intptr_t kEntrySize = 3; |
| 397 }; | 401 }; |
| 398 | 402 |
| 399 } // namespace dart | 403 } // namespace dart |
| 400 | 404 |
| 401 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 405 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
| OLD | NEW |