| 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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 | 2090 |
| 2091 | 2091 |
| 2092 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2092 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2093 SetExpressionPosition(prop); | 2093 SetExpressionPosition(prop); |
| 2094 Literal* key = prop->key()->AsLiteral(); | 2094 Literal* key = prop->key()->AsLiteral(); |
| 2095 DCHECK(!prop->IsSuperAccess()); | 2095 DCHECK(!prop->IsSuperAccess()); |
| 2096 | 2096 |
| 2097 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2097 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2098 __ li(LoadDescriptor::SlotRegister(), | 2098 __ li(LoadDescriptor::SlotRegister(), |
| 2099 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2099 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2100 CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); | 2100 CallLoadIC(NOT_INSIDE_TYPEOF); |
| 2101 } | 2101 } |
| 2102 | 2102 |
| 2103 | 2103 |
| 2104 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2104 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2105 // Stack: receiver, home_object. | 2105 // Stack: receiver, home_object. |
| 2106 SetExpressionPosition(prop); | 2106 SetExpressionPosition(prop); |
| 2107 | 2107 |
| 2108 Literal* key = prop->key()->AsLiteral(); | 2108 Literal* key = prop->key()->AsLiteral(); |
| 2109 DCHECK(!key->value()->IsSmi()); | 2109 DCHECK(!key->value()->IsSmi()); |
| 2110 DCHECK(prop->IsSuperAccess()); | 2110 DCHECK(prop->IsSuperAccess()); |
| 2111 | 2111 |
| 2112 __ Push(key->value()); | 2112 __ Push(key->value()); |
| 2113 __ Push(Smi::FromInt(language_mode())); | |
| 2114 __ CallRuntime(Runtime::kLoadFromSuper); | 2113 __ CallRuntime(Runtime::kLoadFromSuper); |
| 2115 } | 2114 } |
| 2116 | 2115 |
| 2117 | 2116 |
| 2118 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2117 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2119 // Call keyed load IC. It has register arguments receiver and key. | 2118 // Call keyed load IC. It has register arguments receiver and key. |
| 2120 SetExpressionPosition(prop); | 2119 SetExpressionPosition(prop); |
| 2121 | 2120 |
| 2122 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2121 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2123 __ li(LoadDescriptor::SlotRegister(), | 2122 __ li(LoadDescriptor::SlotRegister(), |
| 2124 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2123 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2125 CallIC(ic); | 2124 CallIC(ic); |
| 2126 } | 2125 } |
| 2127 | 2126 |
| 2128 | 2127 |
| 2129 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2128 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2130 // Stack: receiver, home_object, key. | 2129 // Stack: receiver, home_object, key. |
| 2131 SetExpressionPosition(prop); | 2130 SetExpressionPosition(prop); |
| 2132 __ Push(Smi::FromInt(language_mode())); | |
| 2133 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2131 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
| 2134 } | 2132 } |
| 2135 | 2133 |
| 2136 | 2134 |
| 2137 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2135 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2138 Token::Value op, | 2136 Token::Value op, |
| 2139 Expression* left_expr, | 2137 Expression* left_expr, |
| 2140 Expression* right_expr) { | 2138 Expression* right_expr) { |
| 2141 Label done, smi_case, stub_call; | 2139 Label done, smi_case, stub_call; |
| 2142 | 2140 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 Literal* key = prop->key()->AsLiteral(); | 2643 Literal* key = prop->key()->AsLiteral(); |
| 2646 DCHECK(!key->value()->IsSmi()); | 2644 DCHECK(!key->value()->IsSmi()); |
| 2647 // Load the function from the receiver. | 2645 // Load the function from the receiver. |
| 2648 const Register scratch = a1; | 2646 const Register scratch = a1; |
| 2649 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2647 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2650 VisitForAccumulatorValue(super_ref->home_object()); | 2648 VisitForAccumulatorValue(super_ref->home_object()); |
| 2651 __ mov(scratch, v0); | 2649 __ mov(scratch, v0); |
| 2652 VisitForAccumulatorValue(super_ref->this_var()); | 2650 VisitForAccumulatorValue(super_ref->this_var()); |
| 2653 __ Push(scratch, v0, v0, scratch); | 2651 __ Push(scratch, v0, v0, scratch); |
| 2654 __ Push(key->value()); | 2652 __ Push(key->value()); |
| 2655 __ Push(Smi::FromInt(language_mode())); | |
| 2656 | 2653 |
| 2657 // Stack here: | 2654 // Stack here: |
| 2658 // - home_object | 2655 // - home_object |
| 2659 // - this (receiver) | 2656 // - this (receiver) |
| 2660 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2657 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 2661 // - home_object | 2658 // - home_object |
| 2662 // - key | 2659 // - key |
| 2663 // - language_mode | |
| 2664 __ CallRuntime(Runtime::kLoadFromSuper); | 2660 __ CallRuntime(Runtime::kLoadFromSuper); |
| 2665 | 2661 |
| 2666 // Replace home_object with target function. | 2662 // Replace home_object with target function. |
| 2667 __ sd(v0, MemOperand(sp, kPointerSize)); | 2663 __ sd(v0, MemOperand(sp, kPointerSize)); |
| 2668 | 2664 |
| 2669 // Stack here: | 2665 // Stack here: |
| 2670 // - target function | 2666 // - target function |
| 2671 // - this (receiver) | 2667 // - this (receiver) |
| 2672 EmitCall(expr); | 2668 EmitCall(expr); |
| 2673 } | 2669 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 | 2701 |
| 2706 SetExpressionPosition(prop); | 2702 SetExpressionPosition(prop); |
| 2707 // Load the function from the receiver. | 2703 // Load the function from the receiver. |
| 2708 const Register scratch = a1; | 2704 const Register scratch = a1; |
| 2709 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2705 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2710 VisitForAccumulatorValue(super_ref->home_object()); | 2706 VisitForAccumulatorValue(super_ref->home_object()); |
| 2711 __ Move(scratch, v0); | 2707 __ Move(scratch, v0); |
| 2712 VisitForAccumulatorValue(super_ref->this_var()); | 2708 VisitForAccumulatorValue(super_ref->this_var()); |
| 2713 __ Push(scratch, v0, v0, scratch); | 2709 __ Push(scratch, v0, v0, scratch); |
| 2714 VisitForStackValue(prop->key()); | 2710 VisitForStackValue(prop->key()); |
| 2715 __ Push(Smi::FromInt(language_mode())); | |
| 2716 | 2711 |
| 2717 // Stack here: | 2712 // Stack here: |
| 2718 // - home_object | 2713 // - home_object |
| 2719 // - this (receiver) | 2714 // - this (receiver) |
| 2720 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2715 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 2721 // - home_object | 2716 // - home_object |
| 2722 // - key | 2717 // - key |
| 2723 // - language_mode | |
| 2724 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2718 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
| 2725 | 2719 |
| 2726 // Replace home_object with target function. | 2720 // Replace home_object with target function. |
| 2727 __ sd(v0, MemOperand(sp, kPointerSize)); | 2721 __ sd(v0, MemOperand(sp, kPointerSize)); |
| 2728 | 2722 |
| 2729 // Stack here: | 2723 // Stack here: |
| 2730 // - target function | 2724 // - target function |
| 2731 // - this (receiver) | 2725 // - this (receiver) |
| 2732 EmitCall(expr); | 2726 EmitCall(expr); |
| 2733 } | 2727 } |
| (...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4592 reinterpret_cast<uint64_t>( | 4586 reinterpret_cast<uint64_t>( |
| 4593 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4587 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4594 return OSR_AFTER_STACK_CHECK; | 4588 return OSR_AFTER_STACK_CHECK; |
| 4595 } | 4589 } |
| 4596 | 4590 |
| 4597 | 4591 |
| 4598 } // namespace internal | 4592 } // namespace internal |
| 4599 } // namespace v8 | 4593 } // namespace v8 |
| 4600 | 4594 |
| 4601 #endif // V8_TARGET_ARCH_MIPS64 | 4595 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |