OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 continue; | 1448 continue; |
1449 } | 1449 } |
1450 | 1450 |
1451 if (!result_saved) { | 1451 if (!result_saved) { |
1452 __ push(rax); | 1452 __ push(rax); |
1453 result_saved = true; | 1453 result_saved = true; |
1454 } | 1454 } |
1455 VisitForAccumulatorValue(subexpr); | 1455 VisitForAccumulatorValue(subexpr); |
1456 | 1456 |
1457 // Store the subexpression value in the array's elements. | 1457 // Store the subexpression value in the array's elements. |
1458 __ movq(rbx, Operand(rsp, 0)); // Copy of array literal. | 1458 __ movq(r8, Operand(rsp, 0)); // Copy of array literal. |
1459 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); | 1459 __ movq(rbx, FieldOperand(r8, JSObject::kElementsOffset)); |
1460 int offset = FixedArray::kHeaderSize + (i * kPointerSize); | 1460 int offset = FixedArray::kHeaderSize + (i * kPointerSize); |
1461 __ movq(FieldOperand(rbx, offset), result_register()); | 1461 __ movq(FieldOperand(rbx, offset), result_register()); |
1462 | 1462 |
| 1463 Label no_map_change; |
| 1464 __ JumpIfSmi(result_register(), &no_map_change); |
1463 // Update the write barrier for the array store. | 1465 // Update the write barrier for the array store. |
1464 __ RecordWriteField(rbx, offset, result_register(), rcx, kDontSaveFPRegs); | 1466 __ RecordWriteField(rbx, offset, result_register(), rcx, |
| 1467 kDontSaveFPRegs, |
| 1468 EMIT_REMEMBERED_SET, |
| 1469 OMIT_SMI_CHECK); |
| 1470 if (FLAG_smi_only_arrays) { |
| 1471 __ movq(rdi, FieldOperand(rbx, JSObject::kMapOffset)); |
| 1472 __ CheckFastSmiOnlyElements(rdi, &no_map_change, Label::kNear); |
| 1473 __ push(r8); |
| 1474 __ CallRuntime(Runtime::kNonSmiElementStored, 1); |
| 1475 } |
| 1476 __ bind(&no_map_change); |
1465 | 1477 |
1466 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); | 1478 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); |
1467 } | 1479 } |
1468 | 1480 |
1469 if (result_saved) { | 1481 if (result_saved) { |
1470 context()->PlugTOS(); | 1482 context()->PlugTOS(); |
1471 } else { | 1483 } else { |
1472 context()->Plug(rax); | 1484 context()->Plug(rax); |
1473 } | 1485 } |
1474 } | 1486 } |
(...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4184 *context_length = 0; | 4196 *context_length = 0; |
4185 return previous_; | 4197 return previous_; |
4186 } | 4198 } |
4187 | 4199 |
4188 | 4200 |
4189 #undef __ | 4201 #undef __ |
4190 | 4202 |
4191 } } // namespace v8::internal | 4203 } } // namespace v8::internal |
4192 | 4204 |
4193 #endif // V8_TARGET_ARCH_X64 | 4205 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |