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

Side by Side Diff: src/arm64/full-codegen-arm64.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 remaining code review issues 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 | « src/arm/full-codegen-arm.cc ('k') | src/ast.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1365
1366 __ Mov(x10, Operand(isolate()->factory()->undefined_value())); 1366 __ Mov(x10, Operand(isolate()->factory()->undefined_value()));
1367 __ cmp(x0, x10); 1367 __ cmp(x0, x10);
1368 Label done; 1368 Label done;
1369 __ b(&done, ne); 1369 __ b(&done, ne);
1370 __ CallRuntime(Runtime::kThrowNonMethodError, 0); 1370 __ CallRuntime(Runtime::kThrowNonMethodError, 0);
1371 __ bind(&done); 1371 __ bind(&done);
1372 } 1372 }
1373 1373
1374 1374
1375 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer,
1376 int offset) {
1377 if (NeedsHomeObject(initializer)) {
1378 __ Peek(StoreDescriptor::ReceiverRegister(), 0);
1379 __ Mov(StoreDescriptor::NameRegister(),
1380 Operand(isolate()->factory()->home_object_symbol()));
1381 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize);
1382 CallStoreIC();
1383 }
1384 }
1385
1386
1375 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, 1387 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
1376 TypeofState typeof_state, 1388 TypeofState typeof_state,
1377 Label* slow) { 1389 Label* slow) {
1378 Register current = cp; 1390 Register current = cp;
1379 Register next = x10; 1391 Register next = x10;
1380 Register temp = x11; 1392 Register temp = x11;
1381 1393
1382 Scope* s = scope(); 1394 Scope* s = scope();
1383 while (s != NULL) { 1395 while (s != NULL) {
1384 if (s->num_heap_slots() > 0) { 1396 if (s->num_heap_slots() > 0) {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 // It is safe to use [[Put]] here because the boilerplate already 1726 // It is safe to use [[Put]] here because the boilerplate already
1715 // contains computed properties with an uninitialized value. 1727 // contains computed properties with an uninitialized value.
1716 if (key->value()->IsInternalizedString()) { 1728 if (key->value()->IsInternalizedString()) {
1717 if (property->emit_store()) { 1729 if (property->emit_store()) {
1718 VisitForAccumulatorValue(value); 1730 VisitForAccumulatorValue(value);
1719 DCHECK(StoreDescriptor::ValueRegister().is(x0)); 1731 DCHECK(StoreDescriptor::ValueRegister().is(x0));
1720 __ Mov(StoreDescriptor::NameRegister(), Operand(key->value())); 1732 __ Mov(StoreDescriptor::NameRegister(), Operand(key->value()));
1721 __ Peek(StoreDescriptor::ReceiverRegister(), 0); 1733 __ Peek(StoreDescriptor::ReceiverRegister(), 0);
1722 CallStoreIC(key->LiteralFeedbackId()); 1734 CallStoreIC(key->LiteralFeedbackId());
1723 PrepareForBailoutForId(key->id(), NO_REGISTERS); 1735 PrepareForBailoutForId(key->id(), NO_REGISTERS);
1736
1737 if (NeedsHomeObject(value)) {
1738 __ Mov(StoreDescriptor::ReceiverRegister(), x0);
1739 __ Mov(StoreDescriptor::NameRegister(),
1740 Operand(isolate()->factory()->home_object_symbol()));
1741 __ Peek(StoreDescriptor::ValueRegister(), 0);
1742 CallStoreIC();
1743 }
1724 } else { 1744 } else {
1725 VisitForEffect(value); 1745 VisitForEffect(value);
1726 } 1746 }
1727 break; 1747 break;
1728 } 1748 }
1729 if (property->emit_store()) { 1749 if (property->emit_store()) {
1730 // Duplicate receiver on stack. 1750 // Duplicate receiver on stack.
1731 __ Peek(x0, 0); 1751 __ Peek(x0, 0);
1732 __ Push(x0); 1752 __ Push(x0);
1733 VisitForStackValue(key); 1753 VisitForStackValue(key);
1734 VisitForStackValue(value); 1754 VisitForStackValue(value);
1755 EmitSetHomeObjectIfNeeded(value, 2);
1735 __ Mov(x0, Smi::FromInt(SLOPPY)); // Strict mode 1756 __ Mov(x0, Smi::FromInt(SLOPPY)); // Strict mode
1736 __ Push(x0); 1757 __ Push(x0);
1737 __ CallRuntime(Runtime::kSetProperty, 4); 1758 __ CallRuntime(Runtime::kSetProperty, 4);
1738 } else { 1759 } else {
1739 VisitForEffect(key); 1760 VisitForEffect(key);
1740 VisitForEffect(value); 1761 VisitForEffect(value);
1741 } 1762 }
1742 break; 1763 break;
1743 case ObjectLiteral::Property::PROTOTYPE: 1764 case ObjectLiteral::Property::PROTOTYPE:
1744 if (property->emit_store()) { 1765 if (property->emit_store()) {
(...skipping 17 matching lines...) Expand all
1762 1783
1763 // Emit code to define accessors, using only a single call to the runtime for 1784 // Emit code to define accessors, using only a single call to the runtime for
1764 // each pair of corresponding getters and setters. 1785 // each pair of corresponding getters and setters.
1765 for (AccessorTable::Iterator it = accessor_table.begin(); 1786 for (AccessorTable::Iterator it = accessor_table.begin();
1766 it != accessor_table.end(); 1787 it != accessor_table.end();
1767 ++it) { 1788 ++it) {
1768 __ Peek(x10, 0); // Duplicate receiver. 1789 __ Peek(x10, 0); // Duplicate receiver.
1769 __ Push(x10); 1790 __ Push(x10);
1770 VisitForStackValue(it->first); 1791 VisitForStackValue(it->first);
1771 EmitAccessor(it->second->getter); 1792 EmitAccessor(it->second->getter);
1793 EmitSetHomeObjectIfNeeded(it->second->getter, 2);
1772 EmitAccessor(it->second->setter); 1794 EmitAccessor(it->second->setter);
1795 EmitSetHomeObjectIfNeeded(it->second->setter, 3);
1773 __ Mov(x10, Smi::FromInt(NONE)); 1796 __ Mov(x10, Smi::FromInt(NONE));
1774 __ Push(x10); 1797 __ Push(x10);
1775 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); 1798 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
1776 } 1799 }
1777 1800
1778 if (expr->has_function()) { 1801 if (expr->has_function()) {
1779 DCHECK(result_saved); 1802 DCHECK(result_saved);
1780 __ Peek(x0, 0); 1803 __ Peek(x0, 0);
1781 __ Push(x0); 1804 __ Push(x0);
1782 __ CallRuntime(Runtime::kToFastProperties, 1); 1805 __ CallRuntime(Runtime::kToFastProperties, 1);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 DCHECK(key != NULL); 2219 DCHECK(key != NULL);
2197 2220
2198 if (property->is_static()) { 2221 if (property->is_static()) {
2199 __ Peek(scratch, kPointerSize); // constructor 2222 __ Peek(scratch, kPointerSize); // constructor
2200 } else { 2223 } else {
2201 __ Peek(scratch, 0); // prototype 2224 __ Peek(scratch, 0); // prototype
2202 } 2225 }
2203 __ Push(scratch); 2226 __ Push(scratch);
2204 VisitForStackValue(key); 2227 VisitForStackValue(key);
2205 VisitForStackValue(value); 2228 VisitForStackValue(value);
2229 EmitSetHomeObjectIfNeeded(value, 2);
2206 2230
2207 switch (property->kind()) { 2231 switch (property->kind()) {
2208 case ObjectLiteral::Property::CONSTANT: 2232 case ObjectLiteral::Property::CONSTANT:
2209 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2233 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2210 case ObjectLiteral::Property::COMPUTED: 2234 case ObjectLiteral::Property::COMPUTED:
2211 case ObjectLiteral::Property::PROTOTYPE: 2235 case ObjectLiteral::Property::PROTOTYPE:
2212 __ CallRuntime(Runtime::kDefineClassMethod, 3); 2236 __ CallRuntime(Runtime::kDefineClassMethod, 3);
2213 break; 2237 break;
2214 2238
2215 case ObjectLiteral::Property::GETTER: 2239 case ObjectLiteral::Property::GETTER:
(...skipping 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after
5323 return previous_; 5347 return previous_;
5324 } 5348 }
5325 5349
5326 5350
5327 #undef __ 5351 #undef __
5328 5352
5329 5353
5330 } } // namespace v8::internal 5354 } } // namespace v8::internal
5331 5355
5332 #endif // V8_TARGET_ARCH_ARM64 5356 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698