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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 2085823003: Revert of [Interpreter] Map runtime id's to intrinsic id's in InvokeIntrinsic bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecode-array-iterator.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-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/interpreter/bytecode-array-writer.h" 8 #include "src/interpreter/bytecode-array-writer.h"
9 #include "src/interpreter/bytecode-label.h" 9 #include "src/interpreter/bytecode-label.h"
10 #include "src/interpreter/bytecode-peephole-optimizer.h" 10 #include "src/interpreter/bytecode-peephole-optimizer.h"
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 566 }
567 567
568 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( 568 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
569 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { 569 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) {
570 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); 570 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size);
571 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); 571 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort);
572 if (!first_arg.is_valid()) { 572 if (!first_arg.is_valid()) {
573 DCHECK_EQ(0u, arg_count); 573 DCHECK_EQ(0u, arg_count);
574 first_arg = Register(0); 574 first_arg = Register(0);
575 } 575 }
576 Bytecode bytecode; 576 Bytecode bytecode = IntrinsicsHelper::IsSupported(function_id)
577 uint32_t id; 577 ? Bytecode::kInvokeIntrinsic
578 if (IntrinsicsHelper::IsSupported(function_id)) { 578 : Bytecode::kCallRuntime;
579 bytecode = Bytecode::kInvokeIntrinsic; 579 Output(bytecode, static_cast<uint16_t>(function_id),
580 id = static_cast<uint32_t>(IntrinsicsHelper::FromRuntimeId(function_id)); 580 RegisterOperand(first_arg), UnsignedOperand(arg_count));
581 } else {
582 bytecode = Bytecode::kCallRuntime;
583 id = static_cast<uint32_t>(function_id);
584 }
585 Output(bytecode, id, RegisterOperand(first_arg), UnsignedOperand(arg_count));
586 return *this; 581 return *this;
587 } 582 }
588 583
589 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntimeForPair( 584 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntimeForPair(
590 Runtime::FunctionId function_id, Register first_arg, size_t arg_count, 585 Runtime::FunctionId function_id, Register first_arg, size_t arg_count,
591 Register first_return) { 586 Register first_return) {
592 DCHECK_EQ(2, Runtime::FunctionForId(function_id)->result_size); 587 DCHECK_EQ(2, Runtime::FunctionForId(function_id)->result_size);
593 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); 588 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort);
594 if (!first_arg.is_valid()) { 589 if (!first_arg.is_valid()) {
595 DCHECK_EQ(0u, arg_count); 590 DCHECK_EQ(0u, arg_count);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 if (i > 0 && operands[i] > 0) { 684 if (i > 0 && operands[i] > 0) {
690 Register start = Register::FromOperand(operands[i - 1]); 685 Register start = Register::FromOperand(operands[i - 1]);
691 Register end(start.index() + static_cast<int>(operands[i]) - 1); 686 Register end(start.index() + static_cast<int>(operands[i]) - 1);
692 if (!RegisterIsValid(start) || !RegisterIsValid(end) || start > end) { 687 if (!RegisterIsValid(start) || !RegisterIsValid(end) || start > end) {
693 return false; 688 return false;
694 } 689 }
695 } 690 }
696 break; 691 break;
697 } 692 }
698 case OperandType::kFlag8: 693 case OperandType::kFlag8:
699 case OperandType::kIntrinsicId:
700 if (Bytecodes::SizeForUnsignedOperand(operands[i]) > 694 if (Bytecodes::SizeForUnsignedOperand(operands[i]) >
701 OperandSize::kByte) { 695 OperandSize::kByte) {
702 return false; 696 return false;
703 } 697 }
704 break; 698 break;
705 case OperandType::kRuntimeId: 699 case OperandType::kRuntimeId:
706 if (Bytecodes::SizeForUnsignedOperand(operands[i]) > 700 if (Bytecodes::SizeForUnsignedOperand(operands[i]) >
707 OperandSize::kShort) { 701 OperandSize::kShort) {
708 return false; 702 return false;
709 } 703 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 return Bytecode::kTailCall; 917 return Bytecode::kTailCall;
924 default: 918 default:
925 UNREACHABLE(); 919 UNREACHABLE();
926 } 920 }
927 return Bytecode::kIllegal; 921 return Bytecode::kIllegal;
928 } 922 }
929 923
930 } // namespace interpreter 924 } // namespace interpreter
931 } // namespace internal 925 } // namespace internal
932 } // namespace v8 926 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecode-array-iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698