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

Side by Side Diff: src/x64/deoptimizer-x64.cc

Issue 6880010: Merge (7265, 7271] from bleeding_edge to experimental/gc branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 8 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 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
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 node->set_next(deoptimizing_code_list_); 190 DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
191 deoptimizing_code_list_ = node; 191 node->set_next(data->deoptimizing_code_list_);
192 data->deoptimizing_code_list_ = node;
192 193
193 // Set the code for the function to non-optimized version. 194 // Set the code for the function to non-optimized version.
194 function->ReplaceCode(function->shared()->code()); 195 function->ReplaceCode(function->shared()->code());
195 196
196 if (FLAG_trace_deopt) { 197 if (FLAG_trace_deopt) {
197 PrintF("[forced deoptimization: "); 198 PrintF("[forced deoptimization: ");
198 function->PrintName(); 199 function->PrintName();
199 PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast<intptr_t>(function)); 200 PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast<intptr_t>(function));
200 #ifdef DEBUG 201 #ifdef DEBUG
201 if (FLAG_print_code) { 202 if (FLAG_print_code) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } else { 383 } else {
383 // Setup the frame pointer and the context pointer. 384 // Setup the frame pointer and the context pointer.
384 output_[0]->SetRegister(rbp.code(), input_->GetRegister(rbp.code())); 385 output_[0]->SetRegister(rbp.code(), input_->GetRegister(rbp.code()));
385 output_[0]->SetRegister(rsi.code(), input_->GetRegister(rsi.code())); 386 output_[0]->SetRegister(rsi.code(), input_->GetRegister(rsi.code()));
386 387
387 unsigned pc_offset = data->OsrPcOffset()->value(); 388 unsigned pc_offset = data->OsrPcOffset()->value();
388 intptr_t pc = reinterpret_cast<intptr_t>( 389 intptr_t pc = reinterpret_cast<intptr_t>(
389 optimized_code_->entry() + pc_offset); 390 optimized_code_->entry() + pc_offset);
390 output_[0]->SetPc(pc); 391 output_[0]->SetPc(pc);
391 } 392 }
392 Code* continuation = Builtins::builtin(Builtins::NotifyOSR); 393 Code* continuation = Isolate::Current()->builtins()->builtin(
394 Builtins::NotifyOSR);
393 output_[0]->SetContinuation( 395 output_[0]->SetContinuation(
394 reinterpret_cast<intptr_t>(continuation->entry())); 396 reinterpret_cast<intptr_t>(continuation->entry()));
395 397
396 if (FLAG_trace_osr) { 398 if (FLAG_trace_osr) {
397 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", 399 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ",
398 ok ? "finished" : "aborted", 400 ok ? "finished" : "aborted",
399 reinterpret_cast<intptr_t>(function)); 401 reinterpret_cast<intptr_t>(function));
400 function->PrintName(); 402 function->PrintName();
401 PrintF(" => pc=0x%0" V8PRIxPTR "]\n", output_[0]->GetPc()); 403 PrintF(" => pc=0x%0" V8PRIxPTR "]\n", output_[0]->GetPc());
402 } 404 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 intptr_t pc_value = reinterpret_cast<intptr_t>(start + pc_offset); 556 intptr_t pc_value = reinterpret_cast<intptr_t>(start + pc_offset);
555 output_frame->SetPc(pc_value); 557 output_frame->SetPc(pc_value);
556 558
557 FullCodeGenerator::State state = 559 FullCodeGenerator::State state =
558 FullCodeGenerator::StateField::decode(pc_and_state); 560 FullCodeGenerator::StateField::decode(pc_and_state);
559 output_frame->SetState(Smi::FromInt(state)); 561 output_frame->SetState(Smi::FromInt(state));
560 562
561 // Set the continuation for the topmost frame. 563 // Set the continuation for the topmost frame.
562 if (is_topmost) { 564 if (is_topmost) {
563 Code* continuation = (bailout_type_ == EAGER) 565 Code* continuation = (bailout_type_ == EAGER)
564 ? Builtins::builtin(Builtins::NotifyDeoptimized) 566 ? Isolate::Current()->builtins()->builtin(Builtins::NotifyDeoptimized)
565 : Builtins::builtin(Builtins::NotifyLazyDeoptimized); 567 : Isolate::Current()->builtins()->builtin(
568 Builtins::NotifyLazyDeoptimized);
566 output_frame->SetContinuation( 569 output_frame->SetContinuation(
567 reinterpret_cast<intptr_t>(continuation->entry())); 570 reinterpret_cast<intptr_t>(continuation->entry()));
568 } 571 }
569 572
570 if (output_count_ - 1 == frame_index) iterator->Done(); 573 if (output_count_ - 1 == frame_index) iterator->Done();
571 } 574 }
572 575
573 576
574 #define __ masm()-> 577 #define __ masm()->
575 578
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 } 779 }
777 __ bind(&done); 780 __ bind(&done);
778 } 781 }
779 782
780 #undef __ 783 #undef __
781 784
782 785
783 } } // namespace v8::internal 786 } } // namespace v8::internal
784 787
785 #endif // V8_TARGET_ARCH_X64 788 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/store-buffer.cc ('K') | « src/x64/debug-x64.cc ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698