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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 if (true_label_ != fall_through_) __ Branch(true_label_); | 544 if (true_label_ != fall_through_) __ Branch(true_label_); |
545 } | 545 } |
546 } else { | 546 } else { |
547 // For simplicity we always test the accumulator register. | 547 // For simplicity we always test the accumulator register. |
548 __ li(result_register(), Operand(lit)); | 548 __ li(result_register(), Operand(lit)); |
549 codegen()->DoTest(this); | 549 codegen()->DoTest(this); |
550 } | 550 } |
551 } | 551 } |
552 | 552 |
553 | 553 |
554 void FullCodeGenerator::EffectContext::DropAndPlug(int count, | |
555 Register reg) const { | |
556 DCHECK(count > 0); | |
557 __ Drop(count); | |
558 } | |
559 | |
560 | |
561 void FullCodeGenerator::AccumulatorValueContext::DropAndPlug( | |
562 int count, | |
563 Register reg) const { | |
564 DCHECK(count > 0); | |
565 __ Drop(count); | |
566 __ Move(result_register(), reg); | |
567 } | |
568 | |
569 | |
570 void FullCodeGenerator::StackValueContext::DropAndPlug(int count, | 554 void FullCodeGenerator::StackValueContext::DropAndPlug(int count, |
571 Register reg) const { | 555 Register reg) const { |
572 DCHECK(count > 0); | 556 DCHECK(count > 0); |
573 if (count > 1) __ Drop(count - 1); | 557 if (count > 1) __ Drop(count - 1); |
574 __ sd(reg, MemOperand(sp, 0)); | 558 __ sd(reg, MemOperand(sp, 0)); |
575 } | 559 } |
576 | 560 |
577 | 561 |
578 void FullCodeGenerator::TestContext::DropAndPlug(int count, | |
579 Register reg) const { | |
580 DCHECK(count > 0); | |
581 // For simplicity we always test the accumulator register. | |
582 __ Drop(count); | |
583 __ Move(result_register(), reg); | |
584 codegen()->PrepareForBailoutBeforeSplit(condition(), false, NULL, NULL); | |
585 codegen()->DoTest(this); | |
586 } | |
587 | |
588 | |
589 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true, | 562 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true, |
590 Label* materialize_false) const { | 563 Label* materialize_false) const { |
591 DCHECK(materialize_true == materialize_false); | 564 DCHECK(materialize_true == materialize_false); |
592 __ bind(materialize_true); | 565 __ bind(materialize_true); |
593 } | 566 } |
594 | 567 |
595 | 568 |
596 void FullCodeGenerator::AccumulatorValueContext::Plug( | 569 void FullCodeGenerator::AccumulatorValueContext::Plug( |
597 Label* materialize_true, | 570 Label* materialize_true, |
598 Label* materialize_false) const { | 571 Label* materialize_false) const { |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2094 Literal* key = prop->key()->AsLiteral(); | 2067 Literal* key = prop->key()->AsLiteral(); |
2095 DCHECK(!prop->IsSuperAccess()); | 2068 DCHECK(!prop->IsSuperAccess()); |
2096 | 2069 |
2097 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2070 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
2098 __ li(LoadDescriptor::SlotRegister(), | 2071 __ li(LoadDescriptor::SlotRegister(), |
2099 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2072 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2100 CallLoadIC(NOT_INSIDE_TYPEOF); | 2073 CallLoadIC(NOT_INSIDE_TYPEOF); |
2101 } | 2074 } |
2102 | 2075 |
2103 | 2076 |
2104 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | |
2105 // Stack: receiver, home_object. | |
2106 SetExpressionPosition(prop); | |
2107 | |
2108 Literal* key = prop->key()->AsLiteral(); | |
2109 DCHECK(!key->value()->IsSmi()); | |
2110 DCHECK(prop->IsSuperAccess()); | |
2111 | |
2112 __ Push(key->value()); | |
2113 __ CallRuntime(Runtime::kLoadFromSuper); | |
2114 } | |
2115 | |
2116 | |
2117 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | |
2118 // Call keyed load IC. It has register arguments receiver and key. | |
2119 SetExpressionPosition(prop); | |
2120 | |
2121 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | |
2122 __ li(LoadDescriptor::SlotRegister(), | |
2123 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | |
2124 CallIC(ic); | |
2125 } | |
2126 | |
2127 | |
2128 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | |
2129 // Stack: receiver, home_object, key. | |
2130 SetExpressionPosition(prop); | |
2131 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | |
2132 } | |
2133 | |
2134 | |
2135 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2077 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2136 Token::Value op, | 2078 Token::Value op, |
2137 Expression* left_expr, | 2079 Expression* left_expr, |
2138 Expression* right_expr) { | 2080 Expression* right_expr) { |
2139 Label done, smi_case, stub_call; | 2081 Label done, smi_case, stub_call; |
2140 | 2082 |
2141 Register scratch1 = a2; | 2083 Register scratch1 = a2; |
2142 Register scratch2 = a3; | 2084 Register scratch2 = a3; |
2143 | 2085 |
2144 // Get the arguments. | 2086 // Get the arguments. |
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4281 reinterpret_cast<uint64_t>( | 4223 reinterpret_cast<uint64_t>( |
4282 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4224 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4283 return OSR_AFTER_STACK_CHECK; | 4225 return OSR_AFTER_STACK_CHECK; |
4284 } | 4226 } |
4285 | 4227 |
4286 | 4228 |
4287 } // namespace internal | 4229 } // namespace internal |
4288 } // namespace v8 | 4230 } // namespace v8 |
4289 | 4231 |
4290 #endif // V8_TARGET_ARCH_MIPS64 | 4232 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |