| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 82 | 82 | 
| 83 void LCodeGen::FinishCode(Handle<Code> code) { | 83 void LCodeGen::FinishCode(Handle<Code> code) { | 
| 84   ASSERT(is_done()); | 84   ASSERT(is_done()); | 
| 85   code->set_stack_slots(GetStackSlotCount()); | 85   code->set_stack_slots(GetStackSlotCount()); | 
| 86   code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 86   code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 
| 87   if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code); | 87   if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code); | 
| 88   PopulateDeoptimizationData(code); | 88   PopulateDeoptimizationData(code); | 
| 89 } | 89 } | 
| 90 | 90 | 
| 91 | 91 | 
| 92 void LChunkBuilder::Abort(BailoutReason reason) { |  | 
| 93   info()->set_bailout_reason(reason); |  | 
| 94   status_ = ABORTED; |  | 
| 95 } |  | 
| 96 |  | 
| 97 |  | 
| 98 void LCodeGen::SaveCallerDoubles() { | 92 void LCodeGen::SaveCallerDoubles() { | 
| 99   ASSERT(info()->saves_caller_doubles()); | 93   ASSERT(info()->saves_caller_doubles()); | 
| 100   ASSERT(NeedsEagerFrame()); | 94   ASSERT(NeedsEagerFrame()); | 
| 101   Comment(";;; Save clobbered callee double registers"); | 95   Comment(";;; Save clobbered callee double registers"); | 
| 102   int count = 0; | 96   int count = 0; | 
| 103   BitVector* doubles = chunk()->allocated_double_registers(); | 97   BitVector* doubles = chunk()->allocated_double_registers(); | 
| 104   BitVector::Iterator save_iterator(doubles); | 98   BitVector::Iterator save_iterator(doubles); | 
| 105   while (!save_iterator.Done()) { | 99   while (!save_iterator.Done()) { | 
| 106     __ sdc1(DoubleRegister::FromAllocationIndex(save_iterator.Current()), | 100     __ sdc1(DoubleRegister::FromAllocationIndex(save_iterator.Current()), | 
| 107             MemOperand(sp, count * kDoubleSize)); | 101             MemOperand(sp, count * kDoubleSize)); | 
| (...skipping 3957 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4065   HObjectAccess access = instr->hydrogen()->access(); | 4059   HObjectAccess access = instr->hydrogen()->access(); | 
| 4066   int offset = access.offset(); | 4060   int offset = access.offset(); | 
| 4067 | 4061 | 
| 4068   if (access.IsExternalMemory()) { | 4062   if (access.IsExternalMemory()) { | 
| 4069     Register value = ToRegister(instr->value()); | 4063     Register value = ToRegister(instr->value()); | 
| 4070     MemOperand operand = MemOperand(object, offset); | 4064     MemOperand operand = MemOperand(object, offset); | 
| 4071     __ Store(value, operand, representation); | 4065     __ Store(value, operand, representation); | 
| 4072     return; | 4066     return; | 
| 4073   } | 4067   } | 
| 4074 | 4068 | 
| 4075   Handle<Map> transition = instr->transition(); |  | 
| 4076   SmiCheck check_needed = | 4069   SmiCheck check_needed = | 
| 4077       instr->hydrogen()->value()->IsHeapObject() | 4070       instr->hydrogen()->value()->IsHeapObject() | 
| 4078           ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4071           ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 
| 4079 | 4072 | 
| 4080   ASSERT(!(representation.IsSmi() && | 4073   ASSERT(!(representation.IsSmi() && | 
| 4081            instr->value()->IsConstantOperand() && | 4074            instr->value()->IsConstantOperand() && | 
| 4082            !IsSmi(LConstantOperand::cast(instr->value())))); | 4075            !IsSmi(LConstantOperand::cast(instr->value())))); | 
| 4083   if (representation.IsHeapObject()) { | 4076   if (representation.IsHeapObject()) { | 
| 4084     Register value = ToRegister(instr->value()); | 4077     Register value = ToRegister(instr->value()); | 
| 4085     if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 4078     if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 
| 4086       __ SmiTst(value, scratch); | 4079       __ SmiTst(value, scratch); | 
| 4087       DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); | 4080       DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); | 
| 4088 | 4081 | 
| 4089       // We know now that value is not a smi, so we can omit the check below. | 4082       // We know now that value is not a smi, so we can omit the check below. | 
| 4090       check_needed = OMIT_SMI_CHECK; | 4083       check_needed = OMIT_SMI_CHECK; | 
| 4091     } | 4084     } | 
| 4092   } else if (representation.IsDouble()) { | 4085   } else if (representation.IsDouble()) { | 
| 4093     ASSERT(transition.is_null()); |  | 
| 4094     ASSERT(access.IsInobject()); | 4086     ASSERT(access.IsInobject()); | 
|  | 4087     ASSERT(!instr->hydrogen()->has_transition()); | 
| 4095     ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4088     ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 
| 4096     DoubleRegister value = ToDoubleRegister(instr->value()); | 4089     DoubleRegister value = ToDoubleRegister(instr->value()); | 
| 4097     __ sdc1(value, FieldMemOperand(object, offset)); | 4090     __ sdc1(value, FieldMemOperand(object, offset)); | 
| 4098     return; | 4091     return; | 
| 4099   } | 4092   } | 
| 4100 | 4093 | 
| 4101   if (!transition.is_null()) { | 4094   if (instr->hydrogen()->has_transition()) { | 
|  | 4095     Handle<Map> transition = instr->hydrogen()->transition_map(); | 
|  | 4096     AddDeprecationDependency(transition); | 
| 4102     __ li(scratch, Operand(transition)); | 4097     __ li(scratch, Operand(transition)); | 
| 4103     __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4098     __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 
| 4104     if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4099     if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 
| 4105       Register temp = ToRegister(instr->temp()); | 4100       Register temp = ToRegister(instr->temp()); | 
| 4106       // Update the write barrier for the map field. | 4101       // Update the write barrier for the map field. | 
| 4107       __ RecordWriteField(object, | 4102       __ RecordWriteField(object, | 
| 4108                           HeapObject::kMapOffset, | 4103                           HeapObject::kMapOffset, | 
| 4109                           scratch, | 4104                           scratch, | 
| 4110                           temp, | 4105                           temp, | 
| 4111                           GetRAState(), | 4106                           GetRAState(), | 
| (...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5896   __ lw(result, FieldMemOperand(scratch, | 5891   __ lw(result, FieldMemOperand(scratch, | 
| 5897                                 FixedArray::kHeaderSize - kPointerSize)); | 5892                                 FixedArray::kHeaderSize - kPointerSize)); | 
| 5898   __ bind(deferred->exit()); | 5893   __ bind(deferred->exit()); | 
| 5899   __ bind(&done); | 5894   __ bind(&done); | 
| 5900 } | 5895 } | 
| 5901 | 5896 | 
| 5902 | 5897 | 
| 5903 #undef __ | 5898 #undef __ | 
| 5904 | 5899 | 
| 5905 } }  // namespace v8::internal | 5900 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|