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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 __ bind(&done); | 1882 __ bind(&done); |
1883 context()->Plug(eax); | 1883 context()->Plug(eax); |
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 ClassLiteral::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 if (property->kind() == ClassLiteral::Property::FIELD && |
| 1893 !property->is_static()) { |
| 1894 // This just does the ToName call on the field name and stores it in a |
| 1895 // variable (a proxy for which is the value() of this property) |
| 1896 DCHECK(property->value()->IsVariableProxy()); |
| 1897 Variable* variable = property->value()->AsVariableProxy()->var(); |
| 1898 VisitForStackValue(property->key()); |
| 1899 EmitVariableAssignment(variable, Token::INIT, |
| 1900 FeedbackVectorSlot::Invalid()); |
| 1901 DropOperands(1); |
| 1902 continue; |
| 1903 } |
| 1904 |
1892 if (property->is_static()) { | 1905 if (property->is_static()) { |
1893 PushOperand(Operand(esp, kPointerSize)); // constructor | 1906 PushOperand(Operand(esp, kPointerSize)); // constructor |
1894 } else { | 1907 } else { |
1895 PushOperand(Operand(esp, 0)); // prototype | 1908 PushOperand(Operand(esp, 0)); // prototype |
1896 } | 1909 } |
1897 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 1910 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
1898 | 1911 |
1899 // The static prototype property is read only. We handle the non computed | 1912 // 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 | 1913 // 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 | 1914 // need to check for an own read only property we special case this so we do |
(...skipping 19 matching lines...) Expand all Loading... |
1921 PushOperand(Smi::FromInt(DONT_ENUM)); | 1934 PushOperand(Smi::FromInt(DONT_ENUM)); |
1922 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 1935 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
1923 break; | 1936 break; |
1924 | 1937 |
1925 case ClassLiteral::Property::SETTER: | 1938 case ClassLiteral::Property::SETTER: |
1926 PushOperand(Smi::FromInt(DONT_ENUM)); | 1939 PushOperand(Smi::FromInt(DONT_ENUM)); |
1927 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 1940 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
1928 break; | 1941 break; |
1929 | 1942 |
1930 case ClassLiteral::Property::FIELD: | 1943 case ClassLiteral::Property::FIELD: |
1931 UNREACHABLE(); | 1944 DCHECK(property->is_static()); |
| 1945 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 1946 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
| 1947 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
1932 break; | 1948 break; |
1933 } | 1949 } |
1934 } | 1950 } |
1935 } | 1951 } |
1936 | 1952 |
1937 | 1953 |
1938 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 1954 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
1939 PopOperand(edx); | 1955 PopOperand(edx); |
1940 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 1956 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
1941 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 1957 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3623 isolate->builtins()->OnStackReplacement()->entry(), | 3639 isolate->builtins()->OnStackReplacement()->entry(), |
3624 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3640 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3625 return ON_STACK_REPLACEMENT; | 3641 return ON_STACK_REPLACEMENT; |
3626 } | 3642 } |
3627 | 3643 |
3628 | 3644 |
3629 } // namespace internal | 3645 } // namespace internal |
3630 } // namespace v8 | 3646 } // namespace v8 |
3631 | 3647 |
3632 #endif // V8_TARGET_ARCH_X87 | 3648 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |