Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 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 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1431 // If the object is not a value type, return the object. | 1431 // If the object is not a value type, return the object. |
| 1432 __ CompareObjectType(input, map, map, JS_VALUE_TYPE); | 1432 __ CompareObjectType(input, map, map, JS_VALUE_TYPE); |
| 1433 __ Move(result, input, ne); | 1433 __ Move(result, input, ne); |
| 1434 __ b(ne, &done); | 1434 __ b(ne, &done); |
| 1435 __ ldr(result, FieldMemOperand(input, JSValue::kValueOffset)); | 1435 __ ldr(result, FieldMemOperand(input, JSValue::kValueOffset)); |
| 1436 | 1436 |
| 1437 __ bind(&done); | 1437 __ bind(&done); |
| 1438 } | 1438 } |
| 1439 | 1439 |
| 1440 | 1440 |
| 1441 void LCodeGen::DoDateField(LDateField* instr) { | |
| 1442 Register input = ToRegister(instr->InputAt(0)); | |
| 1443 Register result = ToRegister(instr->result()); | |
| 1444 Register map = ToRegister(instr->TempAt(0)); | |
| 1445 | |
| 1446 #ifdef DEBUG | |
|
rossberg
2012/03/06 15:55:50
Any reason you removed the debug check in this ins
| |
| 1447 __ AbortIfSmi(input); | |
| 1448 __ CompareObjectType(input, map, map, JS_DATE_TYPE); | |
| 1449 __ Assert(eq, "Trying to get date field from non-date."); | |
| 1450 #endif | |
| 1451 | |
| 1452 __ ldr(result, FieldMemOperand(input, | |
| 1453 JSDate::kValueOffset + kPointerSize * instr->index())); | |
| 1454 } | |
| 1455 | |
| 1456 | |
| 1457 void LCodeGen::DoSetDateField(LSetDateField* instr) { | |
| 1458 Register date = ToRegister(instr->InputAt(0)); | |
| 1459 Register value = ToRegister(instr->InputAt(1)); | |
| 1460 Register result = ToRegister(instr->result()); | |
| 1461 Register temp = ToRegister(instr->TempAt(0)); | |
| 1462 int index = instr->index(); | |
| 1463 | |
| 1464 #ifdef DEBUG | |
| 1465 __ AbortIfSmi(date); | |
| 1466 __ CompareObjectType(date, temp, temp, JS_DATE_TYPE); | |
| 1467 __ Assert(eq, "Trying to get date field from non-date."); | |
| 1468 #endif | |
| 1469 | |
| 1470 __ str(value, | |
| 1471 FieldMemOperand(date, JSDate::kValueOffset + kPointerSize * index)); | |
| 1472 // Caches can only be smi or NaN, so we can skip the write barrier for them. | |
| 1473 if (index < JSDate::kFirstBarrierFree) { | |
| 1474 // Update the write barrier. Save the value as it will be | |
| 1475 // overwritten by the write barrier code and is needed afterward. | |
| 1476 __ mov(result, value); | |
| 1477 __ RecordWriteField( | |
| 1478 date, JSDate::kValueOffset + kPointerSize * index, | |
| 1479 value, temp, kLRHasBeenSaved, kDontSaveFPRegs); | |
| 1480 } | |
| 1481 } | |
| 1482 | |
| 1483 | |
| 1441 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 1484 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
| 1442 Register input = ToRegister(instr->InputAt(0)); | 1485 Register input = ToRegister(instr->InputAt(0)); |
| 1443 Register result = ToRegister(instr->result()); | 1486 Register result = ToRegister(instr->result()); |
| 1444 __ mvn(result, Operand(input)); | 1487 __ mvn(result, Operand(input)); |
| 1445 } | 1488 } |
| 1446 | 1489 |
| 1447 | 1490 |
| 1448 void LCodeGen::DoThrow(LThrow* instr) { | 1491 void LCodeGen::DoThrow(LThrow* instr) { |
| 1449 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); | 1492 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); |
| 1450 __ push(input_reg); | 1493 __ push(input_reg); |
| (...skipping 3525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4976 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5019 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 4977 __ ldr(result, FieldMemOperand(scratch, | 5020 __ ldr(result, FieldMemOperand(scratch, |
| 4978 FixedArray::kHeaderSize - kPointerSize)); | 5021 FixedArray::kHeaderSize - kPointerSize)); |
| 4979 __ bind(&done); | 5022 __ bind(&done); |
| 4980 } | 5023 } |
| 4981 | 5024 |
| 4982 | 5025 |
| 4983 #undef __ | 5026 #undef __ |
| 4984 | 5027 |
| 4985 } } // namespace v8::internal | 5028 } } // namespace v8::internal |
| OLD | NEW |