| 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 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2219 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2219 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
| 2220 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2220 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
| 2221 __ Push(load_name, a3, a0); // "next", iter, received | 2221 __ Push(load_name, a3, a0); // "next", iter, received |
| 2222 | 2222 |
| 2223 // result = receiver[f](arg); | 2223 // result = receiver[f](arg); |
| 2224 __ bind(&l_call); | 2224 __ bind(&l_call); |
| 2225 __ ld(load_receiver, MemOperand(sp, kPointerSize)); | 2225 __ ld(load_receiver, MemOperand(sp, kPointerSize)); |
| 2226 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); | 2226 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); |
| 2227 __ li(LoadDescriptor::SlotRegister(), | 2227 __ li(LoadDescriptor::SlotRegister(), |
| 2228 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); | 2228 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
| 2229 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); | 2229 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2230 CallIC(ic, TypeFeedbackId::None()); | 2230 CallIC(ic, TypeFeedbackId::None()); |
| 2231 __ mov(a0, v0); | 2231 __ mov(a0, v0); |
| 2232 __ mov(a1, a0); | 2232 __ mov(a1, a0); |
| 2233 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); | 2233 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); |
| 2234 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2234 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
| 2235 __ CallStub(&stub); | 2235 __ CallStub(&stub); |
| 2236 | 2236 |
| 2237 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2237 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2238 __ Drop(1); // The function is still on the stack; drop it. | 2238 __ Drop(1); // The function is still on the stack; drop it. |
| 2239 | 2239 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2392 | 2392 |
| 2393 | 2393 |
| 2394 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2394 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2395 SetSourcePosition(prop->position()); | 2395 SetSourcePosition(prop->position()); |
| 2396 Literal* key = prop->key()->AsLiteral(); | 2396 Literal* key = prop->key()->AsLiteral(); |
| 2397 DCHECK(!prop->IsSuperAccess()); | 2397 DCHECK(!prop->IsSuperAccess()); |
| 2398 | 2398 |
| 2399 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2399 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2400 __ li(LoadDescriptor::SlotRegister(), | 2400 __ li(LoadDescriptor::SlotRegister(), |
| 2401 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2401 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2402 CallLoadIC(NOT_CONTEXTUAL, language_mode()); | 2402 CallLoadIC(NOT_CONTEXTUAL); |
| 2403 } | 2403 } |
| 2404 | 2404 |
| 2405 | 2405 |
| 2406 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2406 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2407 // Stack: receiver, home_object. | 2407 // Stack: receiver, home_object. |
| 2408 SetSourcePosition(prop->position()); | 2408 SetSourcePosition(prop->position()); |
| 2409 Literal* key = prop->key()->AsLiteral(); | 2409 Literal* key = prop->key()->AsLiteral(); |
| 2410 DCHECK(!key->value()->IsSmi()); | 2410 DCHECK(!key->value()->IsSmi()); |
| 2411 DCHECK(prop->IsSuperAccess()); | 2411 DCHECK(prop->IsSuperAccess()); |
| 2412 | 2412 |
| 2413 __ Push(key->value()); | 2413 __ Push(key->value()); |
| 2414 __ Push(Smi::FromInt(language_mode())); | 2414 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
| 2415 __ CallRuntime(Runtime::kLoadFromSuper, 4); | |
| 2416 } | 2415 } |
| 2417 | 2416 |
| 2418 | 2417 |
| 2419 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2418 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2420 SetSourcePosition(prop->position()); | 2419 SetSourcePosition(prop->position()); |
| 2421 // Call keyed load IC. It has register arguments receiver and key. | 2420 // Call keyed load IC. It has register arguments receiver and key. |
| 2422 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2421 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2423 __ li(LoadDescriptor::SlotRegister(), | 2422 __ li(LoadDescriptor::SlotRegister(), |
| 2424 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2423 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2425 CallIC(ic); | 2424 CallIC(ic); |
| 2426 } | 2425 } |
| 2427 | 2426 |
| 2428 | 2427 |
| 2429 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2428 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2430 // Stack: receiver, home_object, key. | 2429 // Stack: receiver, home_object, key. |
| 2431 __ Push(Smi::FromInt(language_mode())); | |
| 2432 SetSourcePosition(prop->position()); | 2430 SetSourcePosition(prop->position()); |
| 2433 | 2431 |
| 2434 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); | 2432 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); |
| 2435 } | 2433 } |
| 2436 | 2434 |
| 2437 | 2435 |
| 2438 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2436 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2439 Token::Value op, | 2437 Token::Value op, |
| 2440 Expression* left_expr, | 2438 Expression* left_expr, |
| 2441 Expression* right_expr) { | 2439 Expression* right_expr) { |
| 2442 Label done, smi_case, stub_call; | 2440 Label done, smi_case, stub_call; |
| 2443 | 2441 |
| 2444 Register scratch1 = a2; | 2442 Register scratch1 = a2; |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2973 Literal* key = prop->key()->AsLiteral(); | 2971 Literal* key = prop->key()->AsLiteral(); |
| 2974 DCHECK(!key->value()->IsSmi()); | 2972 DCHECK(!key->value()->IsSmi()); |
| 2975 // Load the function from the receiver. | 2973 // Load the function from the receiver. |
| 2976 const Register scratch = a1; | 2974 const Register scratch = a1; |
| 2977 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2975 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2978 VisitForAccumulatorValue(super_ref->home_object()); | 2976 VisitForAccumulatorValue(super_ref->home_object()); |
| 2979 __ mov(scratch, v0); | 2977 __ mov(scratch, v0); |
| 2980 VisitForAccumulatorValue(super_ref->this_var()); | 2978 VisitForAccumulatorValue(super_ref->this_var()); |
| 2981 __ Push(scratch, v0, v0, scratch); | 2979 __ Push(scratch, v0, v0, scratch); |
| 2982 __ Push(key->value()); | 2980 __ Push(key->value()); |
| 2983 __ Push(Smi::FromInt(language_mode())); | |
| 2984 | 2981 |
| 2985 // Stack here: | 2982 // Stack here: |
| 2986 // - home_object | 2983 // - home_object |
| 2987 // - this (receiver) | 2984 // - this (receiver) |
| 2988 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2985 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 2989 // - home_object | 2986 // - home_object |
| 2990 // - key | 2987 // - key |
| 2991 // - language_mode | 2988 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
| 2992 __ CallRuntime(Runtime::kLoadFromSuper, 4); | |
| 2993 | 2989 |
| 2994 // Replace home_object with target function. | 2990 // Replace home_object with target function. |
| 2995 __ sd(v0, MemOperand(sp, kPointerSize)); | 2991 __ sd(v0, MemOperand(sp, kPointerSize)); |
| 2996 | 2992 |
| 2997 // Stack here: | 2993 // Stack here: |
| 2998 // - target function | 2994 // - target function |
| 2999 // - this (receiver) | 2995 // - this (receiver) |
| 3000 EmitCall(expr, CallICState::METHOD); | 2996 EmitCall(expr, CallICState::METHOD); |
| 3001 } | 2997 } |
| 3002 | 2998 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 3033 | 3029 |
| 3034 SetSourcePosition(prop->position()); | 3030 SetSourcePosition(prop->position()); |
| 3035 // Load the function from the receiver. | 3031 // Load the function from the receiver. |
| 3036 const Register scratch = a1; | 3032 const Register scratch = a1; |
| 3037 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 3033 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 3038 VisitForAccumulatorValue(super_ref->home_object()); | 3034 VisitForAccumulatorValue(super_ref->home_object()); |
| 3039 __ Move(scratch, v0); | 3035 __ Move(scratch, v0); |
| 3040 VisitForAccumulatorValue(super_ref->this_var()); | 3036 VisitForAccumulatorValue(super_ref->this_var()); |
| 3041 __ Push(scratch, v0, v0, scratch); | 3037 __ Push(scratch, v0, v0, scratch); |
| 3042 VisitForStackValue(prop->key()); | 3038 VisitForStackValue(prop->key()); |
| 3043 __ Push(Smi::FromInt(language_mode())); | |
| 3044 | 3039 |
| 3045 // Stack here: | 3040 // Stack here: |
| 3046 // - home_object | 3041 // - home_object |
| 3047 // - this (receiver) | 3042 // - this (receiver) |
| 3048 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 3043 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 3049 // - home_object | 3044 // - home_object |
| 3050 // - key | 3045 // - key |
| 3051 // - language_mode | 3046 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); |
| 3052 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); | |
| 3053 | 3047 |
| 3054 // Replace home_object with target function. | 3048 // Replace home_object with target function. |
| 3055 __ sd(v0, MemOperand(sp, kPointerSize)); | 3049 __ sd(v0, MemOperand(sp, kPointerSize)); |
| 3056 | 3050 |
| 3057 // Stack here: | 3051 // Stack here: |
| 3058 // - target function | 3052 // - target function |
| 3059 // - this (receiver) | 3053 // - this (receiver) |
| 3060 EmitCall(expr, CallICState::METHOD); | 3054 EmitCall(expr, CallICState::METHOD); |
| 3061 } | 3055 } |
| 3062 | 3056 |
| (...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5573 reinterpret_cast<uint64_t>( | 5567 reinterpret_cast<uint64_t>( |
| 5574 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5568 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5575 return OSR_AFTER_STACK_CHECK; | 5569 return OSR_AFTER_STACK_CHECK; |
| 5576 } | 5570 } |
| 5577 | 5571 |
| 5578 | 5572 |
| 5579 } // namespace internal | 5573 } // namespace internal |
| 5580 } // namespace v8 | 5574 } // namespace v8 |
| 5581 | 5575 |
| 5582 #endif // V8_TARGET_ARCH_MIPS64 | 5576 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |