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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2007023003: [interpreter] Address naming inconsistencies in bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0056-register-only
Patch Set: Rebase. 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
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/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 Node* constant_index = __ BytecodeOperandIdx(1); 586 Node* constant_index = __ BytecodeOperandIdx(1);
587 Node* name = __ LoadConstantPoolEntry(constant_index); 587 Node* name = __ LoadConstantPoolEntry(constant_index);
588 Node* raw_slot = __ BytecodeOperandIdx(2); 588 Node* raw_slot = __ BytecodeOperandIdx(2);
589 Node* smi_slot = __ SmiTag(raw_slot); 589 Node* smi_slot = __ SmiTag(raw_slot);
590 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 590 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
591 Node* context = __ GetContext(); 591 Node* context = __ GetContext();
592 return __ CallStub(ic.descriptor(), code_target, context, object, name, 592 return __ CallStub(ic.descriptor(), code_target, context, object, name,
593 smi_slot, type_feedback_vector); 593 smi_slot, type_feedback_vector);
594 } 594 }
595 595
596 // LoadIC <object> <name_index> <slot> 596 // LdaNamedProperty <object> <name_index> <slot>
597 // 597 //
598 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at 598 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at
599 // constant pool entry <name_index>. 599 // constant pool entry <name_index>.
600 void Interpreter::DoLoadIC(InterpreterAssembler* assembler) { 600 void Interpreter::DoLdaNamedProperty(InterpreterAssembler* assembler) {
601 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, 601 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
602 UNINITIALIZED); 602 UNINITIALIZED);
603 Node* result = BuildLoadNamedProperty(ic, assembler); 603 Node* result = BuildLoadNamedProperty(ic, assembler);
604 __ SetAccumulator(result); 604 __ SetAccumulator(result);
605 __ Dispatch(); 605 __ Dispatch();
606 } 606 }
607 607
608 // LdrNamedProperty <object> <name_index> <slot> <reg> 608 // LdrNamedProperty <object> <name_index> <slot> <reg>
609 // 609 //
610 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at 610 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at
(...skipping 18 matching lines...) Expand all
629 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 629 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
630 Node* context = __ GetContext(); 630 Node* context = __ GetContext();
631 return __ CallStub(ic.descriptor(), code_target, context, object, name, 631 return __ CallStub(ic.descriptor(), code_target, context, object, name,
632 smi_slot, type_feedback_vector); 632 smi_slot, type_feedback_vector);
633 } 633 }
634 634
635 // KeyedLoadIC <object> <slot> 635 // KeyedLoadIC <object> <slot>
636 // 636 //
637 // Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key 637 // Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key
638 // in the accumulator. 638 // in the accumulator.
639 void Interpreter::DoKeyedLoadIC(InterpreterAssembler* assembler) { 639 void Interpreter::DoLdaKeyedProperty(InterpreterAssembler* assembler) {
640 Callable ic = 640 Callable ic =
641 CodeFactory::KeyedLoadICInOptimizedCode(isolate_, UNINITIALIZED); 641 CodeFactory::KeyedLoadICInOptimizedCode(isolate_, UNINITIALIZED);
642 Node* result = BuildLoadKeyedProperty(ic, assembler); 642 Node* result = BuildLoadKeyedProperty(ic, assembler);
643 __ SetAccumulator(result); 643 __ SetAccumulator(result);
644 __ Dispatch(); 644 __ Dispatch();
645 } 645 }
646 646
647 // LdrKeyedProperty <object> <slot> <reg> 647 // LdrKeyedProperty <object> <slot> <reg>
648 // 648 //
649 // Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key 649 // Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key
(...skipping 16 matching lines...) Expand all
666 Node* value = __ GetAccumulator(); 666 Node* value = __ GetAccumulator();
667 Node* raw_slot = __ BytecodeOperandIdx(2); 667 Node* raw_slot = __ BytecodeOperandIdx(2);
668 Node* smi_slot = __ SmiTag(raw_slot); 668 Node* smi_slot = __ SmiTag(raw_slot);
669 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 669 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
670 Node* context = __ GetContext(); 670 Node* context = __ GetContext();
671 __ CallStub(ic.descriptor(), code_target, context, object, name, value, 671 __ CallStub(ic.descriptor(), code_target, context, object, name, value,
672 smi_slot, type_feedback_vector); 672 smi_slot, type_feedback_vector);
673 __ Dispatch(); 673 __ Dispatch();
674 } 674 }
675 675
676 // StoreICSloppy <object> <name_index> <slot> 676 // StaNamedPropertySloppy <object> <name_index> <slot>
677 // 677 //
678 // Calls the sloppy mode StoreIC at FeedBackVector slot <slot> for <object> and 678 // Calls the sloppy mode StoreIC at FeedBackVector slot <slot> for <object> and
679 // the name in constant pool entry <name_index> with the value in the 679 // the name in constant pool entry <name_index> with the value in the
680 // accumulator. 680 // accumulator.
681 void Interpreter::DoStoreICSloppy(InterpreterAssembler* assembler) { 681 void Interpreter::DoStaNamedPropertySloppy(InterpreterAssembler* assembler) {
682 Callable ic = 682 Callable ic =
683 CodeFactory::StoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED); 683 CodeFactory::StoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
684 DoStoreIC(ic, assembler); 684 DoStoreIC(ic, assembler);
685 } 685 }
686 686
687 // StoreICStrict <object> <name_index> <slot> 687 // StaNamedPropertyStrict <object> <name_index> <slot>
688 // 688 //
689 // Calls the strict mode StoreIC at FeedBackVector slot <slot> for <object> and 689 // Calls the strict mode StoreIC at FeedBackVector slot <slot> for <object> and
690 // the name in constant pool entry <name_index> with the value in the 690 // the name in constant pool entry <name_index> with the value in the
691 // accumulator. 691 // accumulator.
692 void Interpreter::DoStoreICStrict(InterpreterAssembler* assembler) { 692 void Interpreter::DoStaNamedPropertyStrict(InterpreterAssembler* assembler) {
693 Callable ic = 693 Callable ic =
694 CodeFactory::StoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED); 694 CodeFactory::StoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
695 DoStoreIC(ic, assembler); 695 DoStoreIC(ic, assembler);
696 } 696 }
697 697
698 void Interpreter::DoKeyedStoreIC(Callable ic, InterpreterAssembler* assembler) { 698 void Interpreter::DoKeyedStoreIC(Callable ic, InterpreterAssembler* assembler) {
699 Node* code_target = __ HeapConstant(ic.code()); 699 Node* code_target = __ HeapConstant(ic.code());
700 Node* object_reg_index = __ BytecodeOperandReg(0); 700 Node* object_reg_index = __ BytecodeOperandReg(0);
701 Node* object = __ LoadRegister(object_reg_index); 701 Node* object = __ LoadRegister(object_reg_index);
702 Node* name_reg_index = __ BytecodeOperandReg(1); 702 Node* name_reg_index = __ BytecodeOperandReg(1);
703 Node* name = __ LoadRegister(name_reg_index); 703 Node* name = __ LoadRegister(name_reg_index);
704 Node* value = __ GetAccumulator(); 704 Node* value = __ GetAccumulator();
705 Node* raw_slot = __ BytecodeOperandIdx(2); 705 Node* raw_slot = __ BytecodeOperandIdx(2);
706 Node* smi_slot = __ SmiTag(raw_slot); 706 Node* smi_slot = __ SmiTag(raw_slot);
707 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 707 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
708 Node* context = __ GetContext(); 708 Node* context = __ GetContext();
709 __ CallStub(ic.descriptor(), code_target, context, object, name, value, 709 __ CallStub(ic.descriptor(), code_target, context, object, name, value,
710 smi_slot, type_feedback_vector); 710 smi_slot, type_feedback_vector);
711 __ Dispatch(); 711 __ Dispatch();
712 } 712 }
713 713
714 // KeyedStoreICSloppy <object> <key> <slot> 714 // StaKeyedPropertySloppy <object> <key> <slot>
715 // 715 //
716 // Calls the sloppy mode KeyStoreIC at FeedBackVector slot <slot> for <object> 716 // Calls the sloppy mode KeyStoreIC at FeedBackVector slot <slot> for <object>
717 // and the key <key> with the value in the accumulator. 717 // and the key <key> with the value in the accumulator.
718 void Interpreter::DoKeyedStoreICSloppy(InterpreterAssembler* assembler) { 718 void Interpreter::DoStaKeyedPropertySloppy(InterpreterAssembler* assembler) {
719 Callable ic = 719 Callable ic =
720 CodeFactory::KeyedStoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED); 720 CodeFactory::KeyedStoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
721 DoKeyedStoreIC(ic, assembler); 721 DoKeyedStoreIC(ic, assembler);
722 } 722 }
723 723
724 // KeyedStoreICStrict <object> <key> <slot> 724 // StaKeyedPropertyStrict <object> <key> <slot>
725 // 725 //
726 // Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object> 726 // Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object>
727 // and the key <key> with the value in the accumulator. 727 // and the key <key> with the value in the accumulator.
728 void Interpreter::DoKeyedStoreICStrict(InterpreterAssembler* assembler) { 728 void Interpreter::DoStaKeyedPropertyStrict(InterpreterAssembler* assembler) {
729 Callable ic = 729 Callable ic =
730 CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED); 730 CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
731 DoKeyedStoreIC(ic, assembler); 731 DoKeyedStoreIC(ic, assembler);
732 } 732 }
733 733
734 // PushContext <context> 734 // PushContext <context>
735 // 735 //
736 // Saves the current context in <context>, and pushes the accumulator as the 736 // Saves the current context in <context>, and pushes the accumulator as the
737 // new current context. 737 // new current context.
738 void Interpreter::DoPushContext(InterpreterAssembler* assembler) { 738 void Interpreter::DoPushContext(InterpreterAssembler* assembler) {
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 1850 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
1851 __ SmiTag(new_state)); 1851 __ SmiTag(new_state));
1852 __ SetAccumulator(old_state); 1852 __ SetAccumulator(old_state);
1853 1853
1854 __ Dispatch(); 1854 __ Dispatch();
1855 } 1855 }
1856 1856
1857 } // namespace interpreter 1857 } // namespace interpreter
1858 } // namespace internal 1858 } // namespace internal
1859 } // namespace v8 1859 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ArrayLiterals.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698