| 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 break; | 1880 break; |
| 1881 } | 1881 } |
| 1882 | 1882 |
| 1883 __ bind(&done); | 1883 __ bind(&done); |
| 1884 context()->Plug(rax); | 1884 context()->Plug(rax); |
| 1885 } | 1885 } |
| 1886 | 1886 |
| 1887 | 1887 |
| 1888 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 1888 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
| 1889 for (int i = 0; i < lit->properties()->length(); i++) { | 1889 for (int i = 0; i < lit->properties()->length(); i++) { |
| 1890 ObjectLiteral::Property* property = lit->properties()->at(i); | 1890 ClassLiteral::Property* property = lit->properties()->at(i); |
| 1891 Expression* value = property->value(); | 1891 Expression* value = property->value(); |
| 1892 | 1892 |
| 1893 if (property->is_static()) { | 1893 if (property->is_static()) { |
| 1894 PushOperand(Operand(rsp, kPointerSize)); // constructor | 1894 PushOperand(Operand(rsp, kPointerSize)); // constructor |
| 1895 } else { | 1895 } else { |
| 1896 PushOperand(Operand(rsp, 0)); // prototype | 1896 PushOperand(Operand(rsp, 0)); // prototype |
| 1897 } | 1897 } |
| 1898 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 1898 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
| 1899 | 1899 |
| 1900 // The static prototype property is read only. We handle the non computed | 1900 // The static prototype property is read only. We handle the non computed |
| 1901 // property name case in the parser. Since this is the only case where we | 1901 // property name case in the parser. Since this is the only case where we |
| 1902 // need to check for an own read only property we special case this so we do | 1902 // need to check for an own read only property we special case this so we do |
| 1903 // not need to do this for every property. | 1903 // not need to do this for every property. |
| 1904 if (property->is_static() && property->is_computed_name()) { | 1904 if (property->is_static() && property->is_computed_name()) { |
| 1905 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | 1905 __ CallRuntime(Runtime::kThrowIfStaticPrototype); |
| 1906 __ Push(rax); | 1906 __ Push(rax); |
| 1907 } | 1907 } |
| 1908 | 1908 |
| 1909 VisitForStackValue(value); | 1909 VisitForStackValue(value); |
| 1910 if (NeedsHomeObject(value)) { | 1910 if (NeedsHomeObject(value)) { |
| 1911 EmitSetHomeObject(value, 2, property->GetSlot()); | 1911 EmitSetHomeObject(value, 2, property->GetSlot()); |
| 1912 } | 1912 } |
| 1913 | 1913 |
| 1914 switch (property->kind()) { | 1914 switch (property->kind()) { |
| 1915 case ObjectLiteral::Property::CONSTANT: | 1915 case ClassLiteral::Property::METHOD: |
| 1916 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
| 1917 case ObjectLiteral::Property::PROTOTYPE: | |
| 1918 UNREACHABLE(); | |
| 1919 case ObjectLiteral::Property::COMPUTED: | |
| 1920 PushOperand(Smi::FromInt(DONT_ENUM)); | 1916 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 1921 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | 1917 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
| 1922 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | 1918 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
| 1923 break; | 1919 break; |
| 1924 | 1920 |
| 1925 case ObjectLiteral::Property::GETTER: | 1921 case ClassLiteral::Property::GETTER: |
| 1926 PushOperand(Smi::FromInt(DONT_ENUM)); | 1922 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 1927 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 1923 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
| 1928 break; | 1924 break; |
| 1929 | 1925 |
| 1930 case ObjectLiteral::Property::SETTER: | 1926 case ClassLiteral::Property::SETTER: |
| 1931 PushOperand(Smi::FromInt(DONT_ENUM)); | 1927 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 1932 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 1928 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
| 1933 break; | 1929 break; |
| 1934 | 1930 |
| 1935 default: | 1931 default: |
| 1936 UNREACHABLE(); | 1932 UNREACHABLE(); |
| 1937 } | 1933 } |
| 1938 } | 1934 } |
| 1939 } | 1935 } |
| 1940 | 1936 |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3629 DCHECK_EQ( | 3625 DCHECK_EQ( |
| 3630 isolate->builtins()->OnStackReplacement()->entry(), | 3626 isolate->builtins()->OnStackReplacement()->entry(), |
| 3631 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3627 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3632 return ON_STACK_REPLACEMENT; | 3628 return ON_STACK_REPLACEMENT; |
| 3633 } | 3629 } |
| 3634 | 3630 |
| 3635 } // namespace internal | 3631 } // namespace internal |
| 3636 } // namespace v8 | 3632 } // namespace v8 |
| 3637 | 3633 |
| 3638 #endif // V8_TARGET_ARCH_X64 | 3634 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |