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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 // Translate value, store the result into the given frame slot. | 390 // Translate value, store the result into the given frame slot. |
391 void DoTranslateCommand(TranslationIterator* iterator, | 391 void DoTranslateCommand(TranslationIterator* iterator, |
392 int frame_index, | 392 int frame_index, |
393 unsigned output_offset); | 393 unsigned output_offset); |
394 | 394 |
395 // Translate object, do not store the result anywhere (but do update | 395 // Translate object, do not store the result anywhere (but do update |
396 // the deferred materialization array). | 396 // the deferred materialization array). |
397 void DoTranslateObjectAndSkip(TranslationIterator* iterator); | 397 void DoTranslateObjectAndSkip(TranslationIterator* iterator); |
398 | 398 |
399 unsigned ComputeInputFrameSize() const; | 399 unsigned ComputeInputFrameSize() const; |
400 unsigned ComputeFixedSize(JSFunction* function) const; | 400 |
| 401 // Unoptimized javascript frames have an additional word for the type |
| 402 // feedback vector. |
| 403 unsigned ComputeFixedSize(JSFunction* function, |
| 404 bool unoptimized_frame = false) const; |
401 | 405 |
402 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; | 406 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; |
403 unsigned ComputeOutgoingArgumentSize() const; | 407 unsigned ComputeOutgoingArgumentSize() const; |
404 | 408 |
405 Object* ComputeLiteral(int index) const; | 409 Object* ComputeLiteral(int index) const; |
406 | 410 |
407 void AddObjectStart(intptr_t slot_address, int argc, bool is_arguments); | 411 void AddObjectStart(intptr_t slot_address, int argc, bool is_arguments); |
408 void AddObjectDuplication(intptr_t slot, int object_index); | 412 void AddObjectDuplication(intptr_t slot, int object_index); |
409 void AddObjectTaggedValue(intptr_t value); | 413 void AddObjectTaggedValue(intptr_t value); |
410 void AddObjectDoubleValue(double value); | 414 void AddObjectDoubleValue(double value); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 static SlotRef ComputeSlotForNextArgument( | 936 static SlotRef ComputeSlotForNextArgument( |
933 Translation::Opcode opcode, | 937 Translation::Opcode opcode, |
934 TranslationIterator* iterator, | 938 TranslationIterator* iterator, |
935 DeoptimizationInputData* data, | 939 DeoptimizationInputData* data, |
936 JavaScriptFrame* frame); | 940 JavaScriptFrame* frame); |
937 | 941 |
938 Handle<Object> GetPreviouslyMaterialized(Isolate* isolate, int length); | 942 Handle<Object> GetPreviouslyMaterialized(Isolate* isolate, int length); |
939 | 943 |
940 static Address SlotAddress(JavaScriptFrame* frame, int slot_index) { | 944 static Address SlotAddress(JavaScriptFrame* frame, int slot_index) { |
941 if (slot_index >= 0) { | 945 if (slot_index >= 0) { |
942 const int offset = JavaScriptFrameConstants::kLocal0Offset; | 946 const int offset = JavaScriptFrameConstants::kLocal0OffsetOptimized; |
943 return frame->fp() + offset - (slot_index * kPointerSize); | 947 return frame->fp() + offset - (slot_index * kPointerSize); |
944 } else { | 948 } else { |
945 const int offset = JavaScriptFrameConstants::kLastParameterOffset; | 949 const int offset = JavaScriptFrameConstants::kLastParameterOffset; |
946 return frame->fp() + offset - ((slot_index + 1) * kPointerSize); | 950 return frame->fp() + offset - ((slot_index + 1) * kPointerSize); |
947 } | 951 } |
948 } | 952 } |
949 | 953 |
950 Handle<Object> GetDeferredObject(Isolate* isolate); | 954 Handle<Object> GetDeferredObject(Isolate* isolate); |
951 }; | 955 }; |
952 | 956 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 Object** parameters_; | 1049 Object** parameters_; |
1046 Object** expression_stack_; | 1050 Object** expression_stack_; |
1047 int source_position_; | 1051 int source_position_; |
1048 | 1052 |
1049 friend class Deoptimizer; | 1053 friend class Deoptimizer; |
1050 }; | 1054 }; |
1051 | 1055 |
1052 } } // namespace v8::internal | 1056 } } // namespace v8::internal |
1053 | 1057 |
1054 #endif // V8_DEOPTIMIZER_H_ | 1058 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |