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

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

Issue 873823003: Move object literal checking into checker classes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix assert Created 5 years, 11 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
« no previous file with comments | « src/preparser.cc ('k') | src/x87/full-codegen-x87.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 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_X64 7 #if V8_TARGET_ARCH_X64
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 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 EmitSetHomeObjectIfNeeded(value, 2); 1700 EmitSetHomeObjectIfNeeded(value, 2);
1701 __ Push(Smi::FromInt(SLOPPY)); // Strict mode 1701 __ Push(Smi::FromInt(SLOPPY)); // Strict mode
1702 __ CallRuntime(Runtime::kSetProperty, 4); 1702 __ CallRuntime(Runtime::kSetProperty, 4);
1703 } else { 1703 } else {
1704 __ Drop(3); 1704 __ Drop(3);
1705 } 1705 }
1706 break; 1706 break;
1707 case ObjectLiteral::Property::PROTOTYPE: 1707 case ObjectLiteral::Property::PROTOTYPE:
1708 __ Push(Operand(rsp, 0)); // Duplicate receiver. 1708 __ Push(Operand(rsp, 0)); // Duplicate receiver.
1709 VisitForStackValue(value); 1709 VisitForStackValue(value);
1710 if (property->emit_store()) { 1710 DCHECK(property->emit_store());
1711 __ CallRuntime(Runtime::kInternalSetPrototype, 2); 1711 __ CallRuntime(Runtime::kInternalSetPrototype, 2);
1712 } else {
1713 __ Drop(2);
1714 }
1715 break; 1712 break;
1716 case ObjectLiteral::Property::GETTER: 1713 case ObjectLiteral::Property::GETTER:
1717 accessor_table.lookup(key)->second->getter = value; 1714 accessor_table.lookup(key)->second->getter = value;
1718 break; 1715 break;
1719 case ObjectLiteral::Property::SETTER: 1716 case ObjectLiteral::Property::SETTER:
1720 accessor_table.lookup(key)->second->setter = value; 1717 accessor_table.lookup(key)->second->setter = value;
1721 break; 1718 break;
1722 } 1719 }
1723 } 1720 }
1724 1721
(...skipping 28 matching lines...) Expand all
1753 if (!result_saved) { 1750 if (!result_saved) {
1754 __ Push(rax); // Save result on the stack 1751 __ Push(rax); // Save result on the stack
1755 result_saved = true; 1752 result_saved = true;
1756 } 1753 }
1757 1754
1758 __ Push(Operand(rsp, 0)); // Duplicate receiver. 1755 __ Push(Operand(rsp, 0)); // Duplicate receiver.
1759 1756
1760 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { 1757 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) {
1761 DCHECK(!property->is_computed_name()); 1758 DCHECK(!property->is_computed_name());
1762 VisitForStackValue(value); 1759 VisitForStackValue(value);
1763 if (property->emit_store()) { 1760 DCHECK(property->emit_store());
1764 __ CallRuntime(Runtime::kInternalSetPrototype, 2); 1761 __ CallRuntime(Runtime::kInternalSetPrototype, 2);
1765 } else {
1766 __ Drop(2);
1767 }
1768 } else { 1762 } else {
1769 EmitPropertyKey(property); 1763 EmitPropertyKey(property);
1770 VisitForStackValue(value); 1764 VisitForStackValue(value);
1771 1765
1772 switch (property->kind()) { 1766 switch (property->kind()) {
1773 case ObjectLiteral::Property::CONSTANT: 1767 case ObjectLiteral::Property::CONSTANT:
1774 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 1768 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1775 case ObjectLiteral::Property::COMPUTED: 1769 case ObjectLiteral::Property::COMPUTED:
1776 if (property->emit_store()) { 1770 if (property->emit_store()) {
1777 __ Push(Smi::FromInt(NONE)); 1771 __ Push(Smi::FromInt(NONE));
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2462 } else { 2456 } else {
2463 __ Push(Operand(rsp, 0)); // prototype 2457 __ Push(Operand(rsp, 0)); // prototype
2464 } 2458 }
2465 EmitPropertyKey(property); 2459 EmitPropertyKey(property);
2466 VisitForStackValue(value); 2460 VisitForStackValue(value);
2467 EmitSetHomeObjectIfNeeded(value, 2); 2461 EmitSetHomeObjectIfNeeded(value, 2);
2468 2462
2469 switch (property->kind()) { 2463 switch (property->kind()) {
2470 case ObjectLiteral::Property::CONSTANT: 2464 case ObjectLiteral::Property::CONSTANT:
2471 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2465 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2466 case ObjectLiteral::Property::PROTOTYPE:
2467 UNREACHABLE();
2472 case ObjectLiteral::Property::COMPUTED: 2468 case ObjectLiteral::Property::COMPUTED:
2473 case ObjectLiteral::Property::PROTOTYPE:
2474 __ CallRuntime(Runtime::kDefineClassMethod, 3); 2469 __ CallRuntime(Runtime::kDefineClassMethod, 3);
2475 break; 2470 break;
2476 2471
2477 case ObjectLiteral::Property::GETTER: 2472 case ObjectLiteral::Property::GETTER:
2478 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 3); 2473 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 3);
2479 break; 2474 break;
2480 2475
2481 case ObjectLiteral::Property::SETTER: 2476 case ObjectLiteral::Property::SETTER:
2482 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 3); 2477 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 3);
2483 break; 2478 break;
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after
5302 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5297 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5303 Assembler::target_address_at(call_target_address, 5298 Assembler::target_address_at(call_target_address,
5304 unoptimized_code)); 5299 unoptimized_code));
5305 return OSR_AFTER_STACK_CHECK; 5300 return OSR_AFTER_STACK_CHECK;
5306 } 5301 }
5307 5302
5308 5303
5309 } } // namespace v8::internal 5304 } } // namespace v8::internal
5310 5305
5311 #endif // V8_TARGET_ARCH_X64 5306 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | src/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698