OLD | NEW |
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 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 ObjectLiteral::Property* property = lit->properties()->at(i); | 2271 ObjectLiteral::Property* property = lit->properties()->at(i); |
2272 Expression* value = property->value(); | 2272 Expression* value = property->value(); |
2273 | 2273 |
2274 if (property->is_static()) { | 2274 if (property->is_static()) { |
2275 __ Peek(scratch, kPointerSize); // constructor | 2275 __ Peek(scratch, kPointerSize); // constructor |
2276 } else { | 2276 } else { |
2277 __ Peek(scratch, 0); // prototype | 2277 __ Peek(scratch, 0); // prototype |
2278 } | 2278 } |
2279 __ Push(scratch); | 2279 __ Push(scratch); |
2280 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 2280 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
| 2281 |
| 2282 // The static prototype property is read only. We handle the non computed |
| 2283 // property name case in the parser. Since this is the only case where we |
| 2284 // need to check for an own read only property we special case this so we do |
| 2285 // not need to do this for every property. |
| 2286 if (property->is_static() && property->is_computed_name()) { |
| 2287 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1); |
| 2288 __ Push(x0); |
| 2289 } |
| 2290 |
2281 VisitForStackValue(value); | 2291 VisitForStackValue(value); |
2282 EmitSetHomeObjectIfNeeded(value, 2); | 2292 EmitSetHomeObjectIfNeeded(value, 2); |
2283 | 2293 |
2284 switch (property->kind()) { | 2294 switch (property->kind()) { |
2285 case ObjectLiteral::Property::CONSTANT: | 2295 case ObjectLiteral::Property::CONSTANT: |
2286 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2296 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
2287 case ObjectLiteral::Property::PROTOTYPE: | 2297 case ObjectLiteral::Property::PROTOTYPE: |
2288 UNREACHABLE(); | 2298 UNREACHABLE(); |
2289 case ObjectLiteral::Property::COMPUTED: | 2299 case ObjectLiteral::Property::COMPUTED: |
2290 __ CallRuntime(Runtime::kDefineClassMethod, 3); | 2300 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
(...skipping 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5505 return previous_; | 5515 return previous_; |
5506 } | 5516 } |
5507 | 5517 |
5508 | 5518 |
5509 #undef __ | 5519 #undef __ |
5510 | 5520 |
5511 | 5521 |
5512 } } // namespace v8::internal | 5522 } } // namespace v8::internal |
5513 | 5523 |
5514 #endif // V8_TARGET_ARCH_ARM64 | 5524 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |