OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 entry_pc = next_pc; | 180 entry_pc = next_pc; |
181 } | 181 } |
182 | 182 |
183 #ifdef DEBUG | 183 #ifdef DEBUG |
184 // Destroy the code which is not supposed to run again. | 184 // Destroy the code which is not supposed to run again. |
185 ZapCodeRange(previous_pc, jump_table_address); | 185 ZapCodeRange(previous_pc, jump_table_address); |
186 #endif | 186 #endif |
187 | 187 |
188 // Add the deoptimizing code to the list. | 188 // Add the deoptimizing code to the list. |
189 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); | 189 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); |
190 DeoptimizerData* data = Isolate::Current()->deoptimizer_data(); | 190 DeoptimizerData* data = code->GetIsolate()->deoptimizer_data(); |
191 node->set_next(data->deoptimizing_code_list_); | 191 node->set_next(data->deoptimizing_code_list_); |
192 data->deoptimizing_code_list_ = node; | 192 data->deoptimizing_code_list_ = node; |
193 | 193 |
194 // Set the code for the function to non-optimized version. | 194 // Set the code for the function to non-optimized version. |
195 function->ReplaceCode(function->shared()->code()); | 195 function->ReplaceCode(function->shared()->code()); |
196 | 196 |
197 if (FLAG_trace_deopt) { | 197 if (FLAG_trace_deopt) { |
198 PrintF("[forced deoptimization: "); | 198 PrintF("[forced deoptimization: "); |
199 function->PrintName(); | 199 function->PrintName(); |
200 PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast<intptr_t>(function)); | 200 PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast<intptr_t>(function)); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } else { | 382 } else { |
383 // Setup the frame pointer and the context pointer. | 383 // Setup the frame pointer and the context pointer. |
384 output_[0]->SetRegister(rbp.code(), input_->GetRegister(rbp.code())); | 384 output_[0]->SetRegister(rbp.code(), input_->GetRegister(rbp.code())); |
385 output_[0]->SetRegister(rsi.code(), input_->GetRegister(rsi.code())); | 385 output_[0]->SetRegister(rsi.code(), input_->GetRegister(rsi.code())); |
386 | 386 |
387 unsigned pc_offset = data->OsrPcOffset()->value(); | 387 unsigned pc_offset = data->OsrPcOffset()->value(); |
388 intptr_t pc = reinterpret_cast<intptr_t>( | 388 intptr_t pc = reinterpret_cast<intptr_t>( |
389 optimized_code_->entry() + pc_offset); | 389 optimized_code_->entry() + pc_offset); |
390 output_[0]->SetPc(pc); | 390 output_[0]->SetPc(pc); |
391 } | 391 } |
392 Code* continuation = Isolate::Current()->builtins()->builtin( | 392 Code* continuation = |
393 Builtins::NotifyOSR); | 393 function->GetIsolate()->builtins()->builtin(Builtins::kNotifyOSR); |
394 output_[0]->SetContinuation( | 394 output_[0]->SetContinuation( |
395 reinterpret_cast<intptr_t>(continuation->entry())); | 395 reinterpret_cast<intptr_t>(continuation->entry())); |
396 | 396 |
397 if (FLAG_trace_osr) { | 397 if (FLAG_trace_osr) { |
398 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", | 398 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", |
399 ok ? "finished" : "aborted", | 399 ok ? "finished" : "aborted", |
400 reinterpret_cast<intptr_t>(function)); | 400 reinterpret_cast<intptr_t>(function)); |
401 function->PrintName(); | 401 function->PrintName(); |
402 PrintF(" => pc=0x%0" V8PRIxPTR "]\n", output_[0]->GetPc()); | 402 PrintF(" => pc=0x%0" V8PRIxPTR "]\n", output_[0]->GetPc()); |
403 } | 403 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 intptr_t pc_value = reinterpret_cast<intptr_t>(start + pc_offset); | 555 intptr_t pc_value = reinterpret_cast<intptr_t>(start + pc_offset); |
556 output_frame->SetPc(pc_value); | 556 output_frame->SetPc(pc_value); |
557 | 557 |
558 FullCodeGenerator::State state = | 558 FullCodeGenerator::State state = |
559 FullCodeGenerator::StateField::decode(pc_and_state); | 559 FullCodeGenerator::StateField::decode(pc_and_state); |
560 output_frame->SetState(Smi::FromInt(state)); | 560 output_frame->SetState(Smi::FromInt(state)); |
561 | 561 |
562 // Set the continuation for the topmost frame. | 562 // Set the continuation for the topmost frame. |
563 if (is_topmost) { | 563 if (is_topmost) { |
564 Code* continuation = (bailout_type_ == EAGER) | 564 Code* continuation = (bailout_type_ == EAGER) |
565 ? Isolate::Current()->builtins()->builtin(Builtins::NotifyDeoptimized) | 565 ? isolate_->builtins()->builtin(Builtins::kNotifyDeoptimized) |
566 : Isolate::Current()->builtins()->builtin( | 566 : isolate_->builtins()->builtin(Builtins::kNotifyLazyDeoptimized); |
567 Builtins::NotifyLazyDeoptimized); | |
568 output_frame->SetContinuation( | 567 output_frame->SetContinuation( |
569 reinterpret_cast<intptr_t>(continuation->entry())); | 568 reinterpret_cast<intptr_t>(continuation->entry())); |
570 } | 569 } |
571 | 570 |
572 if (output_count_ - 1 == frame_index) iterator->Done(); | 571 if (output_count_ - 1 == frame_index) iterator->Done(); |
573 } | 572 } |
574 | 573 |
575 | 574 |
576 #define __ masm()-> | 575 #define __ masm()-> |
577 | 576 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 } | 780 } |
782 __ bind(&done); | 781 __ bind(&done); |
783 } | 782 } |
784 | 783 |
785 #undef __ | 784 #undef __ |
786 | 785 |
787 | 786 |
788 } } // namespace v8::internal | 787 } } // namespace v8::internal |
789 | 788 |
790 #endif // V8_TARGET_ARCH_X64 | 789 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |