OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 default: | 2242 default: |
2243 UNREACHABLE(); | 2243 UNREACHABLE(); |
2244 } | 2244 } |
2245 | 2245 |
2246 __ bind(&done); | 2246 __ bind(&done); |
2247 context()->Plug(r3); | 2247 context()->Plug(r3); |
2248 } | 2248 } |
2249 | 2249 |
2250 | 2250 |
2251 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 2251 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
2252 // Constructor is in r3. | |
2253 DCHECK(lit != NULL); | |
2254 __ push(r3); | |
2255 | |
2256 // No access check is needed here since the constructor is created by the | |
2257 // class literal. | |
2258 Register scratch = r4; | |
2259 __ LoadP(scratch, | |
2260 FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); | |
2261 __ push(scratch); | |
2262 | |
2263 for (int i = 0; i < lit->properties()->length(); i++) { | 2252 for (int i = 0; i < lit->properties()->length(); i++) { |
2264 ObjectLiteral::Property* property = lit->properties()->at(i); | 2253 ObjectLiteral::Property* property = lit->properties()->at(i); |
2265 Expression* value = property->value(); | 2254 Expression* value = property->value(); |
2266 | 2255 |
2267 if (property->is_static()) { | 2256 if (property->is_static()) { |
2268 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | 2257 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor |
2269 } else { | 2258 } else { |
2270 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | 2259 __ LoadP(scratch, MemOperand(sp, 0)); // prototype |
2271 } | 2260 } |
2272 __ push(scratch); | 2261 __ push(scratch); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2304 | 2293 |
2305 case ObjectLiteral::Property::SETTER: | 2294 case ObjectLiteral::Property::SETTER: |
2306 __ Push(Smi::FromInt(DONT_ENUM)); | 2295 __ Push(Smi::FromInt(DONT_ENUM)); |
2307 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); | 2296 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); |
2308 break; | 2297 break; |
2309 | 2298 |
2310 default: | 2299 default: |
2311 UNREACHABLE(); | 2300 UNREACHABLE(); |
2312 } | 2301 } |
2313 } | 2302 } |
2314 | |
2315 // Set both the prototype and constructor to have fast properties, and also | |
2316 // freeze them in strong mode. | |
2317 __ CallRuntime(Runtime::kFinalizeClassDefinition); | |
2318 } | 2303 } |
2319 | 2304 |
2320 | 2305 |
2321 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2306 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2322 __ pop(r4); | 2307 __ pop(r4); |
2323 Handle<Code> code = | 2308 Handle<Code> code = |
2324 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2309 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2325 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2310 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2326 CallIC(code, expr->BinaryOperationFeedbackId()); | 2311 CallIC(code, expr->BinaryOperationFeedbackId()); |
2327 patch_site.EmitPatchInfo(); | 2312 patch_site.EmitPatchInfo(); |
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4675 return ON_STACK_REPLACEMENT; | 4660 return ON_STACK_REPLACEMENT; |
4676 } | 4661 } |
4677 | 4662 |
4678 DCHECK(interrupt_address == | 4663 DCHECK(interrupt_address == |
4679 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4664 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4680 return OSR_AFTER_STACK_CHECK; | 4665 return OSR_AFTER_STACK_CHECK; |
4681 } | 4666 } |
4682 } // namespace internal | 4667 } // namespace internal |
4683 } // namespace v8 | 4668 } // namespace v8 |
4684 #endif // V8_TARGET_ARCH_PPC | 4669 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |