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