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

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

Issue 985643003: [es6] Throw TypeError for computed static prototype property name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Inline BuildThrowStaticPrototype Created 5 years, 9 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/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/computed-property-names-classes.js » ('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 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 for (int i = 0; i < lit->properties()->length(); i++) { 2488 for (int i = 0; i < lit->properties()->length(); i++) {
2489 ObjectLiteral::Property* property = lit->properties()->at(i); 2489 ObjectLiteral::Property* property = lit->properties()->at(i);
2490 Expression* value = property->value(); 2490 Expression* value = property->value();
2491 2491
2492 if (property->is_static()) { 2492 if (property->is_static()) {
2493 __ Push(Operand(rsp, kPointerSize)); // constructor 2493 __ Push(Operand(rsp, kPointerSize)); // constructor
2494 } else { 2494 } else {
2495 __ Push(Operand(rsp, 0)); // prototype 2495 __ Push(Operand(rsp, 0)); // prototype
2496 } 2496 }
2497 EmitPropertyKey(property, lit->GetIdForProperty(i)); 2497 EmitPropertyKey(property, lit->GetIdForProperty(i));
2498
2499 // The static prototype property is read only. We handle the non computed
2500 // property name case in the parser. Since this is the only case where we
2501 // need to check for an own read only property we special case this so we do
2502 // not need to do this for every property.
2503 if (property->is_static() && property->is_computed_name()) {
2504 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1);
2505 __ Push(rax);
2506 }
2507
2498 VisitForStackValue(value); 2508 VisitForStackValue(value);
2499 EmitSetHomeObjectIfNeeded(value, 2); 2509 EmitSetHomeObjectIfNeeded(value, 2);
2500 2510
2501 switch (property->kind()) { 2511 switch (property->kind()) {
2502 case ObjectLiteral::Property::CONSTANT: 2512 case ObjectLiteral::Property::CONSTANT:
2503 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2513 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2504 case ObjectLiteral::Property::PROTOTYPE: 2514 case ObjectLiteral::Property::PROTOTYPE:
2505 UNREACHABLE(); 2515 UNREACHABLE();
2506 case ObjectLiteral::Property::COMPUTED: 2516 case ObjectLiteral::Property::COMPUTED:
2507 __ CallRuntime(Runtime::kDefineClassMethod, 3); 2517 __ CallRuntime(Runtime::kDefineClassMethod, 3);
(...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after
5406 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5416 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5407 Assembler::target_address_at(call_target_address, 5417 Assembler::target_address_at(call_target_address,
5408 unoptimized_code)); 5418 unoptimized_code));
5409 return OSR_AFTER_STACK_CHECK; 5419 return OSR_AFTER_STACK_CHECK;
5410 } 5420 }
5411 5421
5412 5422
5413 } } // namespace v8::internal 5423 } } // namespace v8::internal
5414 5424
5415 #endif // V8_TARGET_ARCH_X64 5425 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/computed-property-names-classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698