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

Side by Side Diff: src/compiler/x87/code-generator-x87.cc

Issue 1411223010: X87: fix the deoptimization issue. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 break; 408 break;
409 case kArchTableSwitch: 409 case kArchTableSwitch:
410 AssembleArchTableSwitch(instr); 410 AssembleArchTableSwitch(instr);
411 break; 411 break;
412 case kArchNop: 412 case kArchNop:
413 // don't emit code for nops. 413 // don't emit code for nops.
414 break; 414 break;
415 case kArchDeoptimize: { 415 case kArchDeoptimize: {
416 int deopt_state_id = 416 int deopt_state_id =
417 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); 417 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
418 int double_register_param_count = 0;
419 int x87_layout = 0;
420 for (size_t i = 0; i < instr->InputCount(); i++) {
421 if (instr->InputAt(i)->IsDoubleRegister()) {
422 double_register_param_count++;
423 }
424 }
425 // Currently we use only one X87 register. If we use more X87 register
426 // in the future. we need to generate the x87 layout according to the
427 // used double registers.
428 DCHECK(double_register_param_count < 2);
429 if (double_register_param_count == 1) {
430 x87_layout = (0 << 3) | 1;
431 }
432 // The layout of x87 register stack is loaded on the top of FPU register
433 // stack for deoptimization.
434 __ push(Immediate(x87_layout));
435 __ fild_s(MemOperand(esp, 0));
436 __ lea(esp, Operand(esp, kPointerSize));
437
418 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); 438 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER);
419 break; 439 break;
420 } 440 }
421 case kArchRet: 441 case kArchRet:
422 AssembleReturn(); 442 AssembleReturn();
423 break; 443 break;
424 case kArchFramePointer: 444 case kArchFramePointer:
425 __ mov(i.OutputRegister(), ebp); 445 __ mov(i.OutputRegister(), ebp);
426 break; 446 break;
427 case kArchStackPointer: 447 case kArchStackPointer:
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1913 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1894 __ Nop(padding_size); 1914 __ Nop(padding_size);
1895 } 1915 }
1896 } 1916 }
1897 1917
1898 #undef __ 1918 #undef __
1899 1919
1900 } // namespace compiler 1920 } // namespace compiler
1901 } // namespace internal 1921 } // namespace internal
1902 } // namespace v8 1922 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698