Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 1379933003: Revert of [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/control-flow-builders.h" 10 #include "src/interpreter/control-flow-builders.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 586
587 // TODO(rmcilroy): Deal with possible direct eval here? 587 // TODO(rmcilroy): Deal with possible direct eval here?
588 // TODO(rmcilroy): Use CallIC to allow call type feedback. 588 // TODO(rmcilroy): Use CallIC to allow call type feedback.
589 builder()->Call(callee, receiver, args->length()); 589 builder()->Call(callee, receiver, args->length());
590 } 590 }
591 591
592 592
593 void BytecodeGenerator::VisitCallNew(CallNew* expr) { UNIMPLEMENTED(); } 593 void BytecodeGenerator::VisitCallNew(CallNew* expr) { UNIMPLEMENTED(); }
594 594
595 595
596 void BytecodeGenerator::VisitCallRuntime(CallRuntime* expr) { 596 void BytecodeGenerator::VisitCallRuntime(CallRuntime* expr) { UNIMPLEMENTED(); }
597 if (expr->is_jsruntime()) {
598 UNIMPLEMENTED();
599 }
600
601 // Evaluate all arguments to the runtime call.
602 ZoneList<Expression*>* args = expr->arguments();
603 TemporaryRegisterScope temporary_register_scope(&builder_);
604 // Ensure we always have a valid first_arg register even if there are no
605 // arguments to pass.
606 Register first_arg = temporary_register_scope.NewRegister();
607 for (int i = 0; i < args->length(); ++i) {
608 Register arg =
609 (i == 0) ? first_arg : temporary_register_scope.NewRegister();
610 Visit(args->at(i));
611 DCHECK_EQ(arg.index() - i, first_arg.index());
612 builder()->StoreAccumulatorInRegister(arg);
613 }
614
615 // TODO(rmcilroy): support multiple return values.
616 DCHECK_LE(expr->function()->result_size, 1);
617 Runtime::FunctionId function_id = expr->function()->function_id;
618 builder()->CallRuntime(function_id, first_arg, args->length());
619 }
620 597
621 598
622 void BytecodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 599 void BytecodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
623 UNIMPLEMENTED(); 600 UNIMPLEMENTED();
624 } 601 }
625 602
626 603
627 void BytecodeGenerator::VisitCountOperation(CountOperation* expr) { 604 void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
628 UNIMPLEMENTED(); 605 UNIMPLEMENTED();
629 } 606 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 679 }
703 680
704 681
705 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 682 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
706 return info()->feedback_vector()->GetIndex(slot); 683 return info()->feedback_vector()->GetIndex(slot);
707 } 684 }
708 685
709 } // namespace interpreter 686 } // namespace interpreter
710 } // namespace internal 687 } // namespace internal
711 } // namespace v8 688 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698