OLD | NEW |
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 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2471 case ObjectLiteral::Property::SETTER: | 2471 case ObjectLiteral::Property::SETTER: |
2472 __ Push(Smi::FromInt(DONT_ENUM)); | 2472 __ Push(Smi::FromInt(DONT_ENUM)); |
2473 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); | 2473 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); |
2474 break; | 2474 break; |
2475 | 2475 |
2476 default: | 2476 default: |
2477 UNREACHABLE(); | 2477 UNREACHABLE(); |
2478 } | 2478 } |
2479 } | 2479 } |
2480 | 2480 |
2481 // prototype | 2481 // Set both the prototype and constructor to have fast properties, and also |
2482 __ CallRuntime(Runtime::kToFastProperties, 1); | 2482 // freeze them in strong mode. |
2483 | 2483 __ CallRuntime(is_strong(language_mode()) |
2484 // constructor | 2484 ? Runtime::kFinalizeClassDefinitionStrong |
2485 __ CallRuntime(Runtime::kToFastProperties, 1); | 2485 : Runtime::kFinalizeClassDefinition, |
2486 | 2486 2); |
2487 if (is_strong(language_mode())) { | |
2488 __ movp(scratch, | |
2489 FieldOperand(rax, JSFunction::kPrototypeOrInitialMapOffset)); | |
2490 __ Push(rax); | |
2491 __ Push(scratch); | |
2492 // TODO(conradw): It would be more efficient to define the properties with | |
2493 // the right attributes the first time round. | |
2494 // Freeze the prototype. | |
2495 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
2496 // Freeze the constructor. | |
2497 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
2498 } | |
2499 } | 2487 } |
2500 | 2488 |
2501 | 2489 |
2502 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2490 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2503 __ Pop(rdx); | 2491 __ Pop(rdx); |
2504 Handle<Code> code = | 2492 Handle<Code> code = |
2505 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2493 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2506 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2494 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2507 CallIC(code, expr->BinaryOperationFeedbackId()); | 2495 CallIC(code, expr->BinaryOperationFeedbackId()); |
2508 patch_site.EmitPatchInfo(); | 2496 patch_site.EmitPatchInfo(); |
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5360 Assembler::target_address_at(call_target_address, | 5348 Assembler::target_address_at(call_target_address, |
5361 unoptimized_code)); | 5349 unoptimized_code)); |
5362 return OSR_AFTER_STACK_CHECK; | 5350 return OSR_AFTER_STACK_CHECK; |
5363 } | 5351 } |
5364 | 5352 |
5365 | 5353 |
5366 } // namespace internal | 5354 } // namespace internal |
5367 } // namespace v8 | 5355 } // namespace v8 |
5368 | 5356 |
5369 #endif // V8_TARGET_ARCH_X64 | 5357 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |