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

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

Issue 1318663003: X87: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/x87/lithium-x87.h ('k') | src/x87/macro-assembler-x87.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_X87 7 #if V8_TARGET_ARCH_X87
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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 // x87 register alive. To ensure all other values are still spilled, we 973 // x87 register alive. To ensure all other values are still spilled, we
974 // insert a fpu register barrier right before. 974 // insert a fpu register barrier right before.
975 LClobberDoubles* clobber = new(zone()) LClobberDoubles(isolate()); 975 LClobberDoubles* clobber = new(zone()) LClobberDoubles(isolate());
976 clobber->set_hydrogen_value(hydrogen_val); 976 clobber->set_hydrogen_value(hydrogen_val);
977 chunk_->AddInstruction(clobber, current_block_); 977 chunk_->AddInstruction(clobber, current_block_);
978 } 978 }
979 chunk_->AddInstruction(instr, current_block_); 979 chunk_->AddInstruction(instr, current_block_);
980 980
981 if (instr->IsCall()) { 981 if (instr->IsCall()) {
982 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; 982 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
983 LInstruction* instruction_needing_environment = NULL;
984 if (hydrogen_val->HasObservableSideEffects()) { 983 if (hydrogen_val->HasObservableSideEffects()) {
985 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); 984 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
986 instruction_needing_environment = instr;
987 sim->ReplayEnvironment(current_block_->last_environment()); 985 sim->ReplayEnvironment(current_block_->last_environment());
988 hydrogen_value_for_lazy_bailout = sim; 986 hydrogen_value_for_lazy_bailout = sim;
989 } 987 }
990 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); 988 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout());
991 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); 989 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
992 chunk_->AddInstruction(bailout, current_block_); 990 chunk_->AddInstruction(bailout, current_block_);
993 if (instruction_needing_environment != NULL) {
994 // Store the lazy deopt environment with the instruction if needed.
995 // Right now it is only used for LInstanceOfKnownGlobal.
996 instruction_needing_environment->
997 SetDeferredLazyDeoptimizationEnvironment(bailout->environment());
998 }
999 } 991 }
1000 } 992 }
1001 993
1002 994
1003 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 995 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1004 return new(zone()) LGoto(instr->FirstSuccessor()); 996 return new(zone()) LGoto(instr->FirstSuccessor());
1005 } 997 }
1006 998
1007 999
1008 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 1000 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 } 1037 }
1046 1038
1047 1039
1048 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { 1040 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
1049 info()->MarkAsRequiresFrame(); 1041 info()->MarkAsRequiresFrame();
1050 return DefineAsRegister(new(zone()) LArgumentsElements); 1042 return DefineAsRegister(new(zone()) LArgumentsElements);
1051 } 1043 }
1052 1044
1053 1045
1054 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { 1046 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1055 LOperand* left = UseFixed(instr->left(), InstanceofStub::left()); 1047 LOperand* left =
1056 LOperand* right = UseFixed(instr->right(), InstanceofStub::right()); 1048 UseFixed(instr->left(), InstanceOfDescriptor::LeftRegister());
1049 LOperand* right =
1050 UseFixed(instr->right(), InstanceOfDescriptor::RightRegister());
1057 LOperand* context = UseFixed(instr->context(), esi); 1051 LOperand* context = UseFixed(instr->context(), esi);
1058 LInstanceOf* result = new(zone()) LInstanceOf(context, left, right); 1052 LInstanceOf* result = new (zone()) LInstanceOf(context, left, right);
1059 return MarkAsCall(DefineFixed(result, eax), instr); 1053 return MarkAsCall(DefineFixed(result, eax), instr);
1060 } 1054 }
1061 1055
1062 1056
1063 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( 1057 LInstruction* LChunkBuilder::DoHasInPrototypeChainAndBranch(
1064 HInstanceOfKnownGlobal* instr) { 1058 HHasInPrototypeChainAndBranch* instr) {
1065 LInstanceOfKnownGlobal* result = 1059 LOperand* object = UseRegister(instr->object());
1066 new(zone()) LInstanceOfKnownGlobal( 1060 LOperand* prototype = UseRegister(instr->prototype());
1067 UseFixed(instr->context(), esi), 1061 LOperand* temp = TempRegister();
1068 UseFixed(instr->left(), InstanceofStub::left()), 1062 return new (zone()) LHasInPrototypeChainAndBranch(object, prototype, temp);
1069 FixedTemp(edi));
1070 return MarkAsCall(DefineFixed(result, eax), instr);
1071 } 1063 }
1072 1064
1073 1065
1074 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { 1066 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
1075 LOperand* receiver = UseRegister(instr->receiver()); 1067 LOperand* receiver = UseRegister(instr->receiver());
1076 LOperand* function = UseRegister(instr->function()); 1068 LOperand* function = UseRegister(instr->function());
1077 LOperand* temp = TempRegister(); 1069 LOperand* temp = TempRegister();
1078 LWrapReceiver* result = 1070 LWrapReceiver* result =
1079 new(zone()) LWrapReceiver(receiver, function, temp); 1071 new(zone()) LWrapReceiver(receiver, function, temp);
1080 return AssignEnvironment(DefineSameAsFirst(result)); 1072 return AssignEnvironment(DefineSameAsFirst(result));
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 LAllocateBlockContext* result = 2772 LAllocateBlockContext* result =
2781 new(zone()) LAllocateBlockContext(context, function); 2773 new(zone()) LAllocateBlockContext(context, function);
2782 return MarkAsCall(DefineFixed(result, esi), instr); 2774 return MarkAsCall(DefineFixed(result, esi), instr);
2783 } 2775 }
2784 2776
2785 2777
2786 } // namespace internal 2778 } // namespace internal
2787 } // namespace v8 2779 } // namespace v8
2788 2780
2789 #endif // V8_TARGET_ARCH_X87 2781 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/lithium-x87.h ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698