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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
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 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2234 __ ld(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 __ ld(load_receiver, MemOperand(sp, kPointerSize)); | 2239 __ ld(load_receiver, MemOperand(sp, kPointerSize)); |
2240 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); | 2240 __ ld(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 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); | 2247 __ sd(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 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2251 __ ld(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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 | 2406 |
2407 | 2407 |
2408 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2408 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2409 SetSourcePosition(prop->position()); | 2409 SetSourcePosition(prop->position()); |
2410 Literal* key = prop->key()->AsLiteral(); | 2410 Literal* key = prop->key()->AsLiteral(); |
2411 DCHECK(!prop->IsSuperAccess()); | 2411 DCHECK(!prop->IsSuperAccess()); |
2412 | 2412 |
2413 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2413 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
2414 __ li(LoadDescriptor::SlotRegister(), | 2414 __ li(LoadDescriptor::SlotRegister(), |
2415 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2415 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2416 CallLoadIC(NOT_CONTEXTUAL); | 2416 CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
2417 } | 2417 } |
2418 | 2418 |
2419 | 2419 |
2420 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2420 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2421 // Stack: receiver, home_object. | 2421 // Stack: receiver, home_object. |
2422 SetSourcePosition(prop->position()); | 2422 SetSourcePosition(prop->position()); |
2423 Literal* key = prop->key()->AsLiteral(); | 2423 Literal* key = prop->key()->AsLiteral(); |
2424 DCHECK(!key->value()->IsSmi()); | 2424 DCHECK(!key->value()->IsSmi()); |
2425 DCHECK(prop->IsSuperAccess()); | 2425 DCHECK(prop->IsSuperAccess()); |
2426 | 2426 |
2427 __ Push(key->value()); | 2427 __ Push(key->value()); |
2428 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2428 __ Push(Smi::FromInt(language_mode())); |
| 2429 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
2429 } | 2430 } |
2430 | 2431 |
2431 | 2432 |
2432 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2433 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2433 SetSourcePosition(prop->position()); | 2434 SetSourcePosition(prop->position()); |
2434 // Call keyed load IC. It has register arguments receiver and key. | 2435 // Call keyed load IC. It has register arguments receiver and key. |
2435 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2436 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); |
2436 __ li(LoadDescriptor::SlotRegister(), | 2437 __ li(LoadDescriptor::SlotRegister(), |
2437 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2438 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2438 CallIC(ic); | 2439 CallIC(ic); |
2439 } | 2440 } |
2440 | 2441 |
2441 | 2442 |
2442 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2443 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2443 // Stack: receiver, home_object, key. | 2444 // Stack: receiver, home_object, key. |
| 2445 __ Push(Smi::FromInt(language_mode())); |
2444 SetSourcePosition(prop->position()); | 2446 SetSourcePosition(prop->position()); |
2445 | 2447 |
2446 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2448 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
2447 } | 2449 } |
2448 | 2450 |
2449 | 2451 |
2450 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2452 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2451 Token::Value op, | 2453 Token::Value op, |
2452 Expression* left_expr, | 2454 Expression* left_expr, |
2453 Expression* right_expr) { | 2455 Expression* right_expr) { |
2454 Label done, smi_case, stub_call; | 2456 Label done, smi_case, stub_call; |
2455 | 2457 |
2456 Register scratch1 = a2; | 2458 Register scratch1 = a2; |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 Literal* key = prop->key()->AsLiteral(); | 2980 Literal* key = prop->key()->AsLiteral(); |
2979 DCHECK(!key->value()->IsSmi()); | 2981 DCHECK(!key->value()->IsSmi()); |
2980 // Load the function from the receiver. | 2982 // Load the function from the receiver. |
2981 const Register scratch = a1; | 2983 const Register scratch = a1; |
2982 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2984 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2983 VisitForAccumulatorValue(super_ref->home_object()); | 2985 VisitForAccumulatorValue(super_ref->home_object()); |
2984 __ mov(scratch, v0); | 2986 __ mov(scratch, v0); |
2985 VisitForAccumulatorValue(super_ref->this_var()); | 2987 VisitForAccumulatorValue(super_ref->this_var()); |
2986 __ Push(scratch, v0, v0, scratch); | 2988 __ Push(scratch, v0, v0, scratch); |
2987 __ Push(key->value()); | 2989 __ Push(key->value()); |
| 2990 __ Push(Smi::FromInt(language_mode())); |
2988 | 2991 |
2989 // Stack here: | 2992 // Stack here: |
2990 // - home_object | 2993 // - home_object |
2991 // - this (receiver) | 2994 // - this (receiver) |
2992 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2995 // - this (receiver) <-- LoadFromSuper will pop here and below. |
2993 // - home_object | 2996 // - home_object |
2994 // - key | 2997 // - key |
2995 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2998 // - language_mode |
| 2999 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
2996 | 3000 |
2997 // Replace home_object with target function. | 3001 // Replace home_object with target function. |
2998 __ sd(v0, MemOperand(sp, kPointerSize)); | 3002 __ sd(v0, MemOperand(sp, kPointerSize)); |
2999 | 3003 |
3000 // Stack here: | 3004 // Stack here: |
3001 // - target function | 3005 // - target function |
3002 // - this (receiver) | 3006 // - this (receiver) |
3003 EmitCall(expr, CallICState::METHOD); | 3007 EmitCall(expr, CallICState::METHOD); |
3004 } | 3008 } |
3005 | 3009 |
(...skipping 30 matching lines...) Expand all Loading... |
3036 | 3040 |
3037 SetSourcePosition(prop->position()); | 3041 SetSourcePosition(prop->position()); |
3038 // Load the function from the receiver. | 3042 // Load the function from the receiver. |
3039 const Register scratch = a1; | 3043 const Register scratch = a1; |
3040 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 3044 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
3041 VisitForAccumulatorValue(super_ref->home_object()); | 3045 VisitForAccumulatorValue(super_ref->home_object()); |
3042 __ Move(scratch, v0); | 3046 __ Move(scratch, v0); |
3043 VisitForAccumulatorValue(super_ref->this_var()); | 3047 VisitForAccumulatorValue(super_ref->this_var()); |
3044 __ Push(scratch, v0, v0, scratch); | 3048 __ Push(scratch, v0, v0, scratch); |
3045 VisitForStackValue(prop->key()); | 3049 VisitForStackValue(prop->key()); |
| 3050 __ Push(Smi::FromInt(language_mode())); |
3046 | 3051 |
3047 // Stack here: | 3052 // Stack here: |
3048 // - home_object | 3053 // - home_object |
3049 // - this (receiver) | 3054 // - this (receiver) |
3050 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 3055 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
3051 // - home_object | 3056 // - home_object |
3052 // - key | 3057 // - key |
3053 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 3058 // - language_mode |
| 3059 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
3054 | 3060 |
3055 // Replace home_object with target function. | 3061 // Replace home_object with target function. |
3056 __ sd(v0, MemOperand(sp, kPointerSize)); | 3062 __ sd(v0, MemOperand(sp, kPointerSize)); |
3057 | 3063 |
3058 // Stack here: | 3064 // Stack here: |
3059 // - target function | 3065 // - target function |
3060 // - this (receiver) | 3066 // - this (receiver) |
3061 EmitCall(expr, CallICState::METHOD); | 3067 EmitCall(expr, CallICState::METHOD); |
3062 } | 3068 } |
3063 | 3069 |
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5588 reinterpret_cast<uint64_t>( | 5594 reinterpret_cast<uint64_t>( |
5589 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5595 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5590 return OSR_AFTER_STACK_CHECK; | 5596 return OSR_AFTER_STACK_CHECK; |
5591 } | 5597 } |
5592 | 5598 |
5593 | 5599 |
5594 } // namespace internal | 5600 } // namespace internal |
5595 } // namespace v8 | 5601 } // namespace v8 |
5596 | 5602 |
5597 #endif // V8_TARGET_ARCH_MIPS64 | 5603 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |