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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 8472003: Reintroduce fast path in full-codegen for VisitArrayLiteral. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 | src/x64/full-codegen-x64.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 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 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 CompileTimeValue::IsCompileTimeValue(subexpr)) { 1526 CompileTimeValue::IsCompileTimeValue(subexpr)) {
1527 continue; 1527 continue;
1528 } 1528 }
1529 1529
1530 if (!result_saved) { 1530 if (!result_saved) {
1531 __ push(eax); 1531 __ push(eax);
1532 result_saved = true; 1532 result_saved = true;
1533 } 1533 }
1534 VisitForAccumulatorValue(subexpr); 1534 VisitForAccumulatorValue(subexpr);
1535 1535
1536 // Store the subexpression value in the array's elements. 1536 if (constant_elements_kind == FAST_ELEMENTS) {
1537 __ mov(ebx, Operand(esp, 0)); // Copy of array literal. 1537 // Fast-case array literal with ElementsKind of FAST_ELEMENTS, they cannot
1538 __ mov(edi, FieldOperand(ebx, JSObject::kMapOffset)); 1538 // transition and don't need to call the runtime stub.
1539 __ mov(ecx, Immediate(Smi::FromInt(i))); 1539 int offset = FixedArray::kHeaderSize + (i * kPointerSize);
1540 __ mov(edx, Immediate(Smi::FromInt(expr->literal_index()))); 1540 __ mov(ebx, Operand(esp, 0)); // Copy of array literal.
1541 StoreArrayLiteralElementStub stub; 1541 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset));
1542 __ CallStub(&stub); 1542 // Store the subexpression value in the array's elements.
1543 __ mov(FieldOperand(ebx, offset), result_register());
1544 // Update the write barrier for the array store.
1545 __ RecordWriteField(ebx, offset, result_register(), ecx,
1546 kDontSaveFPRegs,
1547 EMIT_REMEMBERED_SET,
1548 INLINE_SMI_CHECK);
1549 } else {
1550 // Store the subexpression value in the array's elements.
1551 __ mov(ebx, Operand(esp, 0)); // Copy of array literal.
1552 __ mov(edi, FieldOperand(ebx, JSObject::kMapOffset));
1553 __ mov(ecx, Immediate(Smi::FromInt(i)));
1554 __ mov(edx, Immediate(Smi::FromInt(expr->literal_index())));
1555 StoreArrayLiteralElementStub stub;
1556 __ CallStub(&stub);
1557 }
1543 1558
1544 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); 1559 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS);
1545 } 1560 }
1546 1561
1547 if (result_saved) { 1562 if (result_saved) {
1548 context()->PlugTOS(); 1563 context()->PlugTOS();
1549 } else { 1564 } else {
1550 context()->Plug(eax); 1565 context()->Plug(eax);
1551 } 1566 }
1552 } 1567 }
(...skipping 2795 matching lines...) Expand 10 before | Expand all | Expand 10 after
4348 *context_length = 0; 4363 *context_length = 0;
4349 return previous_; 4364 return previous_;
4350 } 4365 }
4351 4366
4352 4367
4353 #undef __ 4368 #undef __
4354 4369
4355 } } // namespace v8::internal 4370 } } // namespace v8::internal
4356 4371
4357 #endif // V8_TARGET_ARCH_IA32 4372 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698