| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2237 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
| 2238 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter | 2238 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
| 2239 __ Push(load_name, r3, r0); // "next", iter, received | 2239 __ Push(load_name, r3, r0); // "next", iter, received |
| 2240 | 2240 |
| 2241 // result = receiver[f](arg); | 2241 // result = receiver[f](arg); |
| 2242 __ bind(&l_call); | 2242 __ bind(&l_call); |
| 2243 __ ldr(load_receiver, MemOperand(sp, kPointerSize)); | 2243 __ ldr(load_receiver, MemOperand(sp, kPointerSize)); |
| 2244 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); | 2244 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); |
| 2245 __ mov(LoadDescriptor::SlotRegister(), | 2245 __ mov(LoadDescriptor::SlotRegister(), |
| 2246 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); | 2246 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
| 2247 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2247 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
| 2248 CallIC(ic, TypeFeedbackId::None()); | 2248 CallIC(ic, TypeFeedbackId::None()); |
| 2249 __ mov(r1, r0); | 2249 __ mov(r1, r0); |
| 2250 __ str(r1, MemOperand(sp, 2 * kPointerSize)); | 2250 __ str(r1, MemOperand(sp, 2 * kPointerSize)); |
| 2251 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2251 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
| 2252 __ CallStub(&stub); | 2252 __ CallStub(&stub); |
| 2253 | 2253 |
| 2254 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2254 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2255 __ Drop(1); // The function is still on the stack; drop it. | 2255 __ Drop(1); // The function is still on the stack; drop it. |
| 2256 | 2256 |
| 2257 // if (!result.done) goto l_try; | 2257 // if (!result.done) goto l_try; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 | 2418 |
| 2419 | 2419 |
| 2420 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2420 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2421 SetSourcePosition(prop->position()); | 2421 SetSourcePosition(prop->position()); |
| 2422 Literal* key = prop->key()->AsLiteral(); | 2422 Literal* key = prop->key()->AsLiteral(); |
| 2423 DCHECK(!prop->IsSuperAccess()); | 2423 DCHECK(!prop->IsSuperAccess()); |
| 2424 | 2424 |
| 2425 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2425 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2426 __ mov(LoadDescriptor::SlotRegister(), | 2426 __ mov(LoadDescriptor::SlotRegister(), |
| 2427 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2427 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2428 CallLoadIC(NOT_CONTEXTUAL); | 2428 CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
| 2429 } | 2429 } |
| 2430 | 2430 |
| 2431 | 2431 |
| 2432 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2432 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2433 // Stack: receiver, home_object. | 2433 // Stack: receiver, home_object. |
| 2434 SetSourcePosition(prop->position()); | 2434 SetSourcePosition(prop->position()); |
| 2435 Literal* key = prop->key()->AsLiteral(); | 2435 Literal* key = prop->key()->AsLiteral(); |
| 2436 DCHECK(!key->value()->IsSmi()); | 2436 DCHECK(!key->value()->IsSmi()); |
| 2437 DCHECK(prop->IsSuperAccess()); | 2437 DCHECK(prop->IsSuperAccess()); |
| 2438 | 2438 |
| 2439 __ Push(key->value()); | 2439 __ Push(key->value()); |
| 2440 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2440 __ Push(Smi::FromInt(language_mode())); |
| 2441 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
| 2441 } | 2442 } |
| 2442 | 2443 |
| 2443 | 2444 |
| 2444 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2445 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2445 SetSourcePosition(prop->position()); | 2446 SetSourcePosition(prop->position()); |
| 2446 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2447 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); |
| 2447 __ mov(LoadDescriptor::SlotRegister(), | 2448 __ mov(LoadDescriptor::SlotRegister(), |
| 2448 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2449 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2449 CallIC(ic); | 2450 CallIC(ic); |
| 2450 } | 2451 } |
| 2451 | 2452 |
| 2452 | 2453 |
| 2453 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2454 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2454 // Stack: receiver, home_object, key. | 2455 // Stack: receiver, home_object, key. |
| 2456 __ Push(Smi::FromInt(language_mode())); |
| 2455 SetSourcePosition(prop->position()); | 2457 SetSourcePosition(prop->position()); |
| 2456 | 2458 |
| 2457 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2459 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
| 2458 } | 2460 } |
| 2459 | 2461 |
| 2460 | 2462 |
| 2461 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2463 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2462 Token::Value op, | 2464 Token::Value op, |
| 2463 Expression* left_expr, | 2465 Expression* left_expr, |
| 2464 Expression* right_expr) { | 2466 Expression* right_expr) { |
| 2465 Label done, smi_case, stub_call; | 2467 Label done, smi_case, stub_call; |
| 2466 | 2468 |
| 2467 Register scratch1 = r2; | 2469 Register scratch1 = r2; |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2986 // Load the function from the receiver. | 2988 // Load the function from the receiver. |
| 2987 const Register scratch = r1; | 2989 const Register scratch = r1; |
| 2988 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2990 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2989 VisitForStackValue(super_ref->home_object()); | 2991 VisitForStackValue(super_ref->home_object()); |
| 2990 VisitForAccumulatorValue(super_ref->this_var()); | 2992 VisitForAccumulatorValue(super_ref->this_var()); |
| 2991 __ Push(r0); | 2993 __ Push(r0); |
| 2992 __ Push(r0); | 2994 __ Push(r0); |
| 2993 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); | 2995 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); |
| 2994 __ Push(scratch); | 2996 __ Push(scratch); |
| 2995 __ Push(key->value()); | 2997 __ Push(key->value()); |
| 2998 __ Push(Smi::FromInt(language_mode())); |
| 2996 | 2999 |
| 2997 // Stack here: | 3000 // Stack here: |
| 2998 // - home_object | 3001 // - home_object |
| 2999 // - this (receiver) | 3002 // - this (receiver) |
| 3000 // - this (receiver) <-- LoadFromSuper will pop here and below. | 3003 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 3001 // - home_object | 3004 // - home_object |
| 3002 // - key | 3005 // - key |
| 3003 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 3006 // - language_mode |
| 3007 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
| 3004 | 3008 |
| 3005 // Replace home_object with target function. | 3009 // Replace home_object with target function. |
| 3006 __ str(r0, MemOperand(sp, kPointerSize)); | 3010 __ str(r0, MemOperand(sp, kPointerSize)); |
| 3007 | 3011 |
| 3008 // Stack here: | 3012 // Stack here: |
| 3009 // - target function | 3013 // - target function |
| 3010 // - this (receiver) | 3014 // - this (receiver) |
| 3011 EmitCall(expr, CallICState::METHOD); | 3015 EmitCall(expr, CallICState::METHOD); |
| 3012 } | 3016 } |
| 3013 | 3017 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3046 // Load the function from the receiver. | 3050 // Load the function from the receiver. |
| 3047 const Register scratch = r1; | 3051 const Register scratch = r1; |
| 3048 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 3052 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 3049 VisitForStackValue(super_ref->home_object()); | 3053 VisitForStackValue(super_ref->home_object()); |
| 3050 VisitForAccumulatorValue(super_ref->this_var()); | 3054 VisitForAccumulatorValue(super_ref->this_var()); |
| 3051 __ Push(r0); | 3055 __ Push(r0); |
| 3052 __ Push(r0); | 3056 __ Push(r0); |
| 3053 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); | 3057 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); |
| 3054 __ Push(scratch); | 3058 __ Push(scratch); |
| 3055 VisitForStackValue(prop->key()); | 3059 VisitForStackValue(prop->key()); |
| 3060 __ Push(Smi::FromInt(language_mode())); |
| 3056 | 3061 |
| 3057 // Stack here: | 3062 // Stack here: |
| 3058 // - home_object | 3063 // - home_object |
| 3059 // - this (receiver) | 3064 // - this (receiver) |
| 3060 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 3065 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 3061 // - home_object | 3066 // - home_object |
| 3062 // - key | 3067 // - key |
| 3063 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 3068 // - language_mode |
| 3069 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
| 3064 | 3070 |
| 3065 // Replace home_object with target function. | 3071 // Replace home_object with target function. |
| 3066 __ str(r0, MemOperand(sp, kPointerSize)); | 3072 __ str(r0, MemOperand(sp, kPointerSize)); |
| 3067 | 3073 |
| 3068 // Stack here: | 3074 // Stack here: |
| 3069 // - target function | 3075 // - target function |
| 3070 // - this (receiver) | 3076 // - this (receiver) |
| 3071 EmitCall(expr, CallICState::METHOD); | 3077 EmitCall(expr, CallICState::METHOD); |
| 3072 } | 3078 } |
| 3073 | 3079 |
| (...skipping 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5619 DCHECK(interrupt_address == | 5625 DCHECK(interrupt_address == |
| 5620 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5626 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5621 return OSR_AFTER_STACK_CHECK; | 5627 return OSR_AFTER_STACK_CHECK; |
| 5622 } | 5628 } |
| 5623 | 5629 |
| 5624 | 5630 |
| 5625 } // namespace internal | 5631 } // namespace internal |
| 5626 } // namespace v8 | 5632 } // namespace v8 |
| 5627 | 5633 |
| 5628 #endif // V8_TARGET_ARCH_ARM | 5634 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |