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 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 __ Mov(x0, Smi::FromInt(DONT_ENUM)); | 2261 __ Mov(x0, Smi::FromInt(DONT_ENUM)); |
2262 __ Push(x0); | 2262 __ Push(x0); |
2263 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); | 2263 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); |
2264 break; | 2264 break; |
2265 | 2265 |
2266 default: | 2266 default: |
2267 UNREACHABLE(); | 2267 UNREACHABLE(); |
2268 } | 2268 } |
2269 } | 2269 } |
2270 | 2270 |
2271 // prototype | 2271 // Set both the prototype and constructor to have fast properties, and also |
2272 __ CallRuntime(Runtime::kToFastProperties, 1); | 2272 // freeze them in strong mode. |
2273 | 2273 __ CallRuntime(is_strong(language_mode()) |
2274 // constructor | 2274 ? Runtime::kFinalizeClassDefinitionStrong |
2275 __ CallRuntime(Runtime::kToFastProperties, 1); | 2275 : Runtime::kFinalizeClassDefinition, |
2276 | 2276 2); |
2277 if (is_strong(language_mode())) { | |
2278 __ Ldr(scratch, | |
2279 FieldMemOperand(x0, JSFunction::kPrototypeOrInitialMapOffset)); | |
2280 __ push(x0); | |
2281 __ Push(scratch); | |
2282 // TODO(conradw): It would be more efficient to define the properties with | |
2283 // the right attributes the first time round. | |
2284 // Freeze the prototype. | |
2285 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
2286 // Freeze the constructor. | |
2287 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
2288 } | |
2289 } | 2277 } |
2290 | 2278 |
2291 | 2279 |
2292 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2280 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2293 FeedbackVectorICSlot slot) { | 2281 FeedbackVectorICSlot slot) { |
2294 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2282 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
2295 | 2283 |
2296 Property* prop = expr->AsProperty(); | 2284 Property* prop = expr->AsProperty(); |
2297 LhsKind assign_type = Property::GetAssignType(prop); | 2285 LhsKind assign_type = Property::GetAssignType(prop); |
2298 | 2286 |
(...skipping 3154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5453 } | 5441 } |
5454 | 5442 |
5455 return INTERRUPT; | 5443 return INTERRUPT; |
5456 } | 5444 } |
5457 | 5445 |
5458 | 5446 |
5459 } // namespace internal | 5447 } // namespace internal |
5460 } // namespace v8 | 5448 } // namespace v8 |
5461 | 5449 |
5462 #endif // V8_TARGET_ARCH_ARM64 | 5450 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |