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