| OLD | NEW | 
|     1 // Copyright 2012 the V8 project authors. All rights reserved. |     1 // Copyright 2012 the V8 project authors. All rights reserved. | 
 |     2 // | 
 |     3 // Copyright IBM Corp. 2012, 2013. All rights reserved. | 
 |     4 // | 
|     2 // Use of this source code is governed by a BSD-style license that can be |     5 // Use of this source code is governed by a BSD-style license that can be | 
|     3 // found in the LICENSE file. |     6 // found in the LICENSE file. | 
|     4  |     7  | 
|     5 #include "src/v8.h" |     8 #include "src/v8.h" | 
|     6  |     9  | 
|     7 #include "src/arm/lithium-codegen-arm.h" |  | 
|     8 #include "src/hydrogen-osr.h" |    10 #include "src/hydrogen-osr.h" | 
|     9 #include "src/lithium-inl.h" |    11 #include "src/lithium-inl.h" | 
 |    12 #include "src/ppc/lithium-codegen-ppc.h" | 
|    10  |    13  | 
|    11 namespace v8 { |    14 namespace v8 { | 
|    12 namespace internal { |    15 namespace internal { | 
|    13  |    16  | 
|    14 #define DEFINE_COMPILE(type)                            \ |    17 #define DEFINE_COMPILE(type)                            \ | 
|    15   void L##type::CompileToNative(LCodeGen* generator) {  \ |    18   void L##type::CompileToNative(LCodeGen* generator) {  \ | 
|    16     generator->Do##type(this);                          \ |    19     generator->Do##type(this);                          \ | 
|    17   } |    20   } | 
|    18 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) |    21 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) | 
|    19 #undef DEFINE_COMPILE |    22 #undef DEFINE_COMPILE | 
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   718   } |   721   } | 
|   719 } |   722 } | 
|   720  |   723  | 
|   721  |   724  | 
|   722 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, |   725 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, | 
|   723                                            HArithmeticBinaryOperation* instr) { |   726                                            HArithmeticBinaryOperation* instr) { | 
|   724   DCHECK(instr->representation().IsDouble()); |   727   DCHECK(instr->representation().IsDouble()); | 
|   725   DCHECK(instr->left()->representation().IsDouble()); |   728   DCHECK(instr->left()->representation().IsDouble()); | 
|   726   DCHECK(instr->right()->representation().IsDouble()); |   729   DCHECK(instr->right()->representation().IsDouble()); | 
|   727   if (op == Token::MOD) { |   730   if (op == Token::MOD) { | 
|   728     LOperand* left = UseFixedDouble(instr->left(), d0); |   731     LOperand* left = UseFixedDouble(instr->left(), d1); | 
|   729     LOperand* right = UseFixedDouble(instr->right(), d1); |   732     LOperand* right = UseFixedDouble(instr->right(), d2); | 
|   730     LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |   733     LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | 
|   731     return MarkAsCall(DefineFixedDouble(result, d0), instr); |   734     // We call a C function for double modulo. It can't trigger a GC. We need | 
 |   735     // to use fixed result register for the call. | 
 |   736     // TODO(fschneider): Allow any register as input registers. | 
 |   737     return MarkAsCall(DefineFixedDouble(result, d1), instr); | 
|   732   } else { |   738   } else { | 
|   733     LOperand* left = UseRegisterAtStart(instr->left()); |   739     LOperand* left = UseRegisterAtStart(instr->left()); | 
|   734     LOperand* right = UseRegisterAtStart(instr->right()); |   740     LOperand* right = UseRegisterAtStart(instr->right()); | 
|   735     LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |   741     LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | 
|   736     return DefineAsRegister(result); |   742     return DefineAsRegister(result); | 
|   737   } |   743   } | 
|   738 } |   744 } | 
|   739  |   745  | 
|   740  |   746  | 
|   741 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |   747 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 
|   742                                            HBinaryOperation* instr) { |   748                                            HBinaryOperation* instr) { | 
|   743   HValue* left = instr->left(); |   749   HValue* left = instr->left(); | 
|   744   HValue* right = instr->right(); |   750   HValue* right = instr->right(); | 
|   745   DCHECK(left->representation().IsTagged()); |   751   DCHECK(left->representation().IsTagged()); | 
|   746   DCHECK(right->representation().IsTagged()); |   752   DCHECK(right->representation().IsTagged()); | 
|   747   LOperand* context = UseFixed(instr->context(), cp); |   753   LOperand* context = UseFixed(instr->context(), cp); | 
|   748   LOperand* left_operand = UseFixed(left, r1); |   754   LOperand* left_operand = UseFixed(left, r4); | 
|   749   LOperand* right_operand = UseFixed(right, r0); |   755   LOperand* right_operand = UseFixed(right, r3); | 
|   750   LArithmeticT* result = |   756   LArithmeticT* result = | 
|   751       new(zone()) LArithmeticT(op, context, left_operand, right_operand); |   757       new(zone()) LArithmeticT(op, context, left_operand, right_operand); | 
|   752   return MarkAsCall(DefineFixed(result, r0), instr); |   758   return MarkAsCall(DefineFixed(result, r3), instr); | 
|   753 } |   759 } | 
|   754  |   760  | 
|   755  |   761  | 
|   756 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { |   762 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { | 
|   757   DCHECK(is_building()); |   763   DCHECK(is_building()); | 
|   758   current_block_ = block; |   764   current_block_ = block; | 
|   759   next_block_ = next_block; |   765   next_block_ = next_block; | 
|   760   if (block->IsStartBlock()) { |   766   if (block->IsStartBlock()) { | 
|   761     block->UpdateEnvironment(graph_->start_environment()); |   767     block->UpdateEnvironment(graph_->start_environment()); | 
|   762     argument_count_ = 0; |   768     argument_count_ = 0; | 
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   974  |   980  | 
|   975 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |   981 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 
|   976   info()->MarkAsRequiresFrame(); |   982   info()->MarkAsRequiresFrame(); | 
|   977   return DefineAsRegister(new(zone()) LArgumentsElements); |   983   return DefineAsRegister(new(zone()) LArgumentsElements); | 
|   978 } |   984 } | 
|   979  |   985  | 
|   980  |   986  | 
|   981 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |   987 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 
|   982   LOperand* context = UseFixed(instr->context(), cp); |   988   LOperand* context = UseFixed(instr->context(), cp); | 
|   983   LInstanceOf* result = |   989   LInstanceOf* result = | 
|   984       new(zone()) LInstanceOf(context, UseFixed(instr->left(), r0), |   990       new(zone()) LInstanceOf(context, UseFixed(instr->left(), r3), | 
|   985                               UseFixed(instr->right(), r1)); |   991                               UseFixed(instr->right(), r4)); | 
|   986   return MarkAsCall(DefineFixed(result, r0), instr); |   992   return MarkAsCall(DefineFixed(result, r3), instr); | 
|   987 } |   993 } | 
|   988  |   994  | 
|   989  |   995  | 
|   990 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( |   996 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( | 
|   991     HInstanceOfKnownGlobal* instr) { |   997     HInstanceOfKnownGlobal* instr) { | 
|   992   LInstanceOfKnownGlobal* result = |   998   LInstanceOfKnownGlobal* result = | 
|   993       new(zone()) LInstanceOfKnownGlobal( |   999       new(zone()) LInstanceOfKnownGlobal( | 
|   994           UseFixed(instr->context(), cp), |  1000           UseFixed(instr->context(), cp), | 
|   995           UseFixed(instr->left(), r0), |  1001           UseFixed(instr->left(), r3), | 
|   996           FixedTemp(r4)); |  1002           FixedTemp(r7)); | 
|   997   return MarkAsCall(DefineFixed(result, r0), instr); |  1003   return MarkAsCall(DefineFixed(result, r3), instr); | 
|   998 } |  1004 } | 
|   999  |  1005  | 
|  1000  |  1006  | 
|  1001 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |  1007 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 
|  1002   LOperand* receiver = UseRegisterAtStart(instr->receiver()); |  1008   LOperand* receiver = UseRegisterAtStart(instr->receiver()); | 
|  1003   LOperand* function = UseRegisterAtStart(instr->function()); |  1009   LOperand* function = UseRegisterAtStart(instr->function()); | 
|  1004   LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |  1010   LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 
|  1005   return AssignEnvironment(DefineAsRegister(result)); |  1011   return AssignEnvironment(DefineAsRegister(result)); | 
|  1006 } |  1012 } | 
|  1007  |  1013  | 
|  1008  |  1014  | 
|  1009 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { |  1015 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { | 
|  1010   LOperand* function = UseFixed(instr->function(), r1); |  1016   LOperand* function = UseFixed(instr->function(), r4); | 
|  1011   LOperand* receiver = UseFixed(instr->receiver(), r0); |  1017   LOperand* receiver = UseFixed(instr->receiver(), r3); | 
|  1012   LOperand* length = UseFixed(instr->length(), r2); |  1018   LOperand* length = UseFixed(instr->length(), r5); | 
|  1013   LOperand* elements = UseFixed(instr->elements(), r3); |  1019   LOperand* elements = UseFixed(instr->elements(), r6); | 
|  1014   LApplyArguments* result = new(zone()) LApplyArguments(function, |  1020   LApplyArguments* result = new(zone()) LApplyArguments(function, | 
|  1015                                                 receiver, |  1021                                                 receiver, | 
|  1016                                                 length, |  1022                                                 length, | 
|  1017                                                 elements); |  1023                                                 elements); | 
|  1018   return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); |  1024   return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY); | 
|  1019 } |  1025 } | 
|  1020  |  1026  | 
|  1021  |  1027  | 
|  1022 LInstruction* LChunkBuilder::DoPushArguments(HPushArguments* instr) { |  1028 LInstruction* LChunkBuilder::DoPushArguments(HPushArguments* instr) { | 
|  1023   int argc = instr->OperandCount(); |  1029   int argc = instr->OperandCount(); | 
|  1024   for (int i = 0; i < argc; ++i) { |  1030   for (int i = 0; i < argc; ++i) { | 
|  1025     LOperand* argument = Use(instr->argument(i)); |  1031     LOperand* argument = Use(instr->argument(i)); | 
|  1026     AddInstruction(new(zone()) LPushArgument(argument), instr); |  1032     AddInstruction(new(zone()) LPushArgument(argument), instr); | 
|  1027   } |  1033   } | 
|  1028   return NULL; |  1034   return NULL; | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1065  |  1071  | 
|  1066  |  1072  | 
|  1067 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |  1073 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 
|  1068   LOperand* context = UseFixed(instr->context(), cp); |  1074   LOperand* context = UseFixed(instr->context(), cp); | 
|  1069   return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); |  1075   return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); | 
|  1070 } |  1076 } | 
|  1071  |  1077  | 
|  1072  |  1078  | 
|  1073 LInstruction* LChunkBuilder::DoCallJSFunction( |  1079 LInstruction* LChunkBuilder::DoCallJSFunction( | 
|  1074     HCallJSFunction* instr) { |  1080     HCallJSFunction* instr) { | 
|  1075   LOperand* function = UseFixed(instr->function(), r1); |  1081   LOperand* function = UseFixed(instr->function(), r4); | 
|  1076  |  1082  | 
|  1077   LCallJSFunction* result = new(zone()) LCallJSFunction(function); |  1083   LCallJSFunction* result = new(zone()) LCallJSFunction(function); | 
|  1078  |  1084  | 
|  1079   return MarkAsCall(DefineFixed(result, r0), instr); |  1085   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  1080 } |  1086 } | 
|  1081  |  1087  | 
|  1082  |  1088  | 
|  1083 LInstruction* LChunkBuilder::DoCallWithDescriptor( |  1089 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 
|  1084     HCallWithDescriptor* instr) { |  1090     HCallWithDescriptor* instr) { | 
|  1085   const InterfaceDescriptor* descriptor = instr->descriptor(); |  1091   const InterfaceDescriptor* descriptor = instr->descriptor(); | 
|  1086  |  1092  | 
|  1087   LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |  1093   LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 
|  1088   ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |  1094   ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 
|  1089   ops.Add(target, zone()); |  1095   ops.Add(target, zone()); | 
|  1090   for (int i = 1; i < instr->OperandCount(); i++) { |  1096   for (int i = 1; i < instr->OperandCount(); i++) { | 
|  1091     LOperand* op = UseFixed(instr->OperandAt(i), |  1097     LOperand* op = UseFixed(instr->OperandAt(i), | 
|  1092         descriptor->GetParameterRegister(i - 1)); |  1098         descriptor->GetParameterRegister(i - 1)); | 
|  1093     ops.Add(op, zone()); |  1099     ops.Add(op, zone()); | 
|  1094   } |  1100   } | 
|  1095  |  1101  | 
|  1096   LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |  1102   LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 
|  1097       descriptor, ops, zone()); |  1103       descriptor, ops, zone()); | 
|  1098   return MarkAsCall(DefineFixed(result, r0), instr); |  1104   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  1099 } |  1105 } | 
|  1100  |  1106  | 
|  1101  |  1107  | 
|  1102 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |  1108 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 
|  1103   LOperand* context = UseFixed(instr->context(), cp); |  1109   LOperand* context = UseFixed(instr->context(), cp); | 
|  1104   LOperand* function = UseFixed(instr->function(), r1); |  1110   LOperand* function = UseFixed(instr->function(), r4); | 
|  1105   LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |  1111   LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 
|  1106   return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); |  1112   return MarkAsCall(DefineFixed(result, r3), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 
|  1107 } |  1113 } | 
|  1108  |  1114  | 
|  1109  |  1115  | 
|  1110 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |  1116 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 
|  1111   switch (instr->op()) { |  1117   switch (instr->op()) { | 
|  1112     case kMathFloor: |  1118     case kMathFloor: | 
|  1113       return DoMathFloor(instr); |  1119       return DoMathFloor(instr); | 
|  1114     case kMathRound: |  1120     case kMathRound: | 
|  1115       return DoMathRound(instr); |  1121       return DoMathRound(instr); | 
|  1116     case kMathFround: |  1122     case kMathFround: | 
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1166       DefineAsRegister(new(zone()) LMathAbs(context, input)); |  1172       DefineAsRegister(new(zone()) LMathAbs(context, input)); | 
|  1167   if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); |  1173   if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); | 
|  1168   if (!r.IsDouble()) result = AssignEnvironment(result); |  1174   if (!r.IsDouble()) result = AssignEnvironment(result); | 
|  1169   return result; |  1175   return result; | 
|  1170 } |  1176 } | 
|  1171  |  1177  | 
|  1172  |  1178  | 
|  1173 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |  1179 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 
|  1174   DCHECK(instr->representation().IsDouble()); |  1180   DCHECK(instr->representation().IsDouble()); | 
|  1175   DCHECK(instr->value()->representation().IsDouble()); |  1181   DCHECK(instr->value()->representation().IsDouble()); | 
|  1176   LOperand* input = UseFixedDouble(instr->value(), d0); |  1182   LOperand* input = UseFixedDouble(instr->value(), d1); | 
|  1177   return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d0), instr); |  1183   return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d1), instr); | 
|  1178 } |  1184 } | 
|  1179  |  1185  | 
|  1180  |  1186  | 
|  1181 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { |  1187 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { | 
|  1182   LOperand* input = UseRegisterAtStart(instr->value()); |  1188   LOperand* input = UseRegisterAtStart(instr->value()); | 
|  1183   LMathClz32* result = new(zone()) LMathClz32(input); |  1189   LMathClz32* result = new(zone()) LMathClz32(input); | 
|  1184   return DefineAsRegister(result); |  1190   return DefineAsRegister(result); | 
|  1185 } |  1191 } | 
|  1186  |  1192  | 
|  1187  |  1193  | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
|  1206  |  1212  | 
|  1207 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { |  1213 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { | 
|  1208   LOperand* input = UseRegisterAtStart(instr->value()); |  1214   LOperand* input = UseRegisterAtStart(instr->value()); | 
|  1209   LMathPowHalf* result = new(zone()) LMathPowHalf(input); |  1215   LMathPowHalf* result = new(zone()) LMathPowHalf(input); | 
|  1210   return DefineAsRegister(result); |  1216   return DefineAsRegister(result); | 
|  1211 } |  1217 } | 
|  1212  |  1218  | 
|  1213  |  1219  | 
|  1214 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { |  1220 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { | 
|  1215   LOperand* context = UseFixed(instr->context(), cp); |  1221   LOperand* context = UseFixed(instr->context(), cp); | 
|  1216   LOperand* constructor = UseFixed(instr->constructor(), r1); |  1222   LOperand* constructor = UseFixed(instr->constructor(), r4); | 
|  1217   LCallNew* result = new(zone()) LCallNew(context, constructor); |  1223   LCallNew* result = new(zone()) LCallNew(context, constructor); | 
|  1218   return MarkAsCall(DefineFixed(result, r0), instr); |  1224   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  1219 } |  1225 } | 
|  1220  |  1226  | 
|  1221  |  1227  | 
|  1222 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { |  1228 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { | 
|  1223   LOperand* context = UseFixed(instr->context(), cp); |  1229   LOperand* context = UseFixed(instr->context(), cp); | 
|  1224   LOperand* constructor = UseFixed(instr->constructor(), r1); |  1230   LOperand* constructor = UseFixed(instr->constructor(), r4); | 
|  1225   LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); |  1231   LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); | 
|  1226   return MarkAsCall(DefineFixed(result, r0), instr); |  1232   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  1227 } |  1233 } | 
|  1228  |  1234  | 
|  1229  |  1235  | 
|  1230 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |  1236 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 
|  1231   LOperand* context = UseFixed(instr->context(), cp); |  1237   LOperand* context = UseFixed(instr->context(), cp); | 
|  1232   LOperand* function = UseFixed(instr->function(), r1); |  1238   LOperand* function = UseFixed(instr->function(), r4); | 
|  1233   LCallFunction* call = new(zone()) LCallFunction(context, function); |  1239   LCallFunction* call = new(zone()) LCallFunction(context, function); | 
|  1234   return MarkAsCall(DefineFixed(call, r0), instr); |  1240   return MarkAsCall(DefineFixed(call, r3), instr); | 
|  1235 } |  1241 } | 
|  1236  |  1242  | 
|  1237  |  1243  | 
|  1238 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |  1244 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 
|  1239   LOperand* context = UseFixed(instr->context(), cp); |  1245   LOperand* context = UseFixed(instr->context(), cp); | 
|  1240   return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r0), instr); |  1246   return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r3), instr); | 
|  1241 } |  1247 } | 
|  1242  |  1248  | 
|  1243  |  1249  | 
|  1244 LInstruction* LChunkBuilder::DoRor(HRor* instr) { |  1250 LInstruction* LChunkBuilder::DoRor(HRor* instr) { | 
|  1245   return DoShift(Token::ROR, instr); |  1251   return DoShift(Token::ROR, instr); | 
|  1246 } |  1252 } | 
|  1247  |  1253  | 
|  1248  |  1254  | 
|  1249 LInstruction* LChunkBuilder::DoShr(HShr* instr) { |  1255 LInstruction* LChunkBuilder::DoShr(HShr* instr) { | 
|  1250   return DoShift(Token::SHR, instr); |  1256   return DoShift(Token::SHR, instr); | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1310   return result; |  1316   return result; | 
|  1311 } |  1317 } | 
|  1312  |  1318  | 
|  1313  |  1319  | 
|  1314 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) { |  1320 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) { | 
|  1315   DCHECK(instr->representation().IsSmiOrInteger32()); |  1321   DCHECK(instr->representation().IsSmiOrInteger32()); | 
|  1316   DCHECK(instr->left()->representation().Equals(instr->representation())); |  1322   DCHECK(instr->left()->representation().Equals(instr->representation())); | 
|  1317   DCHECK(instr->right()->representation().Equals(instr->representation())); |  1323   DCHECK(instr->right()->representation().Equals(instr->representation())); | 
|  1318   LOperand* dividend = UseRegister(instr->left()); |  1324   LOperand* dividend = UseRegister(instr->left()); | 
|  1319   LOperand* divisor = UseRegister(instr->right()); |  1325   LOperand* divisor = UseRegister(instr->right()); | 
|  1320   LOperand* temp = |  | 
|  1321       CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); |  | 
|  1322   LInstruction* result = |  1326   LInstruction* result = | 
|  1323       DefineAsRegister(new(zone()) LDivI(dividend, divisor, temp)); |  1327       DefineAsRegister(new(zone()) LDivI(dividend, divisor)); | 
|  1324   if (instr->CheckFlag(HValue::kCanBeDivByZero) || |  1328   if (instr->CheckFlag(HValue::kCanBeDivByZero) || | 
|  1325       instr->CheckFlag(HValue::kBailoutOnMinusZero) || |  1329       instr->CheckFlag(HValue::kBailoutOnMinusZero) || | 
|  1326       (instr->CheckFlag(HValue::kCanOverflow) && |  1330       (instr->CheckFlag(HValue::kCanOverflow) && | 
|  1327        (!CpuFeatures::IsSupported(SUDIV) || |  1331        !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) || | 
|  1328         !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) || |  | 
|  1329       (!instr->IsMathFloorOfDiv() && |  1332       (!instr->IsMathFloorOfDiv() && | 
|  1330        !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { |  1333        !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { | 
|  1331     result = AssignEnvironment(result); |  1334     result = AssignEnvironment(result); | 
|  1332   } |  1335   } | 
|  1333   return result; |  1336   return result; | 
|  1334 } |  1337 } | 
|  1335  |  1338  | 
|  1336  |  1339  | 
|  1337 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { |  1340 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { | 
|  1338   if (instr->representation().IsSmiOrInteger32()) { |  1341   if (instr->representation().IsSmiOrInteger32()) { | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1383   return result; |  1386   return result; | 
|  1384 } |  1387 } | 
|  1385  |  1388  | 
|  1386  |  1389  | 
|  1387 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { |  1390 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { | 
|  1388   DCHECK(instr->representation().IsSmiOrInteger32()); |  1391   DCHECK(instr->representation().IsSmiOrInteger32()); | 
|  1389   DCHECK(instr->left()->representation().Equals(instr->representation())); |  1392   DCHECK(instr->left()->representation().Equals(instr->representation())); | 
|  1390   DCHECK(instr->right()->representation().Equals(instr->representation())); |  1393   DCHECK(instr->right()->representation().Equals(instr->representation())); | 
|  1391   LOperand* dividend = UseRegister(instr->left()); |  1394   LOperand* dividend = UseRegister(instr->left()); | 
|  1392   LOperand* divisor = UseRegister(instr->right()); |  1395   LOperand* divisor = UseRegister(instr->right()); | 
|  1393   LOperand* temp = |  1396   LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor); | 
|  1394       CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); |  | 
|  1395   LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor, temp); |  | 
|  1396   return AssignEnvironment(DefineAsRegister(div)); |  1397   return AssignEnvironment(DefineAsRegister(div)); | 
|  1397 } |  1398 } | 
|  1398  |  1399  | 
|  1399  |  1400  | 
|  1400 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { |  1401 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { | 
|  1401   if (instr->RightIsPowerOf2()) { |  1402   if (instr->RightIsPowerOf2()) { | 
|  1402     return DoFlooringDivByPowerOf2I(instr); |  1403     return DoFlooringDivByPowerOf2I(instr); | 
|  1403   } else if (instr->right()->IsConstant()) { |  1404   } else if (instr->right()->IsConstant()) { | 
|  1404     return DoFlooringDivByConstI(instr); |  1405     return DoFlooringDivByConstI(instr); | 
|  1405   } else { |  1406   } else { | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1438   return result; |  1439   return result; | 
|  1439 } |  1440 } | 
|  1440  |  1441  | 
|  1441  |  1442  | 
|  1442 LInstruction* LChunkBuilder::DoModI(HMod* instr) { |  1443 LInstruction* LChunkBuilder::DoModI(HMod* instr) { | 
|  1443   DCHECK(instr->representation().IsSmiOrInteger32()); |  1444   DCHECK(instr->representation().IsSmiOrInteger32()); | 
|  1444   DCHECK(instr->left()->representation().Equals(instr->representation())); |  1445   DCHECK(instr->left()->representation().Equals(instr->representation())); | 
|  1445   DCHECK(instr->right()->representation().Equals(instr->representation())); |  1446   DCHECK(instr->right()->representation().Equals(instr->representation())); | 
|  1446   LOperand* dividend = UseRegister(instr->left()); |  1447   LOperand* dividend = UseRegister(instr->left()); | 
|  1447   LOperand* divisor = UseRegister(instr->right()); |  1448   LOperand* divisor = UseRegister(instr->right()); | 
|  1448   LOperand* temp = |  | 
|  1449       CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); |  | 
|  1450   LOperand* temp2 = |  | 
|  1451       CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); |  | 
|  1452   LInstruction* result = DefineAsRegister(new(zone()) LModI( |  1449   LInstruction* result = DefineAsRegister(new(zone()) LModI( | 
|  1453           dividend, divisor, temp, temp2)); |  1450           dividend, divisor)); | 
|  1454   if (instr->CheckFlag(HValue::kCanBeDivByZero) || |  1451   if (instr->CheckFlag(HValue::kCanBeDivByZero) || | 
|  1455       instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |  1452       instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 
|  1456     result = AssignEnvironment(result); |  1453     result = AssignEnvironment(result); | 
|  1457   } |  1454   } | 
|  1458   return result; |  1455   return result; | 
|  1459 } |  1456 } | 
|  1460  |  1457  | 
|  1461  |  1458  | 
|  1462 LInstruction* LChunkBuilder::DoMod(HMod* instr) { |  1459 LInstruction* LChunkBuilder::DoMod(HMod* instr) { | 
|  1463   if (instr->representation().IsSmiOrInteger32()) { |  1460   if (instr->representation().IsSmiOrInteger32()) { | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1520   } else if (instr->representation().IsDouble()) { |  1517   } else if (instr->representation().IsDouble()) { | 
|  1521     if (instr->HasOneUse() && (instr->uses().value()->IsAdd() || |  1518     if (instr->HasOneUse() && (instr->uses().value()->IsAdd() || | 
|  1522                                instr->uses().value()->IsSub())) { |  1519                                instr->uses().value()->IsSub())) { | 
|  1523       HBinaryOperation* use = HBinaryOperation::cast(instr->uses().value()); |  1520       HBinaryOperation* use = HBinaryOperation::cast(instr->uses().value()); | 
|  1524  |  1521  | 
|  1525       if (use->IsAdd() && instr == use->left()) { |  1522       if (use->IsAdd() && instr == use->left()) { | 
|  1526         // This mul is the lhs of an add. The add and mul will be folded into a |  1523         // This mul is the lhs of an add. The add and mul will be folded into a | 
|  1527         // multiply-add in DoAdd. |  1524         // multiply-add in DoAdd. | 
|  1528         return NULL; |  1525         return NULL; | 
|  1529       } |  1526       } | 
|  1530       if (instr == use->right() && use->IsAdd() && !use->left()->IsMul()) { |  1527       if (instr == use->right() && use->IsAdd() && | 
 |  1528           !(use->left()->IsMul() && use->left()->HasOneUse())) { | 
|  1531         // This mul is the rhs of an add, where the lhs is not another mul. |  1529         // This mul is the rhs of an add, where the lhs is not another mul. | 
|  1532         // The add and mul will be folded into a multiply-add in DoAdd. |  1530         // The add and mul will be folded into a multiply-add in DoAdd. | 
|  1533         return NULL; |  1531         return NULL; | 
|  1534       } |  1532       } | 
|  1535       if (instr == use->right() && use->IsSub()) { |  1533       if (instr == use->left() && use->IsSub()) { | 
|  1536         // This mul is the rhs of a sub. The sub and mul will be folded into a |  1534         // This mul is the lhs of a sub. The mul and sub will be folded into a | 
|  1537         // multiply-sub in DoSub. |  1535         // multiply-sub in DoSub. | 
|  1538         return NULL; |  1536         return NULL; | 
|  1539       } |  1537       } | 
|  1540     } |  1538     } | 
|  1541  |  1539  | 
|  1542     return DoArithmeticD(Token::MUL, instr); |  1540     return DoArithmeticD(Token::MUL, instr); | 
|  1543   } else { |  1541   } else { | 
|  1544     return DoArithmeticT(Token::MUL, instr); |  1542     return DoArithmeticT(Token::MUL, instr); | 
|  1545   } |  1543   } | 
|  1546 } |  1544 } | 
|  1547  |  1545  | 
|  1548  |  1546  | 
|  1549 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |  1547 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 
|  1550   if (instr->representation().IsSmiOrInteger32()) { |  1548   if (instr->representation().IsSmiOrInteger32()) { | 
|  1551     DCHECK(instr->left()->representation().Equals(instr->representation())); |  1549     DCHECK(instr->left()->representation().Equals(instr->representation())); | 
|  1552     DCHECK(instr->right()->representation().Equals(instr->representation())); |  1550     DCHECK(instr->right()->representation().Equals(instr->representation())); | 
|  1553  |  1551  | 
|  1554     if (instr->left()->IsConstant()) { |  1552     if (instr->left()->IsConstant() && | 
 |  1553         !instr->CheckFlag(HValue::kCanOverflow)) { | 
|  1555       // If lhs is constant, do reverse subtraction instead. |  1554       // If lhs is constant, do reverse subtraction instead. | 
|  1556       return DoRSub(instr); |  1555       return DoRSub(instr); | 
|  1557     } |  1556     } | 
|  1558  |  1557  | 
|  1559     LOperand* left = UseRegisterAtStart(instr->left()); |  1558     LOperand* left = UseRegisterAtStart(instr->left()); | 
|  1560     LOperand* right = UseOrConstantAtStart(instr->right()); |  1559     LOperand* right = UseOrConstantAtStart(instr->right()); | 
|  1561     LSubI* sub = new(zone()) LSubI(left, right); |  1560     LSubI* sub = new(zone()) LSubI(left, right); | 
|  1562     LInstruction* result = DefineAsRegister(sub); |  1561     LInstruction* result = DefineAsRegister(sub); | 
|  1563     if (instr->CheckFlag(HValue::kCanOverflow)) { |  1562     if (instr->CheckFlag(HValue::kCanOverflow)) { | 
|  1564       result = AssignEnvironment(result); |  1563       result = AssignEnvironment(result); | 
|  1565     } |  1564     } | 
|  1566     return result; |  1565     return result; | 
|  1567   } else if (instr->representation().IsDouble()) { |  1566   } else if (instr->representation().IsDouble()) { | 
|  1568     if (instr->right()->IsMul() && instr->right()->HasOneUse()) { |  1567     if (instr->left()->IsMul() && instr->left()->HasOneUse()) { | 
|  1569       return DoMultiplySub(instr->left(), HMul::cast(instr->right())); |  1568       return DoMultiplySub(instr->right(), HMul::cast(instr->left())); | 
|  1570     } |  1569     } | 
|  1571  |  1570  | 
|  1572     return DoArithmeticD(Token::SUB, instr); |  1571     return DoArithmeticD(Token::SUB, instr); | 
|  1573   } else { |  1572   } else { | 
|  1574     return DoArithmeticT(Token::SUB, instr); |  1573     return DoArithmeticT(Token::SUB, instr); | 
|  1575   } |  1574   } | 
|  1576 } |  1575 } | 
|  1577  |  1576  | 
|  1578  |  1577  | 
|  1579 LInstruction* LChunkBuilder::DoRSub(HSub* instr) { |  1578 LInstruction* LChunkBuilder::DoRSub(HSub* instr) { | 
|  1580   DCHECK(instr->representation().IsSmiOrInteger32()); |  1579   DCHECK(instr->representation().IsSmiOrInteger32()); | 
|  1581   DCHECK(instr->left()->representation().Equals(instr->representation())); |  1580   DCHECK(instr->left()->representation().Equals(instr->representation())); | 
|  1582   DCHECK(instr->right()->representation().Equals(instr->representation())); |  1581   DCHECK(instr->right()->representation().Equals(instr->representation())); | 
 |  1582   DCHECK(!instr->CheckFlag(HValue::kCanOverflow)); | 
|  1583  |  1583  | 
|  1584   // Note: The lhs of the subtraction becomes the rhs of the |  1584   // Note: The lhs of the subtraction becomes the rhs of the | 
|  1585   // reverse-subtraction. |  1585   // reverse-subtraction. | 
|  1586   LOperand* left = UseRegisterAtStart(instr->right()); |  1586   LOperand* left = UseRegisterAtStart(instr->right()); | 
|  1587   LOperand* right = UseOrConstantAtStart(instr->left()); |  1587   LOperand* right = UseOrConstantAtStart(instr->left()); | 
|  1588   LRSubI* rsb = new(zone()) LRSubI(left, right); |  1588   LRSubI* rsb = new(zone()) LRSubI(left, right); | 
|  1589   LInstruction* result = DefineAsRegister(rsb); |  1589   LInstruction* result = DefineAsRegister(rsb); | 
|  1590   if (instr->CheckFlag(HValue::kCanOverflow)) { |  | 
|  1591     result = AssignEnvironment(result); |  | 
|  1592   } |  | 
|  1593   return result; |  1590   return result; | 
|  1594 } |  1591 } | 
|  1595  |  1592  | 
|  1596  |  1593  | 
|  1597 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { |  1594 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { | 
|  1598   LOperand* multiplier_op = UseRegisterAtStart(mul->left()); |  1595   LOperand* multiplier_op = UseRegisterAtStart(mul->left()); | 
|  1599   LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); |  1596   LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); | 
|  1600   LOperand* addend_op = UseRegisterAtStart(addend); |  1597   LOperand* addend_op = UseRegisterAtStart(addend); | 
|  1601   return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, |  1598   return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, | 
|  1602                                                      multiplicand_op)); |  1599                                                      multiplicand_op)); | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1670   return DefineAsRegister(new(zone()) LMathMinMax(left, right)); |  1667   return DefineAsRegister(new(zone()) LMathMinMax(left, right)); | 
|  1671 } |  1668 } | 
|  1672  |  1669  | 
|  1673  |  1670  | 
|  1674 LInstruction* LChunkBuilder::DoPower(HPower* instr) { |  1671 LInstruction* LChunkBuilder::DoPower(HPower* instr) { | 
|  1675   DCHECK(instr->representation().IsDouble()); |  1672   DCHECK(instr->representation().IsDouble()); | 
|  1676   // We call a C function for double power. It can't trigger a GC. |  1673   // We call a C function for double power. It can't trigger a GC. | 
|  1677   // We need to use fixed result register for the call. |  1674   // We need to use fixed result register for the call. | 
|  1678   Representation exponent_type = instr->right()->representation(); |  1675   Representation exponent_type = instr->right()->representation(); | 
|  1679   DCHECK(instr->left()->representation().IsDouble()); |  1676   DCHECK(instr->left()->representation().IsDouble()); | 
|  1680   LOperand* left = UseFixedDouble(instr->left(), d0); |  1677   LOperand* left = UseFixedDouble(instr->left(), d1); | 
|  1681   LOperand* right = exponent_type.IsDouble() ? |  1678   LOperand* right = exponent_type.IsDouble() ? | 
|  1682       UseFixedDouble(instr->right(), d1) : |  1679       UseFixedDouble(instr->right(), d2) : | 
|  1683       UseFixed(instr->right(), r2); |  1680       UseFixed(instr->right(), r5); | 
|  1684   LPower* result = new(zone()) LPower(left, right); |  1681   LPower* result = new(zone()) LPower(left, right); | 
|  1685   return MarkAsCall(DefineFixedDouble(result, d2), |  1682   return MarkAsCall(DefineFixedDouble(result, d3), | 
|  1686                     instr, |  1683                     instr, | 
|  1687                     CAN_DEOPTIMIZE_EAGERLY); |  1684                     CAN_DEOPTIMIZE_EAGERLY); | 
|  1688 } |  1685 } | 
|  1689  |  1686  | 
|  1690  |  1687  | 
|  1691 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |  1688 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 
|  1692   DCHECK(instr->left()->representation().IsTagged()); |  1689   DCHECK(instr->left()->representation().IsTagged()); | 
|  1693   DCHECK(instr->right()->representation().IsTagged()); |  1690   DCHECK(instr->right()->representation().IsTagged()); | 
|  1694   LOperand* context = UseFixed(instr->context(), cp); |  1691   LOperand* context = UseFixed(instr->context(), cp); | 
|  1695   LOperand* left = UseFixed(instr->left(), r1); |  1692   LOperand* left = UseFixed(instr->left(), r4); | 
|  1696   LOperand* right = UseFixed(instr->right(), r0); |  1693   LOperand* right = UseFixed(instr->right(), r3); | 
|  1697   LCmpT* result = new(zone()) LCmpT(context, left, right); |  1694   LCmpT* result = new(zone()) LCmpT(context, left, right); | 
|  1698   return MarkAsCall(DefineFixed(result, r0), instr); |  1695   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  1699 } |  1696 } | 
|  1700  |  1697  | 
|  1701  |  1698  | 
|  1702 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |  1699 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( | 
|  1703     HCompareNumericAndBranch* instr) { |  1700     HCompareNumericAndBranch* instr) { | 
|  1704   Representation r = instr->representation(); |  1701   Representation r = instr->representation(); | 
|  1705   if (r.IsSmiOrInteger32()) { |  1702   if (r.IsSmiOrInteger32()) { | 
|  1706     DCHECK(instr->left()->representation().Equals(r)); |  1703     DCHECK(instr->left()->representation().Equals(r)); | 
|  1707     DCHECK(instr->right()->representation().Equals(r)); |  1704     DCHECK(instr->right()->representation().Equals(r)); | 
|  1708     LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |  1705     LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1770   LOperand* value = UseRegisterAtStart(instr->value()); |  1767   LOperand* value = UseRegisterAtStart(instr->value()); | 
|  1771   return new(zone()) LIsUndetectableAndBranch(value, TempRegister()); |  1768   return new(zone()) LIsUndetectableAndBranch(value, TempRegister()); | 
|  1772 } |  1769 } | 
|  1773  |  1770  | 
|  1774  |  1771  | 
|  1775 LInstruction* LChunkBuilder::DoStringCompareAndBranch( |  1772 LInstruction* LChunkBuilder::DoStringCompareAndBranch( | 
|  1776     HStringCompareAndBranch* instr) { |  1773     HStringCompareAndBranch* instr) { | 
|  1777   DCHECK(instr->left()->representation().IsTagged()); |  1774   DCHECK(instr->left()->representation().IsTagged()); | 
|  1778   DCHECK(instr->right()->representation().IsTagged()); |  1775   DCHECK(instr->right()->representation().IsTagged()); | 
|  1779   LOperand* context = UseFixed(instr->context(), cp); |  1776   LOperand* context = UseFixed(instr->context(), cp); | 
|  1780   LOperand* left = UseFixed(instr->left(), r1); |  1777   LOperand* left = UseFixed(instr->left(), r4); | 
|  1781   LOperand* right = UseFixed(instr->right(), r0); |  1778   LOperand* right = UseFixed(instr->right(), r3); | 
|  1782   LStringCompareAndBranch* result = |  1779   LStringCompareAndBranch* result = | 
|  1783       new(zone()) LStringCompareAndBranch(context, left, right); |  1780       new(zone()) LStringCompareAndBranch(context, left, right); | 
|  1784   return MarkAsCall(result, instr); |  1781   return MarkAsCall(result, instr); | 
|  1785 } |  1782 } | 
|  1786  |  1783  | 
|  1787  |  1784  | 
|  1788 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( |  1785 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( | 
|  1789     HHasInstanceTypeAndBranch* instr) { |  1786     HHasInstanceTypeAndBranch* instr) { | 
|  1790   DCHECK(instr->value()->representation().IsTagged()); |  1787   DCHECK(instr->value()->representation().IsTagged()); | 
|  1791   LOperand* value = UseRegisterAtStart(instr->value()); |  1788   LOperand* value = UseRegisterAtStart(instr->value()); | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
|  1818 } |  1815 } | 
|  1819  |  1816  | 
|  1820  |  1817  | 
|  1821 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { |  1818 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { | 
|  1822   LOperand* map = UseRegisterAtStart(instr->value()); |  1819   LOperand* map = UseRegisterAtStart(instr->value()); | 
|  1823   return DefineAsRegister(new(zone()) LMapEnumLength(map)); |  1820   return DefineAsRegister(new(zone()) LMapEnumLength(map)); | 
|  1824 } |  1821 } | 
|  1825  |  1822  | 
|  1826  |  1823  | 
|  1827 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { |  1824 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { | 
|  1828   LOperand* object = UseFixed(instr->value(), r0); |  1825   LOperand* object = UseFixed(instr->value(), r3); | 
|  1829   LDateField* result = |  1826   LDateField* result = | 
|  1830       new(zone()) LDateField(object, FixedTemp(r1), instr->index()); |  1827       new(zone()) LDateField(object, FixedTemp(r4), instr->index()); | 
|  1831   return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); |  1828   return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY); | 
|  1832 } |  1829 } | 
|  1833  |  1830  | 
|  1834  |  1831  | 
|  1835 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) { |  1832 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) { | 
|  1836   LOperand* string = UseRegisterAtStart(instr->string()); |  1833   LOperand* string = UseRegisterAtStart(instr->string()); | 
|  1837   LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |  1834   LOperand* index = UseRegisterOrConstantAtStart(instr->index()); | 
|  1838   return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index)); |  1835   return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index)); | 
|  1839 } |  1836 } | 
|  1840  |  1837  | 
|  1841  |  1838  | 
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2033 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |  2030 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { | 
|  2034   HValue* value = instr->value(); |  2031   HValue* value = instr->value(); | 
|  2035   Representation input_rep = value->representation(); |  2032   Representation input_rep = value->representation(); | 
|  2036   LOperand* reg = UseRegister(value); |  2033   LOperand* reg = UseRegister(value); | 
|  2037   if (input_rep.IsDouble()) { |  2034   if (input_rep.IsDouble()) { | 
|  2038     return DefineAsRegister(new(zone()) LClampDToUint8(reg)); |  2035     return DefineAsRegister(new(zone()) LClampDToUint8(reg)); | 
|  2039   } else if (input_rep.IsInteger32()) { |  2036   } else if (input_rep.IsInteger32()) { | 
|  2040     return DefineAsRegister(new(zone()) LClampIToUint8(reg)); |  2037     return DefineAsRegister(new(zone()) LClampIToUint8(reg)); | 
|  2041   } else { |  2038   } else { | 
|  2042     DCHECK(input_rep.IsSmiOrTagged()); |  2039     DCHECK(input_rep.IsSmiOrTagged()); | 
|  2043     // Register allocator doesn't (yet) support allocation of double |  | 
|  2044     // temps. Reserve d1 explicitly. |  | 
|  2045     LClampTToUint8* result = |  2040     LClampTToUint8* result = | 
|  2046         new(zone()) LClampTToUint8(reg, TempDoubleRegister()); |  2041         new(zone()) LClampTToUint8(reg, TempDoubleRegister()); | 
|  2047     return AssignEnvironment(DefineAsRegister(result)); |  2042     return AssignEnvironment(DefineAsRegister(result)); | 
|  2048   } |  2043   } | 
|  2049 } |  2044 } | 
|  2050  |  2045  | 
|  2051  |  2046  | 
|  2052 LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) { |  2047 LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) { | 
|  2053   HValue* value = instr->value(); |  2048   HValue* value = instr->value(); | 
|  2054   DCHECK(value->representation().IsDouble()); |  2049   DCHECK(value->representation().IsDouble()); | 
|  2055   return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value))); |  2050   return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value))); | 
|  2056 } |  2051 } | 
|  2057  |  2052  | 
|  2058  |  2053  | 
|  2059 LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) { |  2054 LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) { | 
|  2060   LOperand* lo = UseRegister(instr->lo()); |  2055   LOperand* lo = UseRegister(instr->lo()); | 
|  2061   LOperand* hi = UseRegister(instr->hi()); |  2056   LOperand* hi = UseRegister(instr->hi()); | 
|  2062   return DefineAsRegister(new(zone()) LConstructDouble(hi, lo)); |  2057   return DefineAsRegister(new(zone()) LConstructDouble(hi, lo)); | 
|  2063 } |  2058 } | 
|  2064  |  2059  | 
|  2065  |  2060  | 
|  2066 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |  2061 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 
|  2067   LOperand* context = info()->IsStub() |  2062   LOperand* context = info()->IsStub() | 
|  2068       ? UseFixed(instr->context(), cp) |  2063       ? UseFixed(instr->context(), cp) | 
|  2069       : NULL; |  2064       : NULL; | 
|  2070   LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); |  2065   LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); | 
|  2071   return new(zone()) LReturn(UseFixed(instr->value(), r0), context, |  2066   return new(zone()) LReturn(UseFixed(instr->value(), r3), context, | 
|  2072                              parameter_count); |  2067                              parameter_count); | 
|  2073 } |  2068 } | 
|  2074  |  2069  | 
|  2075  |  2070  | 
|  2076 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |  2071 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 
|  2077   Representation r = instr->representation(); |  2072   Representation r = instr->representation(); | 
|  2078   if (r.IsSmi()) { |  2073   if (r.IsSmi()) { | 
|  2079     return DefineAsRegister(new(zone()) LConstantS); |  2074     return DefineAsRegister(new(zone()) LConstantS); | 
|  2080   } else if (r.IsInteger32()) { |  2075   } else if (r.IsInteger32()) { | 
|  2081     return DefineAsRegister(new(zone()) LConstantI); |  2076     return DefineAsRegister(new(zone()) LConstantI); | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|  2103 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |  2098 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 
|  2104   LOperand* context = UseFixed(instr->context(), cp); |  2099   LOperand* context = UseFixed(instr->context(), cp); | 
|  2105   LOperand* global_object = UseFixed(instr->global_object(), |  2100   LOperand* global_object = UseFixed(instr->global_object(), | 
|  2106                                      LoadIC::ReceiverRegister()); |  2101                                      LoadIC::ReceiverRegister()); | 
|  2107   LOperand* vector = NULL; |  2102   LOperand* vector = NULL; | 
|  2108   if (FLAG_vector_ics) { |  2103   if (FLAG_vector_ics) { | 
|  2109     vector = FixedTemp(LoadIC::VectorRegister()); |  2104     vector = FixedTemp(LoadIC::VectorRegister()); | 
|  2110   } |  2105   } | 
|  2111   LLoadGlobalGeneric* result = |  2106   LLoadGlobalGeneric* result = | 
|  2112       new(zone()) LLoadGlobalGeneric(context, global_object, vector); |  2107       new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 
|  2113   return MarkAsCall(DefineFixed(result, r0), instr); |  2108   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  2114 } |  2109 } | 
|  2115  |  2110  | 
|  2116  |  2111  | 
|  2117 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |  2112 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | 
|  2118   LOperand* value = UseRegister(instr->value()); |  2113   LOperand* value = UseRegister(instr->value()); | 
|  2119   // Use a temp to check the value in the cell in the case where we perform |  2114   // Use a temp to check the value in the cell in the case where we perform | 
|  2120   // a hole check. |  2115   // a hole check. | 
|  2121   return instr->RequiresHoleCheck() |  2116   return instr->RequiresHoleCheck() | 
|  2122       ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) |  2117       ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) | 
|  2123       : new(zone()) LStoreGlobalCell(value, NULL); |  2118       : new(zone()) LStoreGlobalCell(value, NULL); | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2161  |  2156  | 
|  2162 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |  2157 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 
|  2163   LOperand* context = UseFixed(instr->context(), cp); |  2158   LOperand* context = UseFixed(instr->context(), cp); | 
|  2164   LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); |  2159   LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); | 
|  2165   LOperand* vector = NULL; |  2160   LOperand* vector = NULL; | 
|  2166   if (FLAG_vector_ics) { |  2161   if (FLAG_vector_ics) { | 
|  2167     vector = FixedTemp(LoadIC::VectorRegister()); |  2162     vector = FixedTemp(LoadIC::VectorRegister()); | 
|  2168   } |  2163   } | 
|  2169  |  2164  | 
|  2170   LInstruction* result = |  2165   LInstruction* result = | 
|  2171       DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), r0); |  2166       DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), r3); | 
|  2172   return MarkAsCall(result, instr); |  2167   return MarkAsCall(result, instr); | 
|  2173 } |  2168 } | 
|  2174  |  2169  | 
|  2175  |  2170  | 
|  2176 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |  2171 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 
|  2177     HLoadFunctionPrototype* instr) { |  2172     HLoadFunctionPrototype* instr) { | 
|  2178   return AssignEnvironment(DefineAsRegister( |  2173   return AssignEnvironment(DefineAsRegister( | 
|  2179       new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); |  2174       new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); | 
|  2180 } |  2175 } | 
|  2181  |  2176  | 
|  2182  |  2177  | 
|  2183 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { |  2178 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { | 
|  2184   return DefineAsRegister(new(zone()) LLoadRoot); |  2179   return DefineAsRegister(new(zone()) LLoadRoot); | 
|  2185 } |  2180 } | 
|  2186  |  2181  | 
|  2187  |  2182  | 
|  2188 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |  2183 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 
|  2189   DCHECK(instr->key()->representation().IsSmiOrInteger32()); |  2184   DCHECK(instr->key()->representation().IsSmiOrInteger32()); | 
|  2190   ElementsKind elements_kind = instr->elements_kind(); |  2185   ElementsKind elements_kind = instr->elements_kind(); | 
|  2191   LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |  2186   LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 
|  2192   LInstruction* result = NULL; |  2187   LInstruction* result = NULL; | 
|  2193  |  2188  | 
|  2194   if (!instr->is_typed_elements()) { |  2189   if (!instr->is_typed_elements()) { | 
|  2195     LOperand* obj = NULL; |  2190     LOperand* obj = NULL; | 
|  2196     if (instr->representation().IsDouble()) { |  2191     if (instr->representation().IsDouble()) { | 
|  2197       obj = UseRegister(instr->elements()); |  2192       obj = UseRegister(instr->elements()); | 
|  2198     } else { |  2193     } else { | 
|  2199       DCHECK(instr->representation().IsSmiOrTagged()); |  | 
|  2200       obj = UseRegisterAtStart(instr->elements()); |  2194       obj = UseRegisterAtStart(instr->elements()); | 
|  2201     } |  2195     } | 
|  2202     result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); |  2196     result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 
|  2203   } else { |  2197   } else { | 
|  2204     DCHECK( |  2198     DCHECK( | 
|  2205         (instr->representation().IsInteger32() && |  2199         (instr->representation().IsInteger32() && | 
|  2206          !IsDoubleOrFloatElementsKind(elements_kind)) || |  2200          !IsDoubleOrFloatElementsKind(elements_kind)) || | 
|  2207         (instr->representation().IsDouble() && |  2201         (instr->representation().IsDouble() && | 
|  2208          IsDoubleOrFloatElementsKind(elements_kind))); |  2202          IsDoubleOrFloatElementsKind(elements_kind))); | 
|  2209     LOperand* backing_store = UseRegister(instr->elements()); |  2203     LOperand* backing_store = UseRegister(instr->elements()); | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
|  2228   LOperand* context = UseFixed(instr->context(), cp); |  2222   LOperand* context = UseFixed(instr->context(), cp); | 
|  2229   LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); |  2223   LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); | 
|  2230   LOperand* key = UseFixed(instr->key(), LoadIC::NameRegister()); |  2224   LOperand* key = UseFixed(instr->key(), LoadIC::NameRegister()); | 
|  2231   LOperand* vector = NULL; |  2225   LOperand* vector = NULL; | 
|  2232   if (FLAG_vector_ics) { |  2226   if (FLAG_vector_ics) { | 
|  2233     vector = FixedTemp(LoadIC::VectorRegister()); |  2227     vector = FixedTemp(LoadIC::VectorRegister()); | 
|  2234   } |  2228   } | 
|  2235  |  2229  | 
|  2236   LInstruction* result = |  2230   LInstruction* result = | 
|  2237       DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), |  2231       DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), | 
|  2238                   r0); |  2232                   r3); | 
|  2239   return MarkAsCall(result, instr); |  2233   return MarkAsCall(result, instr); | 
|  2240 } |  2234 } | 
|  2241  |  2235  | 
|  2242  |  2236  | 
|  2243 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |  2237 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 
|  2244   if (!instr->is_typed_elements()) { |  2238   if (!instr->is_typed_elements()) { | 
|  2245     DCHECK(instr->elements()->representation().IsTagged()); |  2239     DCHECK(instr->elements()->representation().IsTagged()); | 
|  2246     bool needs_write_barrier = instr->NeedsWriteBarrier(); |  2240     bool needs_write_barrier = instr->NeedsWriteBarrier(); | 
|  2247     LOperand* object = NULL; |  2241     LOperand* object = NULL; | 
|  2248     LOperand* key = NULL; |  2242     LOperand* key = NULL; | 
|  2249     LOperand* val = NULL; |  2243     LOperand* val = NULL; | 
|  2250  |  2244  | 
|  2251     if (instr->value()->representation().IsDouble()) { |  2245     if (instr->value()->representation().IsDouble()) { | 
|  2252       object = UseRegisterAtStart(instr->elements()); |  2246       object = UseRegisterAtStart(instr->elements()); | 
|  2253       val = UseRegister(instr->value()); |  2247       val = UseRegister(instr->value()); | 
|  2254       key = UseRegisterOrConstantAtStart(instr->key()); |  2248       key = UseRegisterOrConstantAtStart(instr->key()); | 
|  2255     } else { |  2249     } else { | 
|  2256       DCHECK(instr->value()->representation().IsSmiOrTagged()); |  | 
|  2257       if (needs_write_barrier) { |  2250       if (needs_write_barrier) { | 
|  2258         object = UseTempRegister(instr->elements()); |  2251         object = UseTempRegister(instr->elements()); | 
|  2259         val = UseTempRegister(instr->value()); |  2252         val = UseTempRegister(instr->value()); | 
|  2260         key = UseTempRegister(instr->key()); |  2253         key = UseTempRegister(instr->key()); | 
|  2261       } else { |  2254       } else { | 
|  2262         object = UseRegisterAtStart(instr->elements()); |  2255         object = UseRegisterAtStart(instr->elements()); | 
|  2263         val = UseRegisterAtStart(instr->value()); |  2256         val = UseRegisterAtStart(instr->value()); | 
|  2264         key = UseRegisterOrConstantAtStart(instr->key()); |  2257         key = UseRegisterOrConstantAtStart(instr->key()); | 
|  2265       } |  2258       } | 
|  2266     } |  2259     } | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2301  |  2294  | 
|  2302 LInstruction* LChunkBuilder::DoTransitionElementsKind( |  2295 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 
|  2303     HTransitionElementsKind* instr) { |  2296     HTransitionElementsKind* instr) { | 
|  2304   if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |  2297   if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 
|  2305     LOperand* object = UseRegister(instr->object()); |  2298     LOperand* object = UseRegister(instr->object()); | 
|  2306     LOperand* new_map_reg = TempRegister(); |  2299     LOperand* new_map_reg = TempRegister(); | 
|  2307     LTransitionElementsKind* result = |  2300     LTransitionElementsKind* result = | 
|  2308         new(zone()) LTransitionElementsKind(object, NULL, new_map_reg); |  2301         new(zone()) LTransitionElementsKind(object, NULL, new_map_reg); | 
|  2309     return result; |  2302     return result; | 
|  2310   } else { |  2303   } else { | 
|  2311     LOperand* object = UseFixed(instr->object(), r0); |  2304     LOperand* object = UseFixed(instr->object(), r3); | 
|  2312     LOperand* context = UseFixed(instr->context(), cp); |  2305     LOperand* context = UseFixed(instr->context(), cp); | 
|  2313     LTransitionElementsKind* result = |  2306     LTransitionElementsKind* result = | 
|  2314         new(zone()) LTransitionElementsKind(object, context, NULL); |  2307         new(zone()) LTransitionElementsKind(object, context, NULL); | 
|  2315     return MarkAsCall(result, instr); |  2308     return MarkAsCall(result, instr); | 
|  2316   } |  2309   } | 
|  2317 } |  2310 } | 
|  2318  |  2311  | 
|  2319  |  2312  | 
|  2320 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |  2313 LInstruction* LChunkBuilder::DoTrapAllocationMemento( | 
|  2321     HTrapAllocationMemento* instr) { |  2314     HTrapAllocationMemento* instr) { | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2365   LOperand* obj = UseFixed(instr->object(), StoreIC::ReceiverRegister()); |  2358   LOperand* obj = UseFixed(instr->object(), StoreIC::ReceiverRegister()); | 
|  2366   LOperand* val = UseFixed(instr->value(), StoreIC::ValueRegister()); |  2359   LOperand* val = UseFixed(instr->value(), StoreIC::ValueRegister()); | 
|  2367  |  2360  | 
|  2368   LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val); |  2361   LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val); | 
|  2369   return MarkAsCall(result, instr); |  2362   return MarkAsCall(result, instr); | 
|  2370 } |  2363 } | 
|  2371  |  2364  | 
|  2372  |  2365  | 
|  2373 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |  2366 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 
|  2374   LOperand* context = UseFixed(instr->context(), cp); |  2367   LOperand* context = UseFixed(instr->context(), cp); | 
|  2375   LOperand* left = UseFixed(instr->left(), r1); |  2368   LOperand* left = UseFixed(instr->left(), r4); | 
|  2376   LOperand* right = UseFixed(instr->right(), r0); |  2369   LOperand* right = UseFixed(instr->right(), r3); | 
|  2377   return MarkAsCall( |  2370   return MarkAsCall( | 
|  2378       DefineFixed(new(zone()) LStringAdd(context, left, right), r0), |  2371       DefineFixed(new(zone()) LStringAdd(context, left, right), r3), | 
|  2379       instr); |  2372       instr); | 
|  2380 } |  2373 } | 
|  2381  |  2374  | 
|  2382  |  2375  | 
|  2383 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |  2376 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 
|  2384   LOperand* string = UseTempRegister(instr->string()); |  2377   LOperand* string = UseTempRegister(instr->string()); | 
|  2385   LOperand* index = UseTempRegister(instr->index()); |  2378   LOperand* index = UseTempRegister(instr->index()); | 
|  2386   LOperand* context = UseAny(instr->context()); |  2379   LOperand* context = UseAny(instr->context()); | 
|  2387   LStringCharCodeAt* result = |  2380   LStringCharCodeAt* result = | 
|  2388       new(zone()) LStringCharCodeAt(context, string, index); |  2381       new(zone()) LStringCharCodeAt(context, string, index); | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
|  2406   LOperand* temp1 = TempRegister(); |  2399   LOperand* temp1 = TempRegister(); | 
|  2407   LOperand* temp2 = TempRegister(); |  2400   LOperand* temp2 = TempRegister(); | 
|  2408   LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2); |  2401   LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2); | 
|  2409   return AssignPointerMap(DefineAsRegister(result)); |  2402   return AssignPointerMap(DefineAsRegister(result)); | 
|  2410 } |  2403 } | 
|  2411  |  2404  | 
|  2412  |  2405  | 
|  2413 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { |  2406 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { | 
|  2414   LOperand* context = UseFixed(instr->context(), cp); |  2407   LOperand* context = UseFixed(instr->context(), cp); | 
|  2415   return MarkAsCall( |  2408   return MarkAsCall( | 
|  2416       DefineFixed(new(zone()) LRegExpLiteral(context), r0), instr); |  2409       DefineFixed(new(zone()) LRegExpLiteral(context), r3), instr); | 
|  2417 } |  2410 } | 
|  2418  |  2411  | 
|  2419  |  2412  | 
|  2420 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { |  2413 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { | 
|  2421   LOperand* context = UseFixed(instr->context(), cp); |  2414   LOperand* context = UseFixed(instr->context(), cp); | 
|  2422   return MarkAsCall( |  2415   return MarkAsCall( | 
|  2423       DefineFixed(new(zone()) LFunctionLiteral(context), r0), instr); |  2416       DefineFixed(new(zone()) LFunctionLiteral(context), r3), instr); | 
|  2424 } |  2417 } | 
|  2425  |  2418  | 
|  2426  |  2419  | 
|  2427 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { |  2420 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { | 
|  2428   DCHECK(argument_count_ == 0); |  2421   DCHECK(argument_count_ == 0); | 
|  2429   allocator_->MarkAsOsrEntry(); |  2422   allocator_->MarkAsOsrEntry(); | 
|  2430   current_block_->last_environment()->set_ast_id(instr->ast_id()); |  2423   current_block_->last_environment()->set_ast_id(instr->ast_id()); | 
|  2431   return AssignEnvironment(new(zone()) LOsrEntry); |  2424   return AssignEnvironment(new(zone()) LOsrEntry); | 
|  2432 } |  2425 } | 
|  2433  |  2426  | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
|  2461       Abort(kTooManySpillSlotsNeededForOSR); |  2454       Abort(kTooManySpillSlotsNeededForOSR); | 
|  2462       spill_index = 0; |  2455       spill_index = 0; | 
|  2463     } |  2456     } | 
|  2464   } |  2457   } | 
|  2465   return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |  2458   return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 
|  2466 } |  2459 } | 
|  2467  |  2460  | 
|  2468  |  2461  | 
|  2469 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |  2462 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 
|  2470   LOperand* context = UseFixed(instr->context(), cp); |  2463   LOperand* context = UseFixed(instr->context(), cp); | 
|  2471   return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r0), instr); |  2464   return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r3), instr); | 
|  2472 } |  2465 } | 
|  2473  |  2466  | 
|  2474  |  2467  | 
|  2475 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |  2468 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 
|  2476   // There are no real uses of the arguments object. |  2469   // There are no real uses of the arguments object. | 
|  2477   // arguments.length and element access are supported directly on |  2470   // arguments.length and element access are supported directly on | 
|  2478   // stack arguments, and any real arguments object use causes a bailout. |  2471   // stack arguments, and any real arguments object use causes a bailout. | 
|  2479   // So this value is never used. |  2472   // So this value is never used. | 
|  2480   return NULL; |  2473   return NULL; | 
|  2481 } |  2474 } | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
|  2492 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |  2485 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { | 
|  2493   info()->MarkAsRequiresFrame(); |  2486   info()->MarkAsRequiresFrame(); | 
|  2494   LOperand* args = UseRegister(instr->arguments()); |  2487   LOperand* args = UseRegister(instr->arguments()); | 
|  2495   LOperand* length = UseRegisterOrConstantAtStart(instr->length()); |  2488   LOperand* length = UseRegisterOrConstantAtStart(instr->length()); | 
|  2496   LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |  2489   LOperand* index = UseRegisterOrConstantAtStart(instr->index()); | 
|  2497   return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); |  2490   return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); | 
|  2498 } |  2491 } | 
|  2499  |  2492  | 
|  2500  |  2493  | 
|  2501 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |  2494 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { | 
|  2502   LOperand* object = UseFixed(instr->value(), r0); |  2495   LOperand* object = UseFixed(instr->value(), r3); | 
|  2503   LToFastProperties* result = new(zone()) LToFastProperties(object); |  2496   LToFastProperties* result = new(zone()) LToFastProperties(object); | 
|  2504   return MarkAsCall(DefineFixed(result, r0), instr); |  2497   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  2505 } |  2498 } | 
|  2506  |  2499  | 
|  2507  |  2500  | 
|  2508 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { |  2501 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { | 
|  2509   LOperand* context = UseFixed(instr->context(), cp); |  2502   LOperand* context = UseFixed(instr->context(), cp); | 
|  2510   LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), r0)); |  2503   LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), r3)); | 
|  2511   return MarkAsCall(DefineFixed(result, r0), instr); |  2504   return MarkAsCall(DefineFixed(result, r3), instr); | 
|  2512 } |  2505 } | 
|  2513  |  2506  | 
|  2514  |  2507  | 
|  2515 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { |  2508 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { | 
|  2516   return new(zone()) LTypeofIsAndBranch(UseRegister(instr->value())); |  2509   return new(zone()) LTypeofIsAndBranch(UseRegister(instr->value())); | 
|  2517 } |  2510 } | 
|  2518  |  2511  | 
|  2519  |  2512  | 
|  2520 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( |  2513 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( | 
|  2521     HIsConstructCallAndBranch* instr) { |  2514     HIsConstructCallAndBranch* instr) { | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2576   HEnvironment* outer = current_block_->last_environment()-> |  2569   HEnvironment* outer = current_block_->last_environment()-> | 
|  2577       DiscardInlined(false); |  2570       DiscardInlined(false); | 
|  2578   current_block_->UpdateEnvironment(outer); |  2571   current_block_->UpdateEnvironment(outer); | 
|  2579  |  2572  | 
|  2580   return pop; |  2573   return pop; | 
|  2581 } |  2574 } | 
|  2582  |  2575  | 
|  2583  |  2576  | 
|  2584 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { |  2577 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { | 
|  2585   LOperand* context = UseFixed(instr->context(), cp); |  2578   LOperand* context = UseFixed(instr->context(), cp); | 
|  2586   LOperand* object = UseFixed(instr->enumerable(), r0); |  2579   LOperand* object = UseFixed(instr->enumerable(), r3); | 
|  2587   LForInPrepareMap* result = new(zone()) LForInPrepareMap(context, object); |  2580   LForInPrepareMap* result = new(zone()) LForInPrepareMap(context, object); | 
|  2588   return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); |  2581   return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY); | 
|  2589 } |  2582 } | 
|  2590  |  2583  | 
|  2591  |  2584  | 
|  2592 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { |  2585 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { | 
|  2593   LOperand* map = UseRegister(instr->map()); |  2586   LOperand* map = UseRegister(instr->map()); | 
|  2594   return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map))); |  2587   return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map))); | 
|  2595 } |  2588 } | 
|  2596  |  2589  | 
|  2597  |  2590  | 
|  2598 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { |  2591 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|  2620 LInstruction* LChunkBuilder::DoAllocateBlockContext( |  2613 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 
|  2621     HAllocateBlockContext* instr) { |  2614     HAllocateBlockContext* instr) { | 
|  2622   LOperand* context = UseFixed(instr->context(), cp); |  2615   LOperand* context = UseFixed(instr->context(), cp); | 
|  2623   LOperand* function = UseRegisterAtStart(instr->function()); |  2616   LOperand* function = UseRegisterAtStart(instr->function()); | 
|  2624   LAllocateBlockContext* result = |  2617   LAllocateBlockContext* result = | 
|  2625       new(zone()) LAllocateBlockContext(context, function); |  2618       new(zone()) LAllocateBlockContext(context, function); | 
|  2626   return MarkAsCall(DefineFixed(result, cp), instr); |  2619   return MarkAsCall(DefineFixed(result, cp), instr); | 
|  2627 } |  2620 } | 
|  2628  |  2621  | 
|  2629 } }  // namespace v8::internal |  2622 } }  // namespace v8::internal | 
| OLD | NEW |