Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add constant for index of first barrier-free slot. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 // If the object is not a value type, return the object. 1424 // If the object is not a value type, return the object.
1425 __ CompareObjectType(input, map, map, JS_VALUE_TYPE); 1425 __ CompareObjectType(input, map, map, JS_VALUE_TYPE);
1426 __ Move(result, input, ne); 1426 __ Move(result, input, ne);
1427 __ b(ne, &done); 1427 __ b(ne, &done);
1428 __ ldr(result, FieldMemOperand(input, JSValue::kValueOffset)); 1428 __ ldr(result, FieldMemOperand(input, JSValue::kValueOffset));
1429 1429
1430 __ bind(&done); 1430 __ bind(&done);
1431 } 1431 }
1432 1432
1433 1433
1434 void LCodeGen::DoDateField(LDateField* instr) {
1435 Register input = ToRegister(instr->InputAt(0));
1436 Register result = ToRegister(instr->result());
1437 Register map = ToRegister(instr->TempAt(0));
1438
1439 #ifdef DEBUG
1440 __ AbortIfSmi(input);
1441 __ CompareObjectType(input, map, map, JS_DATE_TYPE);
1442 __ Assert(eq, "Trying to get date field from non-date.");
1443 #endif
1444
1445 __ ldr(result, FieldMemOperand(input,
1446 JSDate::kValueOffset + kPointerSize * instr->index()));
1447 }
1448
1449
1450 void LCodeGen::DoSetDateField(LSetDateField* instr) {
1451 Register date = ToRegister(instr->InputAt(0));
1452 Register value = ToRegister(instr->InputAt(1));
1453 Register result = ToRegister(instr->result());
1454 Register temp = ToRegister(instr->TempAt(0));
1455 int index = instr->index();
1456
1457 #ifdef DEBUG
1458 __ AbortIfSmi(date);
1459 __ CompareObjectType(date, temp, temp, JS_DATE_TYPE);
1460 __ Assert(eq, "Trying to get date field from non-date.");
1461 #endif
1462
1463 __ str(value,
1464 FieldMemOperand(date, JSDate::kValueOffset + kPointerSize * index));
1465 // Caches can only be smi or NaN, so we can skip the write barrier for them.
1466 if (index < JSDate::kFirstBarrierFree) {
1467 // Update the write barrier. Save the value as it will be
1468 // overwritten by the write barrier code and is needed afterward.
1469 __ mov(result, value);
1470 __ RecordWriteField(
1471 date, JSDate::kValueOffset + kPointerSize * index,
1472 value, temp, kLRHasBeenSaved, kDontSaveFPRegs);
1473 }
1474 }
1475
1476
1434 void LCodeGen::DoBitNotI(LBitNotI* instr) { 1477 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1435 Register input = ToRegister(instr->InputAt(0)); 1478 Register input = ToRegister(instr->InputAt(0));
1436 Register result = ToRegister(instr->result()); 1479 Register result = ToRegister(instr->result());
1437 __ mvn(result, Operand(input)); 1480 __ mvn(result, Operand(input));
1438 } 1481 }
1439 1482
1440 1483
1441 void LCodeGen::DoThrow(LThrow* instr) { 1484 void LCodeGen::DoThrow(LThrow* instr) {
1442 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); 1485 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip);
1443 __ push(input_reg); 1486 __ push(input_reg);
(...skipping 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after
4800 ASSERT(osr_pc_offset_ == -1); 4843 ASSERT(osr_pc_offset_ == -1);
4801 osr_pc_offset_ = masm()->pc_offset(); 4844 osr_pc_offset_ = masm()->pc_offset();
4802 } 4845 }
4803 4846
4804 4847
4805 4848
4806 4849
4807 #undef __ 4850 #undef __
4808 4851
4809 } } // namespace v8::internal 4852 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698