| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #if V8_TARGET_ARCH_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 6 | 6 |
| 7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
| 8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 __ XorP(right, left); | 1748 __ XorP(right, left); |
| 1749 break; | 1749 break; |
| 1750 default: | 1750 default: |
| 1751 UNREACHABLE(); | 1751 UNREACHABLE(); |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 __ bind(&done); | 1754 __ bind(&done); |
| 1755 context()->Plug(r2); | 1755 context()->Plug(r2); |
| 1756 } | 1756 } |
| 1757 | 1757 |
| 1758 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | |
| 1759 for (int i = 0; i < lit->properties()->length(); i++) { | |
| 1760 ClassLiteral::Property* property = lit->properties()->at(i); | |
| 1761 Expression* value = property->value(); | |
| 1762 | |
| 1763 Register scratch = r3; | |
| 1764 if (property->is_static()) { | |
| 1765 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | |
| 1766 } else { | |
| 1767 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | |
| 1768 } | |
| 1769 PushOperand(scratch); | |
| 1770 EmitPropertyKey(property, lit->GetIdForProperty(i)); | |
| 1771 | |
| 1772 // The static prototype property is read only. We handle the non computed | |
| 1773 // property name case in the parser. Since this is the only case where we | |
| 1774 // need to check for an own read only property we special case this so we do | |
| 1775 // not need to do this for every property. | |
| 1776 if (property->is_static() && property->is_computed_name()) { | |
| 1777 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | |
| 1778 __ push(r2); | |
| 1779 } | |
| 1780 | |
| 1781 VisitForStackValue(value); | |
| 1782 if (NeedsHomeObject(value)) { | |
| 1783 EmitSetHomeObject(value, 2, property->GetSlot()); | |
| 1784 } | |
| 1785 | |
| 1786 switch (property->kind()) { | |
| 1787 case ClassLiteral::Property::METHOD: | |
| 1788 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 1789 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | |
| 1790 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | |
| 1791 break; | |
| 1792 | |
| 1793 case ClassLiteral::Property::GETTER: | |
| 1794 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 1795 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | |
| 1796 break; | |
| 1797 | |
| 1798 case ClassLiteral::Property::SETTER: | |
| 1799 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 1800 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | |
| 1801 break; | |
| 1802 | |
| 1803 case ClassLiteral::Property::FIELD: | |
| 1804 default: | |
| 1805 UNREACHABLE(); | |
| 1806 } | |
| 1807 } | |
| 1808 } | |
| 1809 | |
| 1810 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 1758 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 1811 PopOperand(r3); | 1759 PopOperand(r3); |
| 1812 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 1760 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
| 1813 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 1761 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 1814 CallIC(code, expr->BinaryOperationFeedbackId()); | 1762 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 1815 patch_site.EmitPatchInfo(); | 1763 patch_site.EmitPatchInfo(); |
| 1816 context()->Plug(r2); | 1764 context()->Plug(r2); |
| 1817 } | 1765 } |
| 1818 | 1766 |
| 1819 void FullCodeGenerator::EmitAssignment(Expression* expr, | 1767 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 DCHECK(kOSRBranchInstruction == br_instr); | 3206 DCHECK(kOSRBranchInstruction == br_instr); |
| 3259 | 3207 |
| 3260 DCHECK(interrupt_address == | 3208 DCHECK(interrupt_address == |
| 3261 isolate->builtins()->OnStackReplacement()->entry()); | 3209 isolate->builtins()->OnStackReplacement()->entry()); |
| 3262 return ON_STACK_REPLACEMENT; | 3210 return ON_STACK_REPLACEMENT; |
| 3263 } | 3211 } |
| 3264 | 3212 |
| 3265 } // namespace internal | 3213 } // namespace internal |
| 3266 } // namespace v8 | 3214 } // namespace v8 |
| 3267 #endif // V8_TARGET_ARCH_S390 | 3215 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |