OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
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 2559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2570 __ mov(r3, Operand(Smi::FromInt(DONT_ENUM))); | 2570 __ mov(r3, Operand(Smi::FromInt(DONT_ENUM))); |
2571 __ push(r3); | 2571 __ push(r3); |
2572 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); | 2572 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); |
2573 break; | 2573 break; |
2574 | 2574 |
2575 default: | 2575 default: |
2576 UNREACHABLE(); | 2576 UNREACHABLE(); |
2577 } | 2577 } |
2578 } | 2578 } |
2579 | 2579 |
2580 // prototype | 2580 // Set both the prototype and constructor to have fast properties, and also |
2581 __ CallRuntime(Runtime::kToFastProperties, 1); | 2581 // freeze them in strong mode. |
2582 | 2582 __ CallRuntime(is_strong(language_mode()) |
2583 // constructor | 2583 ? Runtime::kFinalizeClassDefinitionStrong |
2584 __ CallRuntime(Runtime::kToFastProperties, 1); | 2584 : Runtime::kFinalizeClassDefinition, |
2585 | 2585 2); |
2586 if (is_strong(language_mode())) { | |
2587 __ LoadP(scratch, | |
2588 FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); | |
2589 __ Push(r3, scratch); | |
2590 // TODO(conradw): It would be more efficient to define the properties with | |
2591 // the right attributes the first time round. | |
2592 // Freeze the prototype. | |
2593 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
2594 // Freeze the constructor. | |
2595 __ CallRuntime(Runtime::kObjectFreeze, 1); | |
2596 } | |
2597 } | 2586 } |
2598 | 2587 |
2599 | 2588 |
2600 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2589 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2601 __ pop(r4); | 2590 __ pop(r4); |
2602 Handle<Code> code = | 2591 Handle<Code> code = |
2603 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2592 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2604 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2593 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2605 CallIC(code, expr->BinaryOperationFeedbackId()); | 2594 CallIC(code, expr->BinaryOperationFeedbackId()); |
2606 patch_site.EmitPatchInfo(); | 2595 patch_site.EmitPatchInfo(); |
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5423 return ON_STACK_REPLACEMENT; | 5412 return ON_STACK_REPLACEMENT; |
5424 } | 5413 } |
5425 | 5414 |
5426 DCHECK(interrupt_address == | 5415 DCHECK(interrupt_address == |
5427 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5416 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5428 return OSR_AFTER_STACK_CHECK; | 5417 return OSR_AFTER_STACK_CHECK; |
5429 } | 5418 } |
5430 } // namespace internal | 5419 } // namespace internal |
5431 } // namespace v8 | 5420 } // namespace v8 |
5432 #endif // V8_TARGET_ARCH_PPC | 5421 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |