| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 default: | 2237 default: |
| 2238 UNREACHABLE(); | 2238 UNREACHABLE(); |
| 2239 } | 2239 } |
| 2240 | 2240 |
| 2241 __ bind(&done); | 2241 __ bind(&done); |
| 2242 context()->Plug(r0); | 2242 context()->Plug(r0); |
| 2243 } | 2243 } |
| 2244 | 2244 |
| 2245 | 2245 |
| 2246 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 2246 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
| 2247 // Constructor is in r0. | |
| 2248 DCHECK(lit != NULL); | |
| 2249 __ push(r0); | |
| 2250 | |
| 2251 // No access check is needed here since the constructor is created by the | |
| 2252 // class literal. | |
| 2253 Register scratch = r1; | |
| 2254 __ ldr(scratch, | |
| 2255 FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); | |
| 2256 __ push(scratch); | |
| 2257 | |
| 2258 for (int i = 0; i < lit->properties()->length(); i++) { | 2247 for (int i = 0; i < lit->properties()->length(); i++) { |
| 2259 ObjectLiteral::Property* property = lit->properties()->at(i); | 2248 ObjectLiteral::Property* property = lit->properties()->at(i); |
| 2260 Expression* value = property->value(); | 2249 Expression* value = property->value(); |
| 2261 | 2250 |
| 2251 Register scratch = r1; |
| 2262 if (property->is_static()) { | 2252 if (property->is_static()) { |
| 2263 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor | 2253 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor |
| 2264 } else { | 2254 } else { |
| 2265 __ ldr(scratch, MemOperand(sp, 0)); // prototype | 2255 __ ldr(scratch, MemOperand(sp, 0)); // prototype |
| 2266 } | 2256 } |
| 2267 __ push(scratch); | 2257 __ push(scratch); |
| 2268 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 2258 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
| 2269 | 2259 |
| 2270 // The static prototype property is read only. We handle the non computed | 2260 // The static prototype property is read only. We handle the non computed |
| 2271 // property name case in the parser. Since this is the only case where we | 2261 // property name case in the parser. Since this is the only case where we |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2299 | 2289 |
| 2300 case ObjectLiteral::Property::SETTER: | 2290 case ObjectLiteral::Property::SETTER: |
| 2301 __ Push(Smi::FromInt(DONT_ENUM)); | 2291 __ Push(Smi::FromInt(DONT_ENUM)); |
| 2302 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); | 2292 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked); |
| 2303 break; | 2293 break; |
| 2304 | 2294 |
| 2305 default: | 2295 default: |
| 2306 UNREACHABLE(); | 2296 UNREACHABLE(); |
| 2307 } | 2297 } |
| 2308 } | 2298 } |
| 2309 | |
| 2310 // Set both the prototype and constructor to have fast properties, and also | |
| 2311 // freeze them in strong mode. | |
| 2312 __ CallRuntime(Runtime::kFinalizeClassDefinition); | |
| 2313 } | 2299 } |
| 2314 | 2300 |
| 2315 | 2301 |
| 2316 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2302 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2317 __ pop(r1); | 2303 __ pop(r1); |
| 2318 Handle<Code> code = | 2304 Handle<Code> code = |
| 2319 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2305 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2320 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2306 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2321 CallIC(code, expr->BinaryOperationFeedbackId()); | 2307 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2322 patch_site.EmitPatchInfo(); | 2308 patch_site.EmitPatchInfo(); |
| (...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4749 DCHECK(interrupt_address == | 4735 DCHECK(interrupt_address == |
| 4750 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4736 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 4751 return OSR_AFTER_STACK_CHECK; | 4737 return OSR_AFTER_STACK_CHECK; |
| 4752 } | 4738 } |
| 4753 | 4739 |
| 4754 | 4740 |
| 4755 } // namespace internal | 4741 } // namespace internal |
| 4756 } // namespace v8 | 4742 } // namespace v8 |
| 4757 | 4743 |
| 4758 #endif // V8_TARGET_ARCH_ARM | 4744 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |