| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 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 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2086 | 2086 |
| 2087 | 2087 |
| 2088 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2088 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2089 SetExpressionPosition(prop); | 2089 SetExpressionPosition(prop); |
| 2090 Literal* key = prop->key()->AsLiteral(); | 2090 Literal* key = prop->key()->AsLiteral(); |
| 2091 DCHECK(!prop->IsSuperAccess()); | 2091 DCHECK(!prop->IsSuperAccess()); |
| 2092 | 2092 |
| 2093 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2093 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2094 __ li(LoadDescriptor::SlotRegister(), | 2094 __ li(LoadDescriptor::SlotRegister(), |
| 2095 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2095 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2096 CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); | 2096 CallLoadIC(NOT_INSIDE_TYPEOF); |
| 2097 } | 2097 } |
| 2098 | 2098 |
| 2099 | 2099 |
| 2100 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2100 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2101 // Stack: receiver, home_object. | 2101 // Stack: receiver, home_object. |
| 2102 SetExpressionPosition(prop); | 2102 SetExpressionPosition(prop); |
| 2103 | 2103 |
| 2104 Literal* key = prop->key()->AsLiteral(); | 2104 Literal* key = prop->key()->AsLiteral(); |
| 2105 DCHECK(!key->value()->IsSmi()); | 2105 DCHECK(!key->value()->IsSmi()); |
| 2106 DCHECK(prop->IsSuperAccess()); | 2106 DCHECK(prop->IsSuperAccess()); |
| 2107 | 2107 |
| 2108 __ Push(key->value()); | 2108 __ Push(key->value()); |
| 2109 __ Push(Smi::FromInt(language_mode())); | |
| 2110 __ CallRuntime(Runtime::kLoadFromSuper); | 2109 __ CallRuntime(Runtime::kLoadFromSuper); |
| 2111 } | 2110 } |
| 2112 | 2111 |
| 2113 | 2112 |
| 2114 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2113 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2115 SetExpressionPosition(prop); | 2114 SetExpressionPosition(prop); |
| 2116 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2115 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2117 __ li(LoadDescriptor::SlotRegister(), | 2116 __ li(LoadDescriptor::SlotRegister(), |
| 2118 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2117 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2119 CallIC(ic); | 2118 CallIC(ic); |
| 2120 } | 2119 } |
| 2121 | 2120 |
| 2122 | 2121 |
| 2123 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2122 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2124 // Stack: receiver, home_object, key. | 2123 // Stack: receiver, home_object, key. |
| 2125 SetExpressionPosition(prop); | 2124 SetExpressionPosition(prop); |
| 2126 __ Push(Smi::FromInt(language_mode())); | |
| 2127 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2125 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
| 2128 } | 2126 } |
| 2129 | 2127 |
| 2130 | 2128 |
| 2131 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2129 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2132 Token::Value op, | 2130 Token::Value op, |
| 2133 Expression* left_expr, | 2131 Expression* left_expr, |
| 2134 Expression* right_expr) { | 2132 Expression* right_expr) { |
| 2135 Label done, smi_case, stub_call; | 2133 Label done, smi_case, stub_call; |
| 2136 | 2134 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 Literal* key = prop->key()->AsLiteral(); | 2637 Literal* key = prop->key()->AsLiteral(); |
| 2640 DCHECK(!key->value()->IsSmi()); | 2638 DCHECK(!key->value()->IsSmi()); |
| 2641 // Load the function from the receiver. | 2639 // Load the function from the receiver. |
| 2642 const Register scratch = a1; | 2640 const Register scratch = a1; |
| 2643 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2641 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2644 VisitForAccumulatorValue(super_ref->home_object()); | 2642 VisitForAccumulatorValue(super_ref->home_object()); |
| 2645 __ mov(scratch, v0); | 2643 __ mov(scratch, v0); |
| 2646 VisitForAccumulatorValue(super_ref->this_var()); | 2644 VisitForAccumulatorValue(super_ref->this_var()); |
| 2647 __ Push(scratch, v0, v0, scratch); | 2645 __ Push(scratch, v0, v0, scratch); |
| 2648 __ Push(key->value()); | 2646 __ Push(key->value()); |
| 2649 __ Push(Smi::FromInt(language_mode())); | |
| 2650 | 2647 |
| 2651 // Stack here: | 2648 // Stack here: |
| 2652 // - home_object | 2649 // - home_object |
| 2653 // - this (receiver) | 2650 // - this (receiver) |
| 2654 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2651 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 2655 // - home_object | 2652 // - home_object |
| 2656 // - key | 2653 // - key |
| 2657 // - language_mode | |
| 2658 __ CallRuntime(Runtime::kLoadFromSuper); | 2654 __ CallRuntime(Runtime::kLoadFromSuper); |
| 2659 | 2655 |
| 2660 // Replace home_object with target function. | 2656 // Replace home_object with target function. |
| 2661 __ sw(v0, MemOperand(sp, kPointerSize)); | 2657 __ sw(v0, MemOperand(sp, kPointerSize)); |
| 2662 | 2658 |
| 2663 // Stack here: | 2659 // Stack here: |
| 2664 // - target function | 2660 // - target function |
| 2665 // - this (receiver) | 2661 // - this (receiver) |
| 2666 EmitCall(expr); | 2662 EmitCall(expr); |
| 2667 } | 2663 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2699 | 2695 |
| 2700 SetExpressionPosition(prop); | 2696 SetExpressionPosition(prop); |
| 2701 // Load the function from the receiver. | 2697 // Load the function from the receiver. |
| 2702 const Register scratch = a1; | 2698 const Register scratch = a1; |
| 2703 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2699 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2704 VisitForAccumulatorValue(super_ref->home_object()); | 2700 VisitForAccumulatorValue(super_ref->home_object()); |
| 2705 __ Move(scratch, v0); | 2701 __ Move(scratch, v0); |
| 2706 VisitForAccumulatorValue(super_ref->this_var()); | 2702 VisitForAccumulatorValue(super_ref->this_var()); |
| 2707 __ Push(scratch, v0, v0, scratch); | 2703 __ Push(scratch, v0, v0, scratch); |
| 2708 VisitForStackValue(prop->key()); | 2704 VisitForStackValue(prop->key()); |
| 2709 __ Push(Smi::FromInt(language_mode())); | |
| 2710 | 2705 |
| 2711 // Stack here: | 2706 // Stack here: |
| 2712 // - home_object | 2707 // - home_object |
| 2713 // - this (receiver) | 2708 // - this (receiver) |
| 2714 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2709 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 2715 // - home_object | 2710 // - home_object |
| 2716 // - key | 2711 // - key |
| 2717 // - language_mode | |
| 2718 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2712 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
| 2719 | 2713 |
| 2720 // Replace home_object with target function. | 2714 // Replace home_object with target function. |
| 2721 __ sw(v0, MemOperand(sp, kPointerSize)); | 2715 __ sw(v0, MemOperand(sp, kPointerSize)); |
| 2722 | 2716 |
| 2723 // Stack here: | 2717 // Stack here: |
| 2724 // - target function | 2718 // - target function |
| 2725 // - this (receiver) | 2719 // - this (receiver) |
| 2726 EmitCall(expr); | 2720 EmitCall(expr); |
| 2727 } | 2721 } |
| (...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4577 reinterpret_cast<uint32_t>( | 4571 reinterpret_cast<uint32_t>( |
| 4578 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4572 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4579 return OSR_AFTER_STACK_CHECK; | 4573 return OSR_AFTER_STACK_CHECK; |
| 4580 } | 4574 } |
| 4581 | 4575 |
| 4582 | 4576 |
| 4583 } // namespace internal | 4577 } // namespace internal |
| 4584 } // namespace v8 | 4578 } // namespace v8 |
| 4585 | 4579 |
| 4586 #endif // V8_TARGET_ARCH_MIPS | 4580 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |