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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...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 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2238 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
2239 __ Push(load_name, a3, a0); // "next", iter, received | 2239 __ Push(load_name, a3, a0); // "next", iter, received |
2240 | 2240 |
2241 // result = receiver[f](arg); | 2241 // result = receiver[f](arg); |
2242 __ bind(&l_call); | 2242 __ bind(&l_call); |
2243 __ lw(load_receiver, MemOperand(sp, kPointerSize)); | 2243 __ lw(load_receiver, MemOperand(sp, kPointerSize)); |
2244 __ lw(load_name, MemOperand(sp, 2 * kPointerSize)); | 2244 __ lw(load_name, MemOperand(sp, 2 * kPointerSize)); |
2245 __ li(LoadDescriptor::SlotRegister(), | 2245 __ li(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(a0, v0); | 2249 __ mov(a0, v0); |
2250 __ mov(a1, a0); | 2250 __ mov(a1, a0); |
2251 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); | 2251 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); |
2252 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2252 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
2253 __ CallStub(&stub); | 2253 __ CallStub(&stub); |
2254 | 2254 |
2255 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2255 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2256 __ Drop(1); // The function is still on the stack; drop it. | 2256 __ Drop(1); // The function is still on the stack; drop it. |
2257 | 2257 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2408 | 2408 |
2409 | 2409 |
2410 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2410 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2411 SetSourcePosition(prop->position()); | 2411 SetSourcePosition(prop->position()); |
2412 Literal* key = prop->key()->AsLiteral(); | 2412 Literal* key = prop->key()->AsLiteral(); |
2413 DCHECK(!prop->IsSuperAccess()); | 2413 DCHECK(!prop->IsSuperAccess()); |
2414 | 2414 |
2415 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2415 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
2416 __ li(LoadDescriptor::SlotRegister(), | 2416 __ li(LoadDescriptor::SlotRegister(), |
2417 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2417 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2418 CallLoadIC(NOT_CONTEXTUAL); | 2418 CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
2419 } | 2419 } |
2420 | 2420 |
2421 | 2421 |
2422 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2422 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2423 // Stack: receiver, home_object. | 2423 // Stack: receiver, home_object. |
2424 SetSourcePosition(prop->position()); | 2424 SetSourcePosition(prop->position()); |
2425 Literal* key = prop->key()->AsLiteral(); | 2425 Literal* key = prop->key()->AsLiteral(); |
2426 DCHECK(!key->value()->IsSmi()); | 2426 DCHECK(!key->value()->IsSmi()); |
2427 DCHECK(prop->IsSuperAccess()); | 2427 DCHECK(prop->IsSuperAccess()); |
2428 | 2428 |
2429 __ Push(key->value()); | 2429 __ Push(key->value()); |
2430 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2430 __ Push(Smi::FromInt(language_mode())); |
| 2431 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
2431 } | 2432 } |
2432 | 2433 |
2433 | 2434 |
2434 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2435 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2435 SetSourcePosition(prop->position()); | 2436 SetSourcePosition(prop->position()); |
2436 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2437 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); |
2437 __ li(LoadDescriptor::SlotRegister(), | 2438 __ li(LoadDescriptor::SlotRegister(), |
2438 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2439 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2439 CallIC(ic); | 2440 CallIC(ic); |
2440 } | 2441 } |
2441 | 2442 |
2442 | 2443 |
2443 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2444 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2444 // Stack: receiver, home_object, key. | 2445 // Stack: receiver, home_object, key. |
| 2446 __ Push(Smi::FromInt(language_mode())); |
2445 SetSourcePosition(prop->position()); | 2447 SetSourcePosition(prop->position()); |
2446 | 2448 |
2447 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2449 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
2448 } | 2450 } |
2449 | 2451 |
2450 | 2452 |
2451 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2453 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2452 Token::Value op, | 2454 Token::Value op, |
2453 Expression* left_expr, | 2455 Expression* left_expr, |
2454 Expression* right_expr) { | 2456 Expression* right_expr) { |
2455 Label done, smi_case, stub_call; | 2457 Label done, smi_case, stub_call; |
2456 | 2458 |
2457 Register scratch1 = a2; | 2459 Register scratch1 = a2; |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 Literal* key = prop->key()->AsLiteral(); | 2978 Literal* key = prop->key()->AsLiteral(); |
2977 DCHECK(!key->value()->IsSmi()); | 2979 DCHECK(!key->value()->IsSmi()); |
2978 // Load the function from the receiver. | 2980 // Load the function from the receiver. |
2979 const Register scratch = a1; | 2981 const Register scratch = a1; |
2980 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2982 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2981 VisitForAccumulatorValue(super_ref->home_object()); | 2983 VisitForAccumulatorValue(super_ref->home_object()); |
2982 __ mov(scratch, v0); | 2984 __ mov(scratch, v0); |
2983 VisitForAccumulatorValue(super_ref->this_var()); | 2985 VisitForAccumulatorValue(super_ref->this_var()); |
2984 __ Push(scratch, v0, v0, scratch); | 2986 __ Push(scratch, v0, v0, scratch); |
2985 __ Push(key->value()); | 2987 __ Push(key->value()); |
| 2988 __ Push(Smi::FromInt(language_mode())); |
2986 | 2989 |
2987 // Stack here: | 2990 // Stack here: |
2988 // - home_object | 2991 // - home_object |
2989 // - this (receiver) | 2992 // - this (receiver) |
2990 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2993 // - this (receiver) <-- LoadFromSuper will pop here and below. |
2991 // - home_object | 2994 // - home_object |
2992 // - key | 2995 // - key |
2993 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2996 // - language_mode |
| 2997 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
2994 | 2998 |
2995 // Replace home_object with target function. | 2999 // Replace home_object with target function. |
2996 __ sw(v0, MemOperand(sp, kPointerSize)); | 3000 __ sw(v0, MemOperand(sp, kPointerSize)); |
2997 | 3001 |
2998 // Stack here: | 3002 // Stack here: |
2999 // - target function | 3003 // - target function |
3000 // - this (receiver) | 3004 // - this (receiver) |
3001 EmitCall(expr, CallICState::METHOD); | 3005 EmitCall(expr, CallICState::METHOD); |
3002 } | 3006 } |
3003 | 3007 |
(...skipping 30 matching lines...) Expand all Loading... |
3034 | 3038 |
3035 SetSourcePosition(prop->position()); | 3039 SetSourcePosition(prop->position()); |
3036 // Load the function from the receiver. | 3040 // Load the function from the receiver. |
3037 const Register scratch = a1; | 3041 const Register scratch = a1; |
3038 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 3042 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
3039 VisitForAccumulatorValue(super_ref->home_object()); | 3043 VisitForAccumulatorValue(super_ref->home_object()); |
3040 __ Move(scratch, v0); | 3044 __ Move(scratch, v0); |
3041 VisitForAccumulatorValue(super_ref->this_var()); | 3045 VisitForAccumulatorValue(super_ref->this_var()); |
3042 __ Push(scratch, v0, v0, scratch); | 3046 __ Push(scratch, v0, v0, scratch); |
3043 VisitForStackValue(prop->key()); | 3047 VisitForStackValue(prop->key()); |
| 3048 __ Push(Smi::FromInt(language_mode())); |
3044 | 3049 |
3045 // Stack here: | 3050 // Stack here: |
3046 // - home_object | 3051 // - home_object |
3047 // - this (receiver) | 3052 // - this (receiver) |
3048 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 3053 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
3049 // - home_object | 3054 // - home_object |
3050 // - key | 3055 // - key |
3051 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 3056 // - language_mode |
| 3057 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
3052 | 3058 |
3053 // Replace home_object with target function. | 3059 // Replace home_object with target function. |
3054 __ sw(v0, MemOperand(sp, kPointerSize)); | 3060 __ sw(v0, MemOperand(sp, kPointerSize)); |
3055 | 3061 |
3056 // Stack here: | 3062 // Stack here: |
3057 // - target function | 3063 // - target function |
3058 // - this (receiver) | 3064 // - this (receiver) |
3059 EmitCall(expr, CallICState::METHOD); | 3065 EmitCall(expr, CallICState::METHOD); |
3060 } | 3066 } |
3061 | 3067 |
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5582 reinterpret_cast<uint32_t>( | 5588 reinterpret_cast<uint32_t>( |
5583 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5589 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5584 return OSR_AFTER_STACK_CHECK; | 5590 return OSR_AFTER_STACK_CHECK; |
5585 } | 5591 } |
5586 | 5592 |
5587 | 5593 |
5588 } // namespace internal | 5594 } // namespace internal |
5589 } // namespace v8 | 5595 } // namespace v8 |
5590 | 5596 |
5591 #endif // V8_TARGET_ARCH_MIPS | 5597 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |