Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Side by Side Diff: src/deoptimizer.h

Issue 21340002: Generate a custom OSR entrypoint for OSR compiles on all platforms, and transition to optimized cod… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 class Deoptimizer; 116 class Deoptimizer;
117 117
118 118
119 class Deoptimizer : public Malloced { 119 class Deoptimizer : public Malloced {
120 public: 120 public:
121 enum BailoutType { 121 enum BailoutType {
122 EAGER, 122 EAGER,
123 LAZY, 123 LAZY,
124 SOFT, 124 SOFT,
125 OSR,
126 // This last bailout type is not really a bailout, but used by the 125 // This last bailout type is not really a bailout, but used by the
127 // debugger to deoptimize stack frames to allow inspection. 126 // debugger to deoptimize stack frames to allow inspection.
128 DEBUGGER 127 DEBUGGER
129 }; 128 };
130 129
131 static const int kBailoutTypesWithCodeEntry = SOFT + 1; 130 static const int kBailoutTypesWithCodeEntry = SOFT + 1;
132 131
133 struct JumpTableEntry { 132 struct JumpTableEntry {
134 inline JumpTableEntry(Address entry, 133 inline JumpTableEntry(Address entry,
135 Deoptimizer::BailoutType type, 134 Deoptimizer::BailoutType type,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 BailoutType type, 351 BailoutType type,
353 unsigned bailout_id, 352 unsigned bailout_id,
354 Address from, 353 Address from,
355 int fp_to_sp_delta, 354 int fp_to_sp_delta,
356 Code* optimized_code); 355 Code* optimized_code);
357 Code* FindOptimizedCode(JSFunction* function, Code* optimized_code); 356 Code* FindOptimizedCode(JSFunction* function, Code* optimized_code);
358 void PrintFunctionName(); 357 void PrintFunctionName();
359 void DeleteFrameDescriptions(); 358 void DeleteFrameDescriptions();
360 359
361 void DoComputeOutputFrames(); 360 void DoComputeOutputFrames();
362 void DoComputeOsrOutputFrame();
363 void DoComputeJSFrame(TranslationIterator* iterator, int frame_index); 361 void DoComputeJSFrame(TranslationIterator* iterator, int frame_index);
364 void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, 362 void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator,
365 int frame_index); 363 int frame_index);
366 void DoComputeConstructStubFrame(TranslationIterator* iterator, 364 void DoComputeConstructStubFrame(TranslationIterator* iterator,
367 int frame_index); 365 int frame_index);
368 void DoComputeAccessorStubFrame(TranslationIterator* iterator, 366 void DoComputeAccessorStubFrame(TranslationIterator* iterator,
369 int frame_index, 367 int frame_index,
370 bool is_setter_stub_frame); 368 bool is_setter_stub_frame);
371 void DoComputeCompiledStubFrame(TranslationIterator* iterator, 369 void DoComputeCompiledStubFrame(TranslationIterator* iterator,
372 int frame_index); 370 int frame_index);
373 371
374 void DoTranslateObject(TranslationIterator* iterator, 372 void DoTranslateObject(TranslationIterator* iterator,
375 int object_opcode, 373 int object_opcode,
376 int field_index); 374 int field_index);
377 375
378 enum DeoptimizerTranslatedValueType { 376 enum DeoptimizerTranslatedValueType {
379 TRANSLATED_VALUE_IS_NATIVE, 377 TRANSLATED_VALUE_IS_NATIVE,
380 TRANSLATED_VALUE_IS_TAGGED 378 TRANSLATED_VALUE_IS_TAGGED
381 }; 379 };
382 380
383 void DoTranslateCommand(TranslationIterator* iterator, 381 void DoTranslateCommand(TranslationIterator* iterator,
384 int frame_index, 382 int frame_index,
385 unsigned output_offset, 383 unsigned output_offset,
386 DeoptimizerTranslatedValueType value_type = TRANSLATED_VALUE_IS_TAGGED); 384 DeoptimizerTranslatedValueType value_type = TRANSLATED_VALUE_IS_TAGGED);
387 385
388 // Translate a command for OSR. Updates the input offset to be used for
389 // the next command. Returns false if translation of the command failed
390 // (e.g., a number conversion failed) and may or may not have updated the
391 // input offset.
392 bool DoOsrTranslateCommand(TranslationIterator* iterator,
393 int* input_offset);
394
395 unsigned ComputeInputFrameSize() const; 386 unsigned ComputeInputFrameSize() const;
396 unsigned ComputeFixedSize(JSFunction* function) const; 387 unsigned ComputeFixedSize(JSFunction* function) const;
397 388
398 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; 389 unsigned ComputeIncomingArgumentSize(JSFunction* function) const;
399 unsigned ComputeOutgoingArgumentSize() const; 390 unsigned ComputeOutgoingArgumentSize() const;
400 391
401 Object* ComputeLiteral(int index) const; 392 Object* ComputeLiteral(int index) const;
402 393
403 void AddObjectStart(intptr_t slot_address, int argc); 394 void AddObjectStart(intptr_t slot_address, int argc);
404 void AddObjectTaggedValue(intptr_t value); 395 void AddObjectTaggedValue(intptr_t value);
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 Object** expression_stack_; 945 Object** expression_stack_;
955 int source_position_; 946 int source_position_;
956 947
957 friend class Deoptimizer; 948 friend class Deoptimizer;
958 }; 949 };
959 #endif 950 #endif
960 951
961 } } // namespace v8::internal 952 } } // namespace v8::internal
962 953
963 #endif // V8_DEOPTIMIZER_H_ 954 #endif // V8_DEOPTIMIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698