OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 Address slot_address() const { return slot_address_; } | 51 Address slot_address() const { return slot_address_; } |
52 double value() const { return val_; } | 52 double value() const { return val_; } |
53 | 53 |
54 private: | 54 private: |
55 Address slot_address_; | 55 Address slot_address_; |
56 double val_; | 56 double val_; |
57 }; | 57 }; |
58 | 58 |
59 | 59 |
| 60 class ArgumentsObjectMaterializationDescriptor BASE_EMBEDDED { |
| 61 public: |
| 62 ArgumentsObjectMaterializationDescriptor(Address slot_address, int argc) |
| 63 : slot_address_(slot_address), arguments_length_(argc) { } |
| 64 |
| 65 Address slot_address() const { return slot_address_; } |
| 66 int arguments_length() const { return arguments_length_; } |
| 67 |
| 68 private: |
| 69 Address slot_address_; |
| 70 int arguments_length_; |
| 71 }; |
| 72 |
| 73 |
60 class OptimizedFunctionVisitor BASE_EMBEDDED { | 74 class OptimizedFunctionVisitor BASE_EMBEDDED { |
61 public: | 75 public: |
62 virtual ~OptimizedFunctionVisitor() {} | 76 virtual ~OptimizedFunctionVisitor() {} |
63 | 77 |
64 // Function which is called before iteration of any optimized functions | 78 // Function which is called before iteration of any optimized functions |
65 // from given native context. | 79 // from given native context. |
66 virtual void EnterContext(Context* context) = 0; | 80 virtual void EnterContext(Context* context) = 0; |
67 | 81 |
68 virtual void VisitFunction(JSFunction* function) = 0; | 82 virtual void VisitFunction(JSFunction* function) = 0; |
69 | 83 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 203 |
190 // Change all patched stack guard checks in the unoptimized code | 204 // Change all patched stack guard checks in the unoptimized code |
191 // back to a normal stack guard check. | 205 // back to a normal stack guard check. |
192 static void RevertStackCheckCodeAt(Code* unoptimized_code, | 206 static void RevertStackCheckCodeAt(Code* unoptimized_code, |
193 Address pc_after, | 207 Address pc_after, |
194 Code* check_code, | 208 Code* check_code, |
195 Code* replacement_code); | 209 Code* replacement_code); |
196 | 210 |
197 ~Deoptimizer(); | 211 ~Deoptimizer(); |
198 | 212 |
199 void MaterializeHeapNumbers(); | 213 void MaterializeHeapObjects(JavaScriptFrameIterator* it); |
200 #ifdef ENABLE_DEBUGGER_SUPPORT | 214 #ifdef ENABLE_DEBUGGER_SUPPORT |
201 void MaterializeHeapNumbersForDebuggerInspectableFrame( | 215 void MaterializeHeapNumbersForDebuggerInspectableFrame( |
202 Address parameters_top, | 216 Address parameters_top, |
203 uint32_t parameters_size, | 217 uint32_t parameters_size, |
204 Address expressions_top, | 218 Address expressions_top, |
205 uint32_t expressions_size, | 219 uint32_t expressions_size, |
206 DeoptimizedFrameInfo* info); | 220 DeoptimizedFrameInfo* info); |
207 #endif | 221 #endif |
208 | 222 |
209 static void ComputeOutputFrames(Deoptimizer* deoptimizer); | 223 static void ComputeOutputFrames(Deoptimizer* deoptimizer); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 int* input_offset); | 312 int* input_offset); |
299 | 313 |
300 unsigned ComputeInputFrameSize() const; | 314 unsigned ComputeInputFrameSize() const; |
301 unsigned ComputeFixedSize(JSFunction* function) const; | 315 unsigned ComputeFixedSize(JSFunction* function) const; |
302 | 316 |
303 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; | 317 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; |
304 unsigned ComputeOutgoingArgumentSize() const; | 318 unsigned ComputeOutgoingArgumentSize() const; |
305 | 319 |
306 Object* ComputeLiteral(int index) const; | 320 Object* ComputeLiteral(int index) const; |
307 | 321 |
| 322 void AddArgumentsObject(intptr_t slot_address, int argc); |
| 323 void AddArgumentsObjectValue(intptr_t value); |
308 void AddDoubleValue(intptr_t slot_address, double value); | 324 void AddDoubleValue(intptr_t slot_address, double value); |
309 | 325 |
310 static MemoryChunk* CreateCode(BailoutType type); | 326 static MemoryChunk* CreateCode(BailoutType type); |
311 static void GenerateDeoptimizationEntries( | 327 static void GenerateDeoptimizationEntries( |
312 MacroAssembler* masm, int count, BailoutType type); | 328 MacroAssembler* masm, int count, BailoutType type); |
313 | 329 |
314 // Weak handle callback for deoptimizing code objects. | 330 // Weak handle callback for deoptimizing code objects. |
315 static void HandleWeakDeoptimizedCode( | 331 static void HandleWeakDeoptimizedCode( |
316 v8::Persistent<v8::Value> obj, void* data); | 332 v8::Persistent<v8::Value> obj, void* data); |
317 static Code* FindDeoptimizingCodeFromAddress(Address addr); | 333 static Code* FindDeoptimizingCodeFromAddress(Address addr); |
(...skipping 15 matching lines...) Expand all Loading... |
333 | 349 |
334 // Input frame description. | 350 // Input frame description. |
335 FrameDescription* input_; | 351 FrameDescription* input_; |
336 // Number of output frames. | 352 // Number of output frames. |
337 int output_count_; | 353 int output_count_; |
338 // Number of output js frames. | 354 // Number of output js frames. |
339 int jsframe_count_; | 355 int jsframe_count_; |
340 // Array of output frame descriptions. | 356 // Array of output frame descriptions. |
341 FrameDescription** output_; | 357 FrameDescription** output_; |
342 | 358 |
| 359 List<Object*> deferred_arguments_objects_values_; |
| 360 List<ArgumentsObjectMaterializationDescriptor> deferred_arguments_objects_; |
343 List<HeapNumberMaterializationDescriptor> deferred_heap_numbers_; | 361 List<HeapNumberMaterializationDescriptor> deferred_heap_numbers_; |
344 | 362 |
345 static const int table_entry_size_; | 363 static const int table_entry_size_; |
346 | 364 |
347 friend class FrameDescription; | 365 friend class FrameDescription; |
348 friend class DeoptimizingCodeListNode; | 366 friend class DeoptimizingCodeListNode; |
349 friend class DeoptimizedFrameInfo; | 367 friend class DeoptimizedFrameInfo; |
350 }; | 368 }; |
351 | 369 |
352 | 370 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 void BeginSetterStubFrame(int literal_id); | 619 void BeginSetterStubFrame(int literal_id); |
602 void StoreRegister(Register reg); | 620 void StoreRegister(Register reg); |
603 void StoreInt32Register(Register reg); | 621 void StoreInt32Register(Register reg); |
604 void StoreUint32Register(Register reg); | 622 void StoreUint32Register(Register reg); |
605 void StoreDoubleRegister(DoubleRegister reg); | 623 void StoreDoubleRegister(DoubleRegister reg); |
606 void StoreStackSlot(int index); | 624 void StoreStackSlot(int index); |
607 void StoreInt32StackSlot(int index); | 625 void StoreInt32StackSlot(int index); |
608 void StoreUint32StackSlot(int index); | 626 void StoreUint32StackSlot(int index); |
609 void StoreDoubleStackSlot(int index); | 627 void StoreDoubleStackSlot(int index); |
610 void StoreLiteral(int literal_id); | 628 void StoreLiteral(int literal_id); |
611 void StoreArgumentsObject(); | 629 void StoreArgumentsObject(int args_index, int args_length); |
612 void MarkDuplicate(); | 630 void MarkDuplicate(); |
613 | 631 |
614 Zone* zone() const { return zone_; } | 632 Zone* zone() const { return zone_; } |
615 | 633 |
616 static int NumberOfOperandsFor(Opcode opcode); | 634 static int NumberOfOperandsFor(Opcode opcode); |
617 | 635 |
618 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) | 636 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) |
619 static const char* StringFor(Opcode opcode); | 637 static const char* StringFor(Opcode opcode); |
620 #endif | 638 #endif |
621 | 639 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 Object** expression_stack_; | 829 Object** expression_stack_; |
812 int source_position_; | 830 int source_position_; |
813 | 831 |
814 friend class Deoptimizer; | 832 friend class Deoptimizer; |
815 }; | 833 }; |
816 #endif | 834 #endif |
817 | 835 |
818 } } // namespace v8::internal | 836 } } // namespace v8::internal |
819 | 837 |
820 #endif // V8_DEOPTIMIZER_H_ | 838 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |