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

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

Issue 718473002: ES6: Add support for super in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix code review comments Created 6 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/arm64/full-codegen-arm64.cc » ('j') | src/arm64/full-codegen-arm64.cc » ('J')
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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 } 1376 }
1377 1377
1378 __ cmp(r0, Operand(isolate()->factory()->undefined_value())); 1378 __ cmp(r0, Operand(isolate()->factory()->undefined_value()));
1379 Label done; 1379 Label done;
1380 __ b(ne, &done); 1380 __ b(ne, &done);
1381 __ CallRuntime(Runtime::kThrowNonMethodError, 0); 1381 __ CallRuntime(Runtime::kThrowNonMethodError, 0);
1382 __ bind(&done); 1382 __ bind(&done);
1383 } 1383 }
1384 1384
1385 1385
1386 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer,
1387 int offset) {
1388 if (NeedsHomeObject(initializer)) {
1389 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp));
1390 __ mov(StoreDescriptor::NameRegister(),
1391 Operand(isolate()->factory()->home_object_symbol()));
1392 __ ldr(StoreDescriptor::ValueRegister(),
1393 MemOperand(sp, offset * kPointerSize));
1394 CallStoreIC();
1395 }
1396 }
1397
1398
1386 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, 1399 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
1387 TypeofState typeof_state, 1400 TypeofState typeof_state,
1388 Label* slow) { 1401 Label* slow) {
1389 Register current = cp; 1402 Register current = cp;
1390 Register next = r1; 1403 Register next = r1;
1391 Register temp = r2; 1404 Register temp = r2;
1392 1405
1393 Scope* s = scope(); 1406 Scope* s = scope();
1394 while (s != NULL) { 1407 while (s != NULL) {
1395 if (s->num_heap_slots() > 0) { 1408 if (s->num_heap_slots() > 0) {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 // It is safe to use [[Put]] here because the boilerplate already 1745 // It is safe to use [[Put]] here because the boilerplate already
1733 // contains computed properties with an uninitialized value. 1746 // contains computed properties with an uninitialized value.
1734 if (key->value()->IsInternalizedString()) { 1747 if (key->value()->IsInternalizedString()) {
1735 if (property->emit_store()) { 1748 if (property->emit_store()) {
1736 VisitForAccumulatorValue(value); 1749 VisitForAccumulatorValue(value);
1737 DCHECK(StoreDescriptor::ValueRegister().is(r0)); 1750 DCHECK(StoreDescriptor::ValueRegister().is(r0));
1738 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); 1751 __ mov(StoreDescriptor::NameRegister(), Operand(key->value()));
1739 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); 1752 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp));
1740 CallStoreIC(key->LiteralFeedbackId()); 1753 CallStoreIC(key->LiteralFeedbackId());
1741 PrepareForBailoutForId(key->id(), NO_REGISTERS); 1754 PrepareForBailoutForId(key->id(), NO_REGISTERS);
1755
1756 if (value != NULL && value->IsFunctionLiteral() &&
Dmitry Lomov (no reviews) 2014/11/11 19:27:47 Use NeedsHomeObject here
arv (Not doing code reviews) 2014/11/11 19:51:29 Done.
1757 value->AsFunctionLiteral()->needs_super_binding()) {
1758 __ Move(StoreDescriptor::ReceiverRegister(), r0);
1759 __ mov(StoreDescriptor::NameRegister(),
1760 Operand(isolate()->factory()->home_object_symbol()));
1761 __ ldr(StoreDescriptor::ValueRegister(), MemOperand(sp));
1762 CallStoreIC();
1763 }
1742 } else { 1764 } else {
1743 VisitForEffect(value); 1765 VisitForEffect(value);
1744 } 1766 }
1745 break; 1767 break;
1746 } 1768 }
1747 // Duplicate receiver on stack. 1769 // Duplicate receiver on stack.
1748 __ ldr(r0, MemOperand(sp)); 1770 __ ldr(r0, MemOperand(sp));
1749 __ push(r0); 1771 __ push(r0);
1750 VisitForStackValue(key); 1772 VisitForStackValue(key);
1751 VisitForStackValue(value); 1773 VisitForStackValue(value);
1752 if (property->emit_store()) { 1774 if (property->emit_store()) {
1775 EmitSetHomeObjectIfNeeded(value, 2);
1753 __ mov(r0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes 1776 __ mov(r0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes
1754 __ push(r0); 1777 __ push(r0);
1755 __ CallRuntime(Runtime::kSetProperty, 4); 1778 __ CallRuntime(Runtime::kSetProperty, 4);
1756 } else { 1779 } else {
1757 __ Drop(3); 1780 __ Drop(3);
1758 } 1781 }
1759 break; 1782 break;
1760 case ObjectLiteral::Property::PROTOTYPE: 1783 case ObjectLiteral::Property::PROTOTYPE:
1761 // Duplicate receiver on stack. 1784 // Duplicate receiver on stack.
1762 __ ldr(r0, MemOperand(sp)); 1785 __ ldr(r0, MemOperand(sp));
(...skipping 17 matching lines...) Expand all
1780 1803
1781 // Emit code to define accessors, using only a single call to the runtime for 1804 // Emit code to define accessors, using only a single call to the runtime for
1782 // each pair of corresponding getters and setters. 1805 // each pair of corresponding getters and setters.
1783 for (AccessorTable::Iterator it = accessor_table.begin(); 1806 for (AccessorTable::Iterator it = accessor_table.begin();
1784 it != accessor_table.end(); 1807 it != accessor_table.end();
1785 ++it) { 1808 ++it) {
1786 __ ldr(r0, MemOperand(sp)); // Duplicate receiver. 1809 __ ldr(r0, MemOperand(sp)); // Duplicate receiver.
1787 __ push(r0); 1810 __ push(r0);
1788 VisitForStackValue(it->first); 1811 VisitForStackValue(it->first);
1789 EmitAccessor(it->second->getter); 1812 EmitAccessor(it->second->getter);
1813 EmitSetHomeObjectIfNeeded(it->second->getter, 2);
1790 EmitAccessor(it->second->setter); 1814 EmitAccessor(it->second->setter);
1815 EmitSetHomeObjectIfNeeded(it->second->setter, 3);
1791 __ mov(r0, Operand(Smi::FromInt(NONE))); 1816 __ mov(r0, Operand(Smi::FromInt(NONE)));
1792 __ push(r0); 1817 __ push(r0);
1793 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); 1818 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
1794 } 1819 }
1795 1820
1796 if (expr->has_function()) { 1821 if (expr->has_function()) {
1797 DCHECK(result_saved); 1822 DCHECK(result_saved);
1798 __ ldr(r0, MemOperand(sp)); 1823 __ ldr(r0, MemOperand(sp));
1799 __ push(r0); 1824 __ push(r0);
1800 __ CallRuntime(Runtime::kToFastProperties, 1); 1825 __ CallRuntime(Runtime::kToFastProperties, 1);
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 DCHECK(key != NULL); 2552 DCHECK(key != NULL);
2528 2553
2529 if (property->is_static()) { 2554 if (property->is_static()) {
2530 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor 2555 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor
2531 } else { 2556 } else {
2532 __ ldr(scratch, MemOperand(sp, 0)); // prototype 2557 __ ldr(scratch, MemOperand(sp, 0)); // prototype
2533 } 2558 }
2534 __ push(scratch); 2559 __ push(scratch);
2535 VisitForStackValue(key); 2560 VisitForStackValue(key);
2536 VisitForStackValue(value); 2561 VisitForStackValue(value);
2562 EmitSetHomeObjectIfNeeded(value, 2);
2537 2563
2538 switch (property->kind()) { 2564 switch (property->kind()) {
2539 case ObjectLiteral::Property::CONSTANT: 2565 case ObjectLiteral::Property::CONSTANT:
2540 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2566 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2541 case ObjectLiteral::Property::COMPUTED: 2567 case ObjectLiteral::Property::COMPUTED:
2542 case ObjectLiteral::Property::PROTOTYPE: 2568 case ObjectLiteral::Property::PROTOTYPE:
2543 __ CallRuntime(Runtime::kDefineClassMethod, 3); 2569 __ CallRuntime(Runtime::kDefineClassMethod, 3);
2544 break; 2570 break;
2545 2571
2546 case ObjectLiteral::Property::GETTER: 2572 case ObjectLiteral::Property::GETTER:
(...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after
5341 5367
5342 DCHECK(interrupt_address == 5368 DCHECK(interrupt_address ==
5343 isolate->builtins()->OsrAfterStackCheck()->entry()); 5369 isolate->builtins()->OsrAfterStackCheck()->entry());
5344 return OSR_AFTER_STACK_CHECK; 5370 return OSR_AFTER_STACK_CHECK;
5345 } 5371 }
5346 5372
5347 5373
5348 } } // namespace v8::internal 5374 } } // namespace v8::internal
5349 5375
5350 #endif // V8_TARGET_ARCH_ARM 5376 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | src/arm64/full-codegen-arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698