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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 (code->safepoint_table_offset() - last_pc_offset) / Assembler::kInstrSize; | 99 (code->safepoint_table_offset() - last_pc_offset) / Assembler::kInstrSize; |
100 CodePatcher destroyer(code->instruction_start() + last_pc_offset, | 100 CodePatcher destroyer(code->instruction_start() + last_pc_offset, |
101 instructions); | 101 instructions); |
102 for (int x = 0; x < instructions; x++) { | 102 for (int x = 0; x < instructions; x++) { |
103 destroyer.masm()->bkpt(0); | 103 destroyer.masm()->bkpt(0); |
104 } | 104 } |
105 #endif | 105 #endif |
106 | 106 |
107 // Add the deoptimizing code to the list. | 107 // Add the deoptimizing code to the list. |
108 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); | 108 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code); |
109 DeoptimizerData* data = Isolate::Current()->deoptimizer_data(); | 109 DeoptimizerData* data = code->GetIsolate()->deoptimizer_data(); |
110 node->set_next(data->deoptimizing_code_list_); | 110 node->set_next(data->deoptimizing_code_list_); |
111 data->deoptimizing_code_list_ = node; | 111 data->deoptimizing_code_list_ = node; |
112 | 112 |
113 // Set the code for the function to non-optimized version. | 113 // Set the code for the function to non-optimized version. |
114 function->ReplaceCode(function->shared()->code()); | 114 function->ReplaceCode(function->shared()->code()); |
115 | 115 |
116 if (FLAG_trace_deopt) { | 116 if (FLAG_trace_deopt) { |
117 PrintF("[forced deoptimization: "); | 117 PrintF("[forced deoptimization: "); |
118 function->PrintName(); | 118 function->PrintName(); |
119 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function)); | 119 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function)); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } else { | 309 } else { |
310 // Setup the frame pointer and the context pointer. | 310 // Setup the frame pointer and the context pointer. |
311 output_[0]->SetRegister(fp.code(), input_->GetRegister(fp.code())); | 311 output_[0]->SetRegister(fp.code(), input_->GetRegister(fp.code())); |
312 output_[0]->SetRegister(cp.code(), input_->GetRegister(cp.code())); | 312 output_[0]->SetRegister(cp.code(), input_->GetRegister(cp.code())); |
313 | 313 |
314 unsigned pc_offset = data->OsrPcOffset()->value(); | 314 unsigned pc_offset = data->OsrPcOffset()->value(); |
315 uint32_t pc = reinterpret_cast<uint32_t>( | 315 uint32_t pc = reinterpret_cast<uint32_t>( |
316 optimized_code_->entry() + pc_offset); | 316 optimized_code_->entry() + pc_offset); |
317 output_[0]->SetPc(pc); | 317 output_[0]->SetPc(pc); |
318 } | 318 } |
319 Code* continuation = Isolate::Current()->builtins()->builtin( | 319 Code* continuation = isolate_->builtins()->builtin(Builtins::kNotifyOSR); |
320 Builtins::NotifyOSR); | |
321 output_[0]->SetContinuation( | 320 output_[0]->SetContinuation( |
322 reinterpret_cast<uint32_t>(continuation->entry())); | 321 reinterpret_cast<uint32_t>(continuation->entry())); |
323 | 322 |
324 if (FLAG_trace_osr) { | 323 if (FLAG_trace_osr) { |
325 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", | 324 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", |
326 ok ? "finished" : "aborted", | 325 ok ? "finished" : "aborted", |
327 reinterpret_cast<intptr_t>(function)); | 326 reinterpret_cast<intptr_t>(function)); |
328 function->PrintName(); | 327 function->PrintName(); |
329 PrintF(" => pc=0x%0x]\n", output_[0]->GetPc()); | 328 PrintF(" => pc=0x%0x]\n", output_[0]->GetPc()); |
330 } | 329 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 488 |
490 FullCodeGenerator::State state = | 489 FullCodeGenerator::State state = |
491 FullCodeGenerator::StateField::decode(pc_and_state); | 490 FullCodeGenerator::StateField::decode(pc_and_state); |
492 output_frame->SetState(Smi::FromInt(state)); | 491 output_frame->SetState(Smi::FromInt(state)); |
493 | 492 |
494 | 493 |
495 // Set the continuation for the topmost frame. | 494 // Set the continuation for the topmost frame. |
496 if (is_topmost) { | 495 if (is_topmost) { |
497 Builtins* builtins = isolate_->builtins(); | 496 Builtins* builtins = isolate_->builtins(); |
498 Code* continuation = (bailout_type_ == EAGER) | 497 Code* continuation = (bailout_type_ == EAGER) |
499 ? builtins->builtin(Builtins::NotifyDeoptimized) | 498 ? builtins->builtin(Builtins::kNotifyDeoptimized) |
500 : builtins->builtin(Builtins::NotifyLazyDeoptimized); | 499 : builtins->builtin(Builtins::kNotifyLazyDeoptimized); |
501 output_frame->SetContinuation( | 500 output_frame->SetContinuation( |
502 reinterpret_cast<uint32_t>(continuation->entry())); | 501 reinterpret_cast<uint32_t>(continuation->entry())); |
503 } | 502 } |
504 | 503 |
505 if (output_count_ - 1 == frame_index) iterator->Done(); | 504 if (output_count_ - 1 == frame_index) iterator->Done(); |
506 } | 505 } |
507 | 506 |
508 | 507 |
509 #define __ masm()-> | 508 #define __ masm()-> |
510 | 509 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 __ push(ip); | 702 __ push(ip); |
704 __ b(&done); | 703 __ b(&done); |
705 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 704 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
706 } | 705 } |
707 __ bind(&done); | 706 __ bind(&done); |
708 } | 707 } |
709 | 708 |
710 #undef __ | 709 #undef __ |
711 | 710 |
712 } } // namespace v8::internal | 711 } } // namespace v8::internal |
OLD | NEW |