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

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

Issue 1626423003: Support computed properties for ES2015 Function.name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Mostly working Created 4 years, 10 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
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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 if (NeedsHomeObject(value)) { 1584 if (NeedsHomeObject(value)) {
1585 EmitSetHomeObject(value, 2, property->GetSlot()); 1585 EmitSetHomeObject(value, 2, property->GetSlot());
1586 } 1586 }
1587 1587
1588 switch (property->kind()) { 1588 switch (property->kind()) {
1589 case ObjectLiteral::Property::CONSTANT: 1589 case ObjectLiteral::Property::CONSTANT:
1590 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 1590 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1591 case ObjectLiteral::Property::COMPUTED: 1591 case ObjectLiteral::Property::COMPUTED:
1592 if (property->emit_store()) { 1592 if (property->emit_store()) {
1593 __ Push(Smi::FromInt(NONE)); 1593 __ Push(Smi::FromInt(NONE));
1594 __ CallRuntime(Runtime::kDefineDataPropertyUnchecked); 1594 __ Push(Smi::FromInt(property->NeedsSetFunctionName()));
1595 __ CallRuntime(Runtime::kDefineDataPropertyInLiteral);
1595 } else { 1596 } else {
1596 __ Drop(3); 1597 __ Drop(3);
1597 } 1598 }
1598 break; 1599 break;
1599 1600
1600 case ObjectLiteral::Property::PROTOTYPE: 1601 case ObjectLiteral::Property::PROTOTYPE:
1601 UNREACHABLE(); 1602 UNREACHABLE();
1602 break; 1603 break;
1603 1604
1604 case ObjectLiteral::Property::GETTER: 1605 case ObjectLiteral::Property::GETTER:
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 if (NeedsHomeObject(value)) { 2273 if (NeedsHomeObject(value)) {
2273 EmitSetHomeObject(value, 2, property->GetSlot()); 2274 EmitSetHomeObject(value, 2, property->GetSlot());
2274 } 2275 }
2275 2276
2276 switch (property->kind()) { 2277 switch (property->kind()) {
2277 case ObjectLiteral::Property::CONSTANT: 2278 case ObjectLiteral::Property::CONSTANT:
2278 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2279 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2279 case ObjectLiteral::Property::PROTOTYPE: 2280 case ObjectLiteral::Property::PROTOTYPE:
2280 UNREACHABLE(); 2281 UNREACHABLE();
2281 case ObjectLiteral::Property::COMPUTED: 2282 case ObjectLiteral::Property::COMPUTED:
2282 __ CallRuntime(Runtime::kDefineClassMethod); 2283 __ Push(Smi::FromInt(DONT_ENUM));
2284 __ Push(Smi::FromInt(property->NeedsSetFunctionName()));
2285 __ CallRuntime(Runtime::kDefineDataPropertyInLiteral);
2283 break; 2286 break;
2284 2287
2285 case ObjectLiteral::Property::GETTER: 2288 case ObjectLiteral::Property::GETTER:
2286 __ Push(Smi::FromInt(DONT_ENUM)); 2289 __ Push(Smi::FromInt(DONT_ENUM));
2287 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked); 2290 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked);
2288 break; 2291 break;
2289 2292
2290 case ObjectLiteral::Property::SETTER: 2293 case ObjectLiteral::Property::SETTER:
2291 __ Push(Smi::FromInt(DONT_ENUM)); 2294 __ Push(Smi::FromInt(DONT_ENUM));
2292 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); 2295 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked);
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
4713 Assembler::target_address_at(call_target_address, 4716 Assembler::target_address_at(call_target_address,
4714 unoptimized_code)); 4717 unoptimized_code));
4715 return OSR_AFTER_STACK_CHECK; 4718 return OSR_AFTER_STACK_CHECK;
4716 } 4719 }
4717 4720
4718 4721
4719 } // namespace internal 4722 } // namespace internal
4720 } // namespace v8 4723 } // namespace v8
4721 4724
4722 #endif // V8_TARGET_ARCH_X64 4725 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698