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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 Assembler::BlockPoolsScope scope(masm_); | 1877 Assembler::BlockPoolsScope scope(masm_); |
1878 CallIC(code, expr->BinaryOperationFeedbackId()); | 1878 CallIC(code, expr->BinaryOperationFeedbackId()); |
1879 patch_site.EmitPatchInfo(); | 1879 patch_site.EmitPatchInfo(); |
1880 } | 1880 } |
1881 context()->Plug(x0); | 1881 context()->Plug(x0); |
1882 } | 1882 } |
1883 | 1883 |
1884 | 1884 |
1885 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 1885 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
1886 for (int i = 0; i < lit->properties()->length(); i++) { | 1886 for (int i = 0; i < lit->properties()->length(); i++) { |
1887 ObjectLiteral::Property* property = lit->properties()->at(i); | 1887 ClassLiteral::Property* property = lit->properties()->at(i); |
1888 Expression* value = property->value(); | 1888 Expression* value = property->value(); |
1889 | 1889 |
1890 Register scratch = x1; | 1890 Register scratch = x1; |
1891 if (property->is_static()) { | 1891 if (property->is_static()) { |
1892 __ Peek(scratch, kPointerSize); // constructor | 1892 __ Peek(scratch, kPointerSize); // constructor |
1893 } else { | 1893 } else { |
1894 __ Peek(scratch, 0); // prototype | 1894 __ Peek(scratch, 0); // prototype |
1895 } | 1895 } |
1896 PushOperand(scratch); | 1896 PushOperand(scratch); |
1897 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 1897 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
1898 | 1898 |
1899 // The static prototype property is read only. We handle the non computed | 1899 // The static prototype property is read only. We handle the non computed |
1900 // property name case in the parser. Since this is the only case where we | 1900 // property name case in the parser. Since this is the only case where we |
1901 // need to check for an own read only property we special case this so we do | 1901 // need to check for an own read only property we special case this so we do |
1902 // not need to do this for every property. | 1902 // not need to do this for every property. |
1903 if (property->is_static() && property->is_computed_name()) { | 1903 if (property->is_static() && property->is_computed_name()) { |
1904 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | 1904 __ CallRuntime(Runtime::kThrowIfStaticPrototype); |
1905 __ Push(x0); | 1905 __ Push(x0); |
1906 } | 1906 } |
1907 | 1907 |
1908 VisitForStackValue(value); | 1908 VisitForStackValue(value); |
1909 if (NeedsHomeObject(value)) { | 1909 if (NeedsHomeObject(value)) { |
1910 EmitSetHomeObject(value, 2, property->GetSlot()); | 1910 EmitSetHomeObject(value, 2, property->GetSlot()); |
1911 } | 1911 } |
1912 | 1912 |
1913 switch (property->kind()) { | 1913 switch (property->kind()) { |
1914 case ObjectLiteral::Property::CONSTANT: | 1914 case ClassLiteral::Property::METHOD: |
1915 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
1916 case ObjectLiteral::Property::PROTOTYPE: | |
1917 UNREACHABLE(); | |
1918 case ObjectLiteral::Property::COMPUTED: | |
1919 PushOperand(Smi::FromInt(DONT_ENUM)); | 1915 PushOperand(Smi::FromInt(DONT_ENUM)); |
1920 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | 1916 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
1921 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | 1917 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
1922 break; | 1918 break; |
1923 | 1919 |
1924 case ObjectLiteral::Property::GETTER: | 1920 case ClassLiteral::Property::GETTER: |
1925 PushOperand(Smi::FromInt(DONT_ENUM)); | 1921 PushOperand(Smi::FromInt(DONT_ENUM)); |
1926 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 1922 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
1927 break; | 1923 break; |
1928 | 1924 |
1929 case ObjectLiteral::Property::SETTER: | 1925 case ClassLiteral::Property::SETTER: |
1930 PushOperand(Smi::FromInt(DONT_ENUM)); | 1926 PushOperand(Smi::FromInt(DONT_ENUM)); |
1931 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 1927 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
1932 break; | 1928 break; |
1933 | 1929 |
1934 default: | 1930 default: |
1935 UNREACHABLE(); | 1931 UNREACHABLE(); |
1936 } | 1932 } |
1937 } | 1933 } |
1938 } | 1934 } |
1939 | 1935 |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3811 } | 3807 } |
3812 | 3808 |
3813 return INTERRUPT; | 3809 return INTERRUPT; |
3814 } | 3810 } |
3815 | 3811 |
3816 | 3812 |
3817 } // namespace internal | 3813 } // namespace internal |
3818 } // namespace v8 | 3814 } // namespace v8 |
3819 | 3815 |
3820 #endif // V8_TARGET_ARCH_ARM64 | 3816 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |