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

Side by Side Diff: src/ia32/full-codegen-ia32.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/compiler/ast-graph-builder.cc ('k') | src/runtime/runtime.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 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_IA32 7 #if V8_TARGET_ARCH_IA32
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(esp, kPointerSize)); // constructor 2493 __ push(Operand(esp, kPointerSize)); // constructor
2494 } else { 2494 } else {
2495 __ push(Operand(esp, 0)); // prototype 2495 __ push(Operand(esp, 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(eax);
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 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after
5385 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5395 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5386 Assembler::target_address_at(call_target_address, 5396 Assembler::target_address_at(call_target_address,
5387 unoptimized_code)); 5397 unoptimized_code));
5388 return OSR_AFTER_STACK_CHECK; 5398 return OSR_AFTER_STACK_CHECK;
5389 } 5399 }
5390 5400
5391 5401
5392 } } // namespace v8::internal 5402 } } // namespace v8::internal
5393 5403
5394 #endif // V8_TARGET_ARCH_IA32 5404 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698