 Chromium Code Reviews
 Chromium Code Reviews Issue 9572008:
  Implement date library functions in C++.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 9572008:
  Implement date library functions in C++.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/arm/lithium-codegen-arm.cc | 
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc | 
| index 630ae8dbd9c02139b453fae086d30a89607b1210..22444f38ab998805cdf7cb849d8c4efbfce988aa 100644 | 
| --- a/src/arm/lithium-codegen-arm.cc | 
| +++ b/src/arm/lithium-codegen-arm.cc | 
| @@ -1438,6 +1438,49 @@ void LCodeGen::DoValueOf(LValueOf* instr) { | 
| } | 
| +void LCodeGen::DoDateField(LDateField* instr) { | 
| + Register input = ToRegister(instr->InputAt(0)); | 
| + Register result = ToRegister(instr->result()); | 
| + Register map = ToRegister(instr->TempAt(0)); | 
| + | 
| +#ifdef DEBUG | 
| 
rossberg
2012/03/06 15:55:50
Any reason you removed the debug check in this ins
 | 
| + __ AbortIfSmi(input); | 
| + __ CompareObjectType(input, map, map, JS_DATE_TYPE); | 
| + __ Assert(eq, "Trying to get date field from non-date."); | 
| +#endif | 
| + | 
| + __ ldr(result, FieldMemOperand(input, | 
| + JSDate::kValueOffset + kPointerSize * instr->index())); | 
| +} | 
| + | 
| + | 
| +void LCodeGen::DoSetDateField(LSetDateField* instr) { | 
| + Register date = ToRegister(instr->InputAt(0)); | 
| + Register value = ToRegister(instr->InputAt(1)); | 
| + Register result = ToRegister(instr->result()); | 
| + Register temp = ToRegister(instr->TempAt(0)); | 
| + int index = instr->index(); | 
| + | 
| +#ifdef DEBUG | 
| + __ AbortIfSmi(date); | 
| + __ CompareObjectType(date, temp, temp, JS_DATE_TYPE); | 
| + __ Assert(eq, "Trying to get date field from non-date."); | 
| +#endif | 
| + | 
| + __ str(value, | 
| + FieldMemOperand(date, JSDate::kValueOffset + kPointerSize * index)); | 
| + // Caches can only be smi or NaN, so we can skip the write barrier for them. | 
| + if (index < JSDate::kFirstBarrierFree) { | 
| + // Update the write barrier. Save the value as it will be | 
| + // overwritten by the write barrier code and is needed afterward. | 
| + __ mov(result, value); | 
| + __ RecordWriteField( | 
| + date, JSDate::kValueOffset + kPointerSize * index, | 
| + value, temp, kLRHasBeenSaved, kDontSaveFPRegs); | 
| + } | 
| +} | 
| + | 
| + | 
| void LCodeGen::DoBitNotI(LBitNotI* instr) { | 
| Register input = ToRegister(instr->InputAt(0)); | 
| Register result = ToRegister(instr->result()); |