| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 default: | 2229 default: |
| 2230 UNREACHABLE(); | 2230 UNREACHABLE(); |
| 2231 } | 2231 } |
| 2232 | 2232 |
| 2233 __ bind(&done); | 2233 __ bind(&done); |
| 2234 context()->Plug(v0); | 2234 context()->Plug(v0); |
| 2235 } | 2235 } |
| 2236 | 2236 |
| 2237 | 2237 |
| 2238 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 2238 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
| 2239 // Constructor is in v0. | |
| 2240 DCHECK(lit != NULL); | |
| 2241 __ push(v0); | |
| 2242 | |
| 2243 // No access check is needed here since the constructor is created by the | |
| 2244 // class literal. | |
| 2245 Register scratch = a1; | |
| 2246 __ ld(scratch, | |
| 2247 FieldMemOperand(v0, JSFunction::kPrototypeOrInitialMapOffset)); | |
| 2248 __ push(scratch); | |
| 2249 | |
| 2250 for (int i = 0; i < lit->properties()->length(); i++) { | 2239 for (int i = 0; i < lit->properties()->length(); i++) { |
| 2251 ObjectLiteral::Property* property = lit->properties()->at(i); | 2240 ObjectLiteral::Property* property = lit->properties()->at(i); |
| 2252 Expression* value = property->value(); | 2241 Expression* value = property->value(); |
| 2253 | 2242 |
| 2243 Register scratch = a1; |
| 2254 if (property->is_static()) { | 2244 if (property->is_static()) { |
| 2255 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor | 2245 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor |
| 2256 } else { | 2246 } else { |
| 2257 __ ld(scratch, MemOperand(sp, 0)); // prototype | 2247 __ ld(scratch, MemOperand(sp, 0)); // prototype |
| 2258 } | 2248 } |
| 2259 __ push(scratch); | 2249 __ push(scratch); |
| 2260 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 2250 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
| 2261 | 2251 |
| 2262 // The static prototype property is read only. We handle the non computed | 2252 // The static prototype property is read only. We handle the non computed |
| 2263 // property name case in the parser. Since this is the only case where we | 2253 // property name case in the parser. Since this is the only case where we |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2291 | 2281 |
| 2292 case ObjectLiteral::Property::SETTER: | 2282 case ObjectLiteral::Property::SETTER: |
| 2293 __ Push(Smi::FromInt(DONT_ENUM)); | 2283 __ Push(Smi::FromInt(DONT_ENUM)); |
| 2294 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); | 2284 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); |
| 2295 break; | 2285 break; |
| 2296 | 2286 |
| 2297 default: | 2287 default: |
| 2298 UNREACHABLE(); | 2288 UNREACHABLE(); |
| 2299 } | 2289 } |
| 2300 } | 2290 } |
| 2301 | |
| 2302 // Set both the prototype and constructor to have fast properties, and also | |
| 2303 // freeze them in strong mode. | |
| 2304 __ CallRuntime(Runtime::kFinalizeClassDefinition); | |
| 2305 } | 2291 } |
| 2306 | 2292 |
| 2307 | 2293 |
| 2308 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2294 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2309 __ mov(a0, result_register()); | 2295 __ mov(a0, result_register()); |
| 2310 __ pop(a1); | 2296 __ pop(a1); |
| 2311 Handle<Code> code = | 2297 Handle<Code> code = |
| 2312 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2298 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2313 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2299 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2314 CallIC(code, expr->BinaryOperationFeedbackId()); | 2300 CallIC(code, expr->BinaryOperationFeedbackId()); |
| (...skipping 2393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4708 reinterpret_cast<uint64_t>( | 4694 reinterpret_cast<uint64_t>( |
| 4709 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4695 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4710 return OSR_AFTER_STACK_CHECK; | 4696 return OSR_AFTER_STACK_CHECK; |
| 4711 } | 4697 } |
| 4712 | 4698 |
| 4713 | 4699 |
| 4714 } // namespace internal | 4700 } // namespace internal |
| 4715 } // namespace v8 | 4701 } // namespace v8 |
| 4716 | 4702 |
| 4717 #endif // V8_TARGET_ARCH_MIPS64 | 4703 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |