| 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_DEOPTIMIZER_H_ | 5 #ifndef V8_DEOPTIMIZER_H_ |
| 6 #define V8_DEOPTIMIZER_H_ | 6 #define V8_DEOPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 static int has_alignment_padding_offset() { | 316 static int has_alignment_padding_offset() { |
| 317 return OFFSET_OF(Deoptimizer, has_alignment_padding_); | 317 return OFFSET_OF(Deoptimizer, has_alignment_padding_); |
| 318 } | 318 } |
| 319 | 319 |
| 320 static int GetDeoptimizedCodeCount(Isolate* isolate); | 320 static int GetDeoptimizedCodeCount(Isolate* isolate); |
| 321 | 321 |
| 322 static const int kNotDeoptimizationEntry = -1; | 322 static const int kNotDeoptimizationEntry = -1; |
| 323 | 323 |
| 324 // Generators for the deoptimization entry code. | 324 // Generators for the deoptimization entry code. |
| 325 class EntryGenerator BASE_EMBEDDED { | 325 class TableEntryGenerator BASE_EMBEDDED { |
| 326 public: | 326 public: |
| 327 EntryGenerator(MacroAssembler* masm, BailoutType type) | 327 TableEntryGenerator(MacroAssembler* masm, BailoutType type, int count) |
| 328 : masm_(masm), type_(type) { } | 328 : masm_(masm), type_(type), count_(count) {} |
| 329 virtual ~EntryGenerator() { } | |
| 330 | 329 |
| 331 void Generate(); | 330 void Generate(); |
| 332 | 331 |
| 333 protected: | 332 protected: |
| 334 MacroAssembler* masm() const { return masm_; } | 333 MacroAssembler* masm() const { return masm_; } |
| 335 BailoutType type() const { return type_; } | 334 BailoutType type() const { return type_; } |
| 336 Isolate* isolate() const { return masm_->isolate(); } | 335 Isolate* isolate() const { return masm_->isolate(); } |
| 337 | 336 |
| 338 virtual void GeneratePrologue() { } | 337 void GeneratePrologue(); |
| 339 | |
| 340 private: | |
| 341 MacroAssembler* masm_; | |
| 342 Deoptimizer::BailoutType type_; | |
| 343 }; | |
| 344 | |
| 345 class TableEntryGenerator : public EntryGenerator { | |
| 346 public: | |
| 347 TableEntryGenerator(MacroAssembler* masm, BailoutType type, int count) | |
| 348 : EntryGenerator(masm, type), count_(count) { } | |
| 349 | |
| 350 protected: | |
| 351 virtual void GeneratePrologue(); | |
| 352 | 338 |
| 353 private: | 339 private: |
| 354 int count() const { return count_; } | 340 int count() const { return count_; } |
| 355 | 341 |
| 342 MacroAssembler* masm_; |
| 343 Deoptimizer::BailoutType type_; |
| 356 int count_; | 344 int count_; |
| 357 }; | 345 }; |
| 358 | 346 |
| 359 int ConvertJSFrameIndexToFrameIndex(int jsframe_index); | 347 int ConvertJSFrameIndexToFrameIndex(int jsframe_index); |
| 360 | 348 |
| 361 static size_t GetMaxDeoptTableSize(); | 349 static size_t GetMaxDeoptTableSize(); |
| 362 | 350 |
| 363 static void EnsureCodeForDeoptimizationEntry(Isolate* isolate, | 351 static void EnsureCodeForDeoptimizationEntry(Isolate* isolate, |
| 364 BailoutType type, | 352 BailoutType type, |
| 365 int max_entry_id); | 353 int max_entry_id); |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 Object** parameters_; | 1045 Object** parameters_; |
| 1058 Object** expression_stack_; | 1046 Object** expression_stack_; |
| 1059 int source_position_; | 1047 int source_position_; |
| 1060 | 1048 |
| 1061 friend class Deoptimizer; | 1049 friend class Deoptimizer; |
| 1062 }; | 1050 }; |
| 1063 | 1051 |
| 1064 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
| 1065 | 1053 |
| 1066 #endif // V8_DEOPTIMIZER_H_ | 1054 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |