| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 break; | 1992 break; |
| 1993 default: | 1993 default: |
| 1994 UNREACHABLE(); | 1994 UNREACHABLE(); |
| 1995 } | 1995 } |
| 1996 | 1996 |
| 1997 __ bind(&done); | 1997 __ bind(&done); |
| 1998 context()->Plug(v0); | 1998 context()->Plug(v0); |
| 1999 } | 1999 } |
| 2000 | 2000 |
| 2001 | 2001 |
| 2002 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | |
| 2003 for (int i = 0; i < lit->properties()->length(); i++) { | |
| 2004 ObjectLiteral::Property* property = lit->properties()->at(i); | |
| 2005 Expression* value = property->value(); | |
| 2006 | |
| 2007 Register scratch = a1; | |
| 2008 if (property->is_static()) { | |
| 2009 __ lw(scratch, MemOperand(sp, kPointerSize)); // constructor | |
| 2010 } else { | |
| 2011 __ lw(scratch, MemOperand(sp, 0)); // prototype | |
| 2012 } | |
| 2013 PushOperand(scratch); | |
| 2014 EmitPropertyKey(property, lit->GetIdForProperty(i)); | |
| 2015 | |
| 2016 // The static prototype property is read only. We handle the non computed | |
| 2017 // property name case in the parser. Since this is the only case where we | |
| 2018 // need to check for an own read only property we special case this so we do | |
| 2019 // not need to do this for every property. | |
| 2020 if (property->is_static() && property->is_computed_name()) { | |
| 2021 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | |
| 2022 __ push(v0); | |
| 2023 } | |
| 2024 | |
| 2025 VisitForStackValue(value); | |
| 2026 if (NeedsHomeObject(value)) { | |
| 2027 EmitSetHomeObject(value, 2, property->GetSlot()); | |
| 2028 } | |
| 2029 | |
| 2030 switch (property->kind()) { | |
| 2031 case ObjectLiteral::Property::CONSTANT: | |
| 2032 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
| 2033 case ObjectLiteral::Property::PROTOTYPE: | |
| 2034 UNREACHABLE(); | |
| 2035 case ObjectLiteral::Property::COMPUTED: | |
| 2036 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 2037 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | |
| 2038 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | |
| 2039 break; | |
| 2040 | |
| 2041 case ObjectLiteral::Property::GETTER: | |
| 2042 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 2043 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | |
| 2044 break; | |
| 2045 | |
| 2046 case ObjectLiteral::Property::SETTER: | |
| 2047 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 2048 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | |
| 2049 break; | |
| 2050 | |
| 2051 default: | |
| 2052 UNREACHABLE(); | |
| 2053 } | |
| 2054 } | |
| 2055 } | |
| 2056 | |
| 2057 | |
| 2058 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2002 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2059 __ mov(a0, result_register()); | 2003 __ mov(a0, result_register()); |
| 2060 PopOperand(a1); | 2004 PopOperand(a1); |
| 2061 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2005 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
| 2062 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2006 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2063 CallIC(code, expr->BinaryOperationFeedbackId()); | 2007 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2064 patch_site.EmitPatchInfo(); | 2008 patch_site.EmitPatchInfo(); |
| 2065 context()->Plug(v0); | 2009 context()->Plug(v0); |
| 2066 } | 2010 } |
| 2067 | 2011 |
| (...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3781 reinterpret_cast<uint32_t>( | 3725 reinterpret_cast<uint32_t>( |
| 3782 isolate->builtins()->OnStackReplacement()->entry())); | 3726 isolate->builtins()->OnStackReplacement()->entry())); |
| 3783 return ON_STACK_REPLACEMENT; | 3727 return ON_STACK_REPLACEMENT; |
| 3784 } | 3728 } |
| 3785 | 3729 |
| 3786 | 3730 |
| 3787 } // namespace internal | 3731 } // namespace internal |
| 3788 } // namespace v8 | 3732 } // namespace v8 |
| 3789 | 3733 |
| 3790 #endif // V8_TARGET_ARCH_MIPS | 3734 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |