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