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

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: Fix test after rebasing. 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 = (representation.IsDouble()) ? storage_reg : value_reg;
ulan 2014/03/20 10:49:27 Nit: no need to put representation.IsDouble() in (
464 if (index < 0) { 465 if (index < 0) {
465 // Set the property straight into the object. 466 // Set the property straight into the object.
466 int offset = object->map()->instance_size() + (index * kPointerSize); 467 int offset = object->map()->instance_size() + (index * kPointerSize);
467 // TODO(jbramley): This construct appears in several places in this 468 __ Str(prop_reg, FieldMemOperand(receiver_reg, offset));
468 // function. Try to clean it up, perhaps using a result_reg.
469 if (representation.IsDouble()) {
470 __ Str(storage_reg, FieldMemOperand(receiver_reg, offset));
471 } else {
472 __ Str(value_reg, FieldMemOperand(receiver_reg, offset));
473 }
474 469
475 if (!representation.IsSmi()) { 470 if (!representation.IsSmi()) {
476 // Update the write barrier for the array address. 471 // Update the write barrier for the array address.
477 if (!representation.IsDouble()) { 472 if (!representation.IsDouble()) {
478 __ Mov(storage_reg, value_reg); 473 __ Mov(storage_reg, value_reg);
479 } 474 }
480 __ RecordWriteField(receiver_reg, 475 __ RecordWriteField(receiver_reg,
481 offset, 476 offset,
482 storage_reg, 477 storage_reg,
483 scratch1, 478 scratch1,
484 kLRHasNotBeenSaved, 479 kLRHasNotBeenSaved,
485 kDontSaveFPRegs, 480 kDontSaveFPRegs,
486 EMIT_REMEMBERED_SET, 481 EMIT_REMEMBERED_SET,
487 smi_check); 482 smi_check);
488 } 483 }
489 } else { 484 } else {
490 // Write to the properties array. 485 // Write to the properties array.
491 int offset = index * kPointerSize + FixedArray::kHeaderSize; 486 int offset = index * kPointerSize + FixedArray::kHeaderSize;
492 // Get the properties array 487 // Get the properties array
493 __ Ldr(scratch1, 488 __ Ldr(scratch1,
494 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 489 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
495 if (representation.IsDouble()) { 490 __ Str(prop_reg, FieldMemOperand(scratch1, offset));
496 __ Str(storage_reg, FieldMemOperand(scratch1, offset));
497 } else {
498 __ Str(value_reg, FieldMemOperand(scratch1, offset));
499 }
500 491
501 if (!representation.IsSmi()) { 492 if (!representation.IsSmi()) {
502 // Update the write barrier for the array address. 493 // Update the write barrier for the array address.
503 if (!representation.IsDouble()) { 494 if (!representation.IsDouble()) {
504 __ Mov(storage_reg, value_reg); 495 __ Mov(storage_reg, value_reg);
505 } 496 }
506 __ RecordWriteField(scratch1, 497 __ RecordWriteField(scratch1,
507 offset, 498 offset,
508 storage_reg, 499 storage_reg,
509 receiver_reg, 500 receiver_reg,
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 1490
1500 // Miss case, call the runtime. 1491 // Miss case, call the runtime.
1501 __ Bind(&miss); 1492 __ Bind(&miss);
1502 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1493 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1503 } 1494 }
1504 1495
1505 1496
1506 } } // namespace v8::internal 1497 } } // namespace v8::internal
1507 1498
1508 #endif // V8_TARGET_ARCH_A64 1499 #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