OLD | NEW |
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; | 418 int double_register_param_count = 0; |
419 int x87_layout = 0; | 419 int x87_layout = 0; |
420 for (size_t i = 0; i < instr->InputCount(); i++) { | 420 for (size_t i = 0; i < instr->InputCount(); i++) { |
421 if (instr->InputAt(i)->IsDoubleRegister()) { | 421 if (instr->InputAt(i)->IsDoubleRegister()) { |
422 double_register_param_count++; | 422 double_register_param_count++; |
423 } | 423 } |
424 } | 424 } |
425 // Currently we use only one X87 register. If we use more X87 register | 425 // Currently we use only one X87 register. If double_register_param_count |
426 // in the future. we need to generate the x87 layout according to the | 426 // is bigger than 1, it means duplicated double register is added to input |
427 // used double registers. | 427 // of this instruction. |
428 DCHECK(double_register_param_count < 2); | 428 if (double_register_param_count > 0) { |
429 if (double_register_param_count == 1) { | |
430 x87_layout = (0 << 3) | 1; | 429 x87_layout = (0 << 3) | 1; |
431 } | 430 } |
432 // The layout of x87 register stack is loaded on the top of FPU register | 431 // The layout of x87 register stack is loaded on the top of FPU register |
433 // stack for deoptimization. | 432 // stack for deoptimization. |
434 __ push(Immediate(x87_layout)); | 433 __ push(Immediate(x87_layout)); |
435 __ fild_s(MemOperand(esp, 0)); | 434 __ fild_s(MemOperand(esp, 0)); |
436 __ lea(esp, Operand(esp, kPointerSize)); | 435 __ lea(esp, Operand(esp, kPointerSize)); |
437 | 436 |
438 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); | 437 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); |
439 break; | 438 break; |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1912 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1914 __ Nop(padding_size); | 1913 __ Nop(padding_size); |
1915 } | 1914 } |
1916 } | 1915 } |
1917 | 1916 |
1918 #undef __ | 1917 #undef __ |
1919 | 1918 |
1920 } // namespace compiler | 1919 } // namespace compiler |
1921 } // namespace internal | 1920 } // namespace internal |
1922 } // namespace v8 | 1921 } // namespace v8 |
OLD | NEW |