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

Side by Side Diff: src/a64/stub-cache-a64.cc

Issue 206183005: A64: Minor cleaning in StoreStubCompiler::GenerateStoreField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 transition->LastAdded()); 454 transition->LastAdded());
455 455
456 // Adjust for the number of properties stored in the object. Even in the 456 // Adjust for the number of properties stored in the object. Even in the
457 // face of a transition we can use the old map here because the size of the 457 // face of a transition we can use the old map here because the size of the
458 // object and the number of in-object properties is not going to change. 458 // object and the number of in-object properties is not going to change.
459 index -= object->map()->inobject_properties(); 459 index -= object->map()->inobject_properties();
460 460
461 // TODO(verwaest): Share this code as a code stub. 461 // TODO(verwaest): Share this code as a code stub.
462 SmiCheck smi_check = representation.IsTagged() 462 SmiCheck smi_check = representation.IsTagged()
463 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; 463 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK;
464 Register prop_reg =
465 (FLAG_track_double_fields && representation.IsDouble()) ? storage_reg
ulan 2014/03/20 10:39:37 why FLAG_track_double_fields?
466 : value_reg;
464 if (index < 0) { 467 if (index < 0) {
465 // Set the property straight into the object. 468 // Set the property straight into the object.
466 int offset = object->map()->instance_size() + (index * kPointerSize); 469 int offset = object->map()->instance_size() + (index * kPointerSize);
467 // TODO(jbramley): This construct appears in several places in this 470 // TODO(jbramley): This construct appears in several places in this
468 // function. Try to clean it up, perhaps using a result_reg. 471 // function. Try to clean it up, perhaps using a result_reg.
469 if (representation.IsDouble()) { 472 __ Str(prop_reg, FieldMemOperand(receiver_reg, offset));
470 __ Str(storage_reg, FieldMemOperand(receiver_reg, offset));
471 } else {
472 __ Str(value_reg, FieldMemOperand(receiver_reg, offset));
473 }
474 473
475 if (!representation.IsSmi()) { 474 if (!representation.IsSmi()) {
476 // Update the write barrier for the array address. 475 // Update the write barrier for the array address.
477 if (!representation.IsDouble()) { 476 if (!representation.IsDouble()) {
478 __ Mov(storage_reg, value_reg); 477 __ Mov(storage_reg, value_reg);
479 } 478 }
480 __ RecordWriteField(receiver_reg, 479 __ RecordWriteField(receiver_reg,
481 offset, 480 offset,
482 storage_reg, 481 storage_reg,
483 scratch1, 482 scratch1,
484 kLRHasNotBeenSaved, 483 kLRHasNotBeenSaved,
485 kDontSaveFPRegs, 484 kDontSaveFPRegs,
486 EMIT_REMEMBERED_SET, 485 EMIT_REMEMBERED_SET,
487 smi_check); 486 smi_check);
488 } 487 }
489 } else { 488 } else {
490 // Write to the properties array. 489 // Write to the properties array.
491 int offset = index * kPointerSize + FixedArray::kHeaderSize; 490 int offset = index * kPointerSize + FixedArray::kHeaderSize;
492 // Get the properties array 491 // Get the properties array
493 __ Ldr(scratch1, 492 __ Ldr(scratch1,
494 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 493 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
495 if (representation.IsDouble()) { 494 __ Str(prop_reg, FieldMemOperand(scratch1, offset));
496 __ Str(storage_reg, FieldMemOperand(scratch1, offset));
497 } else {
498 __ Str(value_reg, FieldMemOperand(scratch1, offset));
499 }
500 495
501 if (!representation.IsSmi()) { 496 if (!representation.IsSmi()) {
502 // Update the write barrier for the array address. 497 // Update the write barrier for the array address.
503 if (!representation.IsDouble()) { 498 if (!representation.IsDouble()) {
504 __ Mov(storage_reg, value_reg); 499 __ Mov(storage_reg, value_reg);
505 } 500 }
506 __ RecordWriteField(scratch1, 501 __ RecordWriteField(scratch1,
507 offset, 502 offset,
508 storage_reg, 503 storage_reg,
509 receiver_reg, 504 receiver_reg,
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 1494
1500 // Miss case, call the runtime. 1495 // Miss case, call the runtime.
1501 __ Bind(&miss); 1496 __ Bind(&miss);
1502 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1497 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1503 } 1498 }
1504 1499
1505 1500
1506 } } // namespace v8::internal 1501 } } // namespace v8::internal
1507 1502
1508 #endif // V8_TARGET_ARCH_A64 1503 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698