hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
changeset 38018 1dc6c6f21231
parent 35540 e001ad24dcdb
child 38177 b0c9cb06506b
equal deleted inserted replaced
38017:55047d16f141 38018:1dc6c6f21231
   784 
   784 
   785       op2->set_fpu_stack_size(sim()->stack_size());
   785       op2->set_fpu_stack_size(sim()->stack_size());
   786       break;
   786       break;
   787     }
   787     }
   788 
   788 
   789     case lir_log10: {
       
   790       // log and log10 need one temporary fpu stack slot, so
       
   791       // there is one temporary registers stored in temp of the
       
   792       // operation. the stack allocator must guarantee that the stack
       
   793       // slots are really free, otherwise there might be a stack
       
   794       // overflow.
       
   795       assert(right->is_illegal(), "must be");
       
   796       assert(left->is_fpu_register(), "must be");
       
   797       assert(res->is_fpu_register(), "must be");
       
   798       assert(op2->tmp1_opr()->is_fpu_register(), "must be");
       
   799 
       
   800       insert_free_if_dead(op2->tmp1_opr());
       
   801       insert_free_if_dead(res, left);
       
   802       insert_exchange(left);
       
   803       do_rename(left, res);
       
   804 
       
   805       new_left = to_fpu_stack_top(res);
       
   806       new_res = new_left;
       
   807 
       
   808       op2->set_fpu_stack_size(sim()->stack_size());
       
   809       assert(sim()->stack_size() <= 7, "at least one stack slot must be free");
       
   810       break;
       
   811     }
       
   812 
       
   813 
       
   814     case lir_tan: {
       
   815       // sin, cos and exp need two temporary fpu stack slots, so there are two temporary
       
   816       // registers (stored in right and temp of the operation).
       
   817       // the stack allocator must guarantee that the stack slots are really free,
       
   818       // otherwise there might be a stack overflow.
       
   819       assert(left->is_fpu_register(), "must be");
       
   820       assert(res->is_fpu_register(), "must be");
       
   821       // assert(left->is_last_use(), "old value gets destroyed");
       
   822       assert(right->is_fpu_register(), "right is used as the first temporary register");
       
   823       assert(op2->tmp1_opr()->is_fpu_register(), "temp is used as the second temporary register");
       
   824       assert(fpu_num(left) != fpu_num(right) && fpu_num(right) != fpu_num(op2->tmp1_opr()) && fpu_num(op2->tmp1_opr()) != fpu_num(res), "need distinct temp registers");
       
   825 
       
   826       insert_free_if_dead(right);
       
   827       insert_free_if_dead(op2->tmp1_opr());
       
   828 
       
   829       insert_free_if_dead(res, left);
       
   830       insert_exchange(left);
       
   831       do_rename(left, res);
       
   832 
       
   833       new_left = to_fpu_stack_top(res);
       
   834       new_res = new_left;
       
   835 
       
   836       op2->set_fpu_stack_size(sim()->stack_size());
       
   837       assert(sim()->stack_size() <= 6, "at least two stack slots must be free");
       
   838       break;
       
   839     }
       
   840 
       
   841     default: {
   789     default: {
   842       assert(false, "missed a fpu-operation");
   790       assert(false, "missed a fpu-operation");
   843     }
   791     }
   844   }
   792   }
   845 
   793