| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 4605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4616 ExternalReference debug_is_active = | 4616 ExternalReference debug_is_active = |
| 4617 ExternalReference::debug_is_active_address(isolate()); | 4617 ExternalReference::debug_is_active_address(isolate()); |
| 4618 __ mov(ip, Operand(debug_is_active)); | 4618 __ mov(ip, Operand(debug_is_active)); |
| 4619 __ lbz(r3, MemOperand(ip)); | 4619 __ lbz(r3, MemOperand(ip)); |
| 4620 __ SmiTag(r3); | 4620 __ SmiTag(r3); |
| 4621 context()->Plug(r3); | 4621 context()->Plug(r3); |
| 4622 } | 4622 } |
| 4623 | 4623 |
| 4624 | 4624 |
| 4625 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4625 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
| 4626 InlineFunctionGenerator generator = FindInlineFunctionGenerator(expr); | |
| 4627 if (generator != nullptr) { | |
| 4628 Comment cmnt(masm_, "[ InlineRuntimeCall"); | |
| 4629 EmitInlineRuntimeCall(expr, generator); | |
| 4630 return; | |
| 4631 } | |
| 4632 | |
| 4633 Comment cmnt(masm_, "[ CallRuntime"); | |
| 4634 ZoneList<Expression*>* args = expr->arguments(); | 4626 ZoneList<Expression*>* args = expr->arguments(); |
| 4635 int arg_count = args->length(); | 4627 int arg_count = args->length(); |
| 4636 | 4628 |
| 4637 if (expr->is_jsruntime()) { | 4629 if (expr->is_jsruntime()) { |
| 4630 Comment cmnt(masm_, "[ CallRuntime"); |
| 4638 // Push the builtins object as the receiver. | 4631 // Push the builtins object as the receiver. |
| 4639 Register receiver = LoadDescriptor::ReceiverRegister(); | 4632 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 4640 __ LoadP(receiver, GlobalObjectOperand()); | 4633 __ LoadP(receiver, GlobalObjectOperand()); |
| 4641 __ LoadP(receiver, | 4634 __ LoadP(receiver, |
| 4642 FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); | 4635 FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); |
| 4643 __ push(receiver); | 4636 __ push(receiver); |
| 4644 | 4637 |
| 4645 // Load the function from the receiver. | 4638 // Load the function from the receiver. |
| 4646 __ mov(LoadDescriptor::NameRegister(), Operand(expr->name())); | 4639 __ mov(LoadDescriptor::NameRegister(), Operand(expr->name())); |
| 4647 if (FLAG_vector_ics) { | 4640 if (FLAG_vector_ics) { |
| 4648 __ mov(VectorLoadICDescriptor::SlotRegister(), | 4641 __ mov(VectorLoadICDescriptor::SlotRegister(), |
| 4649 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot()))); | 4642 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot()))); |
| 4650 CallLoadIC(NOT_CONTEXTUAL); | 4643 CallLoadIC(NOT_CONTEXTUAL); |
| 4651 } else { | 4644 } else { |
| 4652 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 4645 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
| 4653 } | 4646 } |
| 4654 | 4647 |
| 4655 // Push the target function under the receiver. | 4648 // Push the target function under the receiver. |
| 4656 __ LoadP(ip, MemOperand(sp, 0)); | 4649 __ LoadP(ip, MemOperand(sp, 0)); |
| 4657 __ push(ip); | 4650 __ push(ip); |
| 4658 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 4651 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 4659 | 4652 |
| 4660 // Push the arguments ("left-to-right"). | 4653 // Push the arguments ("left-to-right"). |
| 4661 int arg_count = args->length(); | |
| 4662 for (int i = 0; i < arg_count; i++) { | 4654 for (int i = 0; i < arg_count; i++) { |
| 4663 VisitForStackValue(args->at(i)); | 4655 VisitForStackValue(args->at(i)); |
| 4664 } | 4656 } |
| 4665 | 4657 |
| 4666 // Record source position of the IC call. | 4658 // Record source position of the IC call. |
| 4667 SetSourcePosition(expr->position()); | 4659 SetSourcePosition(expr->position()); |
| 4668 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); | 4660 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
| 4669 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 4661 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
| 4670 __ CallStub(&stub); | 4662 __ CallStub(&stub); |
| 4671 | 4663 |
| 4672 // Restore context register. | 4664 // Restore context register. |
| 4673 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 4665 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 4674 | 4666 |
| 4675 context()->DropAndPlug(1, r3); | 4667 context()->DropAndPlug(1, r3); |
| 4668 |
| 4676 } else { | 4669 } else { |
| 4677 // Push the arguments ("left-to-right"). | 4670 const Runtime::Function* function = expr->function(); |
| 4678 for (int i = 0; i < arg_count; i++) { | 4671 switch (function->function_id) { |
| 4679 VisitForStackValue(args->at(i)); | 4672 #define CALL_INTRINSIC_GENERATOR(Name) \ |
| 4673 case Runtime::kInline##Name: { \ |
| 4674 Comment cmnt(masm_, "[ Inline" #Name); \ |
| 4675 return Emit##Name(expr); \ |
| 4676 } |
| 4677 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) |
| 4678 #undef CALL_INTRINSIC_GENERATOR |
| 4679 default: { |
| 4680 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); |
| 4681 // Push the arguments ("left-to-right"). |
| 4682 for (int i = 0; i < arg_count; i++) { |
| 4683 VisitForStackValue(args->at(i)); |
| 4684 } |
| 4685 |
| 4686 // Call the C runtime function. |
| 4687 __ CallRuntime(expr->function(), arg_count); |
| 4688 context()->Plug(r3); |
| 4689 } |
| 4680 } | 4690 } |
| 4681 | |
| 4682 // Call the C runtime function. | |
| 4683 __ CallRuntime(expr->function(), arg_count); | |
| 4684 context()->Plug(r3); | |
| 4685 } | 4691 } |
| 4686 } | 4692 } |
| 4687 | 4693 |
| 4688 | 4694 |
| 4689 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4695 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 4690 switch (expr->op()) { | 4696 switch (expr->op()) { |
| 4691 case Token::DELETE: { | 4697 case Token::DELETE: { |
| 4692 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 4698 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
| 4693 Property* property = expr->expression()->AsProperty(); | 4699 Property* property = expr->expression()->AsProperty(); |
| 4694 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 4700 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5468 return ON_STACK_REPLACEMENT; | 5474 return ON_STACK_REPLACEMENT; |
| 5469 } | 5475 } |
| 5470 | 5476 |
| 5471 DCHECK(interrupt_address == | 5477 DCHECK(interrupt_address == |
| 5472 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5478 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5473 return OSR_AFTER_STACK_CHECK; | 5479 return OSR_AFTER_STACK_CHECK; |
| 5474 } | 5480 } |
| 5475 } | 5481 } |
| 5476 } // namespace v8::internal | 5482 } // namespace v8::internal |
| 5477 #endif // V8_TARGET_ARCH_PPC | 5483 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |