OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 ? GetStackSlotCount() : arguments_index + arguments_count; | 692 ? GetStackSlotCount() : arguments_index + arguments_count; |
693 arguments_count = environment->entry()->arguments_count() + 1; | 693 arguments_count = environment->entry()->arguments_count() + 1; |
694 if (environment->entry()->arguments_pushed()) { | 694 if (environment->entry()->arguments_pushed()) { |
695 *pushed_arguments_index = arguments_index; | 695 *pushed_arguments_index = arguments_index; |
696 *pushed_arguments_count = arguments_count; | 696 *pushed_arguments_count = arguments_count; |
697 } | 697 } |
698 } | 698 } |
699 | 699 |
700 for (int i = 0; i < translation_size; ++i) { | 700 for (int i = 0; i < translation_size; ++i) { |
701 LOperand* value = environment->values()->at(i); | 701 LOperand* value = environment->values()->at(i); |
702 // spilled_registers_ and spilled_double_registers_ are either | |
703 // both NULL or both set. | |
704 if (environment->spilled_registers() != NULL && value != NULL) { | |
705 if (value->IsRegister() && | |
706 environment->spilled_registers()[value->index()] != NULL) { | |
707 translation->MarkDuplicate(); | |
708 AddToTranslation(translation, | |
709 environment->spilled_registers()[value->index()], | |
710 environment->HasTaggedValueAt(i), | |
711 environment->HasUint32ValueAt(i), | |
712 arguments_known, | |
713 arguments_index, | |
714 arguments_count); | |
715 } else if ( | |
716 value->IsDoubleRegister() && | |
717 environment->spilled_double_registers()[value->index()] != NULL) { | |
718 translation->MarkDuplicate(); | |
719 AddToTranslation( | |
720 translation, | |
721 environment->spilled_double_registers()[value->index()], | |
722 false, | |
723 false, | |
724 arguments_known, | |
725 arguments_index, | |
726 arguments_count); | |
727 } | |
728 } | |
729 | 702 |
730 AddToTranslation(translation, | 703 AddToTranslation(translation, |
731 value, | 704 value, |
732 environment->HasTaggedValueAt(i), | 705 environment->HasTaggedValueAt(i), |
733 environment->HasUint32ValueAt(i), | 706 environment->HasUint32ValueAt(i), |
734 arguments_known, | 707 arguments_known, |
735 arguments_index, | 708 arguments_index, |
736 arguments_count); | 709 arguments_count); |
737 } | 710 } |
738 } | 711 } |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 1195 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
1223 break; | 1196 break; |
1224 } | 1197 } |
1225 default: | 1198 default: |
1226 UNREACHABLE(); | 1199 UNREACHABLE(); |
1227 } | 1200 } |
1228 } | 1201 } |
1229 | 1202 |
1230 | 1203 |
1231 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 1204 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
1232 // Nothing to do. | 1205 // Record the address of the first unknown OSR value as the place to enter. |
| 1206 if (osr_pc_offset_ == -1) osr_pc_offset_ = masm()->pc_offset(); |
1233 } | 1207 } |
1234 | 1208 |
1235 | 1209 |
1236 void LCodeGen::DoModI(LModI* instr) { | 1210 void LCodeGen::DoModI(LModI* instr) { |
1237 HMod* hmod = instr->hydrogen(); | 1211 HMod* hmod = instr->hydrogen(); |
1238 HValue* left = hmod->left(); | 1212 HValue* left = hmod->left(); |
1239 HValue* right = hmod->right(); | 1213 HValue* right = hmod->right(); |
1240 if (hmod->HasPowerOf2Divisor()) { | 1214 if (hmod->HasPowerOf2Divisor()) { |
1241 // TODO(svenpanne) We should really do the strength reduction on the | 1215 // TODO(svenpanne) We should really do the strength reduction on the |
1242 // Hydrogen level. | 1216 // Hydrogen level. |
(...skipping 5174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6417 // the deferred code. | 6391 // the deferred code. |
6418 } | 6392 } |
6419 } | 6393 } |
6420 | 6394 |
6421 | 6395 |
6422 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 6396 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
6423 // This is a pseudo-instruction that ensures that the environment here is | 6397 // This is a pseudo-instruction that ensures that the environment here is |
6424 // properly registered for deoptimization and records the assembler's PC | 6398 // properly registered for deoptimization and records the assembler's PC |
6425 // offset. | 6399 // offset. |
6426 LEnvironment* environment = instr->environment(); | 6400 LEnvironment* environment = instr->environment(); |
6427 environment->SetSpilledRegisters(instr->SpilledRegisterArray(), | |
6428 instr->SpilledDoubleRegisterArray()); | |
6429 | 6401 |
6430 // If the environment were already registered, we would have no way of | 6402 // If the environment were already registered, we would have no way of |
6431 // backpatching it with the spill slot operands. | 6403 // backpatching it with the spill slot operands. |
6432 ASSERT(!environment->HasBeenRegistered()); | 6404 ASSERT(!environment->HasBeenRegistered()); |
6433 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 6405 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
6434 ASSERT(osr_pc_offset_ == -1); | 6406 |
6435 osr_pc_offset_ = masm()->pc_offset(); | 6407 // Normally we record the first unknown OSR value as the entrypoint to the OSR |
| 6408 // code, but if there were none, record the entrypoint here. |
| 6409 if (osr_pc_offset_ == -1) osr_pc_offset_ = masm()->pc_offset(); |
6436 } | 6410 } |
6437 | 6411 |
6438 | 6412 |
6439 void LCodeGen::DoIn(LIn* instr) { | 6413 void LCodeGen::DoIn(LIn* instr) { |
6440 LOperand* obj = instr->object(); | 6414 LOperand* obj = instr->object(); |
6441 LOperand* key = instr->key(); | 6415 LOperand* key = instr->key(); |
6442 EmitPushTaggedOperand(key); | 6416 EmitPushTaggedOperand(key); |
6443 EmitPushTaggedOperand(obj); | 6417 EmitPushTaggedOperand(obj); |
6444 ASSERT(instr->HasPointerMap()); | 6418 ASSERT(instr->HasPointerMap()); |
6445 LPointerMap* pointers = instr->pointer_map(); | 6419 LPointerMap* pointers = instr->pointer_map(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6535 FixedArray::kHeaderSize - kPointerSize)); | 6509 FixedArray::kHeaderSize - kPointerSize)); |
6536 __ bind(&done); | 6510 __ bind(&done); |
6537 } | 6511 } |
6538 | 6512 |
6539 | 6513 |
6540 #undef __ | 6514 #undef __ |
6541 | 6515 |
6542 } } // namespace v8::internal | 6516 } } // namespace v8::internal |
6543 | 6517 |
6544 #endif // V8_TARGET_ARCH_IA32 | 6518 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |