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