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

Side by Side Diff: src/mips/lithium-mips.cc

Issue 1304633002: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Add MIPS/MIPS64 ports. Created 5 years, 3 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/mips/lithium-mips.h ('k') | src/mips/macro-assembler-mips.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 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 #include <sstream> 5 #include <sstream>
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/hydrogen-osr.h" 9 #include "src/hydrogen-osr.h"
10 #include "src/lithium-inl.h" 10 #include "src/lithium-inl.h"
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 926 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
927 instr = AssignPointerMap(instr); 927 instr = AssignPointerMap(instr);
928 } 928 }
929 if (FLAG_stress_environments && !instr->HasEnvironment()) { 929 if (FLAG_stress_environments && !instr->HasEnvironment()) {
930 instr = AssignEnvironment(instr); 930 instr = AssignEnvironment(instr);
931 } 931 }
932 chunk_->AddInstruction(instr, current_block_); 932 chunk_->AddInstruction(instr, current_block_);
933 933
934 if (instr->IsCall()) { 934 if (instr->IsCall()) {
935 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; 935 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
936 LInstruction* instruction_needing_environment = NULL;
937 if (hydrogen_val->HasObservableSideEffects()) { 936 if (hydrogen_val->HasObservableSideEffects()) {
938 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); 937 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
939 instruction_needing_environment = instr;
940 sim->ReplayEnvironment(current_block_->last_environment()); 938 sim->ReplayEnvironment(current_block_->last_environment());
941 hydrogen_value_for_lazy_bailout = sim; 939 hydrogen_value_for_lazy_bailout = sim;
942 } 940 }
943 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); 941 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout());
944 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); 942 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
945 chunk_->AddInstruction(bailout, current_block_); 943 chunk_->AddInstruction(bailout, current_block_);
946 if (instruction_needing_environment != NULL) {
947 // Store the lazy deopt environment with the instruction if needed.
948 // Right now it is only used for LInstanceOfKnownGlobal.
949 instruction_needing_environment->
950 SetDeferredLazyDeoptimizationEnvironment(bailout->environment());
951 }
952 } 944 }
953 } 945 }
954 946
955 947
956 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 948 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
957 return new(zone()) LGoto(instr->FirstSuccessor()); 949 return new(zone()) LGoto(instr->FirstSuccessor());
958 } 950 }
959 951
960 952
961 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 953 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
(...skipping 30 matching lines...) Expand all
992 } 984 }
993 985
994 986
995 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { 987 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
996 info()->MarkAsRequiresFrame(); 988 info()->MarkAsRequiresFrame();
997 return DefineAsRegister(new(zone()) LArgumentsElements); 989 return DefineAsRegister(new(zone()) LArgumentsElements);
998 } 990 }
999 991
1000 992
1001 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { 993 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
994 LOperand* left =
995 UseFixed(instr->left(), InstanceOfDescriptor::LeftRegister());
996 LOperand* right =
997 UseFixed(instr->right(), InstanceOfDescriptor::RightRegister());
1002 LOperand* context = UseFixed(instr->context(), cp); 998 LOperand* context = UseFixed(instr->context(), cp);
1003 LInstanceOf* result = 999 LInstanceOf* result = new (zone()) LInstanceOf(context, left, right);
1004 new(zone()) LInstanceOf(context, UseFixed(instr->left(), a0),
1005 UseFixed(instr->right(), a1));
1006 return MarkAsCall(DefineFixed(result, v0), instr); 1000 return MarkAsCall(DefineFixed(result, v0), instr);
1007 } 1001 }
1008 1002
1009 1003
1010 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( 1004 LInstruction* LChunkBuilder::DoHasInPrototypeChainAndBranch(
1011 HInstanceOfKnownGlobal* instr) { 1005 HHasInPrototypeChainAndBranch* instr) {
1012 LInstanceOfKnownGlobal* result = 1006 LOperand* object = UseRegister(instr->object());
1013 new(zone()) LInstanceOfKnownGlobal( 1007 LOperand* prototype = UseRegister(instr->prototype());
1014 UseFixed(instr->context(), cp), 1008 return new (zone()) LHasInPrototypeChainAndBranch(object, prototype);
1015 UseFixed(instr->left(), a0),
1016 FixedTemp(t0));
1017 return MarkAsCall(DefineFixed(result, v0), instr);
1018 } 1009 }
1019 1010
1020 1011
1021 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { 1012 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
1022 LOperand* receiver = UseRegisterAtStart(instr->receiver()); 1013 LOperand* receiver = UseRegisterAtStart(instr->receiver());
1023 LOperand* function = UseRegisterAtStart(instr->function()); 1014 LOperand* function = UseRegisterAtStart(instr->function());
1024 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); 1015 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function);
1025 return AssignEnvironment(DefineAsRegister(result)); 1016 return AssignEnvironment(DefineAsRegister(result));
1026 } 1017 }
1027 1018
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 LOperand* function = UseRegisterAtStart(instr->function()); 2657 LOperand* function = UseRegisterAtStart(instr->function());
2667 LAllocateBlockContext* result = 2658 LAllocateBlockContext* result =
2668 new(zone()) LAllocateBlockContext(context, function); 2659 new(zone()) LAllocateBlockContext(context, function);
2669 return MarkAsCall(DefineFixed(result, cp), instr); 2660 return MarkAsCall(DefineFixed(result, cp), instr);
2670 } 2661 }
2671 2662
2672 } // namespace internal 2663 } // namespace internal
2673 } // namespace v8 2664 } // namespace v8
2674 2665
2675 #endif // V8_TARGET_ARCH_MIPS 2666 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.h ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698