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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 } | 938 } |
939 #endif | 939 #endif |
940 | 940 |
941 instr->set_position(position_); | 941 instr->set_position(position_); |
942 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 942 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
943 instr = AssignPointerMap(instr); | 943 instr = AssignPointerMap(instr); |
944 } | 944 } |
945 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 945 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
946 instr = AssignEnvironment(instr); | 946 instr = AssignEnvironment(instr); |
947 } | 947 } |
| 948 if (!CpuFeatures::IsSafeForSnapshot(SSE2) && instr->IsGoto() && |
| 949 LGoto::cast(instr)->jumps_to_join()) { |
| 950 // TODO(olivf) Since phis of spilled values are joined as registers |
| 951 // (not in the stack slot), we need to allow the goto gaps to keep one |
| 952 // x87 register alive. To ensure all other values are still spilled, we |
| 953 // insert a fpu register barrier right before. |
| 954 LClobberDoubles* clobber = new(zone()) LClobberDoubles(); |
| 955 clobber->set_hydrogen_value(current); |
| 956 chunk_->AddInstruction(clobber, current_block_); |
| 957 } |
948 instr->set_hydrogen_value(current); | 958 instr->set_hydrogen_value(current); |
949 chunk_->AddInstruction(instr, current_block_); | 959 chunk_->AddInstruction(instr, current_block_); |
950 } | 960 } |
951 current_instruction_ = old_current; | 961 current_instruction_ = old_current; |
952 } | 962 } |
953 | 963 |
954 | 964 |
955 LEnvironment* LChunkBuilder::CreateEnvironment( | 965 LEnvironment* LChunkBuilder::CreateEnvironment( |
956 HEnvironment* hydrogen_env, | 966 HEnvironment* hydrogen_env, |
957 int* argument_index_accumulator, | 967 int* argument_index_accumulator, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 | 1040 |
1031 if (hydrogen_env->frame_type() == JS_FUNCTION) { | 1041 if (hydrogen_env->frame_type() == JS_FUNCTION) { |
1032 *argument_index_accumulator = argument_index; | 1042 *argument_index_accumulator = argument_index; |
1033 } | 1043 } |
1034 | 1044 |
1035 return result; | 1045 return result; |
1036 } | 1046 } |
1037 | 1047 |
1038 | 1048 |
1039 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { | 1049 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { |
1040 return new(zone()) LGoto(instr->FirstSuccessor()->block_id()); | 1050 return new(zone()) LGoto(instr->FirstSuccessor()); |
1041 } | 1051 } |
1042 | 1052 |
1043 | 1053 |
1044 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 1054 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
1045 HValue* value = instr->value(); | 1055 HValue* value = instr->value(); |
1046 if (value->EmitAtUses()) { | 1056 if (value->EmitAtUses()) { |
1047 ASSERT(value->IsConstant()); | 1057 ASSERT(value->IsConstant()); |
1048 ASSERT(!value->representation().IsDouble()); | 1058 ASSERT(!value->representation().IsDouble()); |
1049 HBasicBlock* successor = HConstant::cast(value)->BooleanValue() | 1059 HBasicBlock* successor = HConstant::cast(value)->BooleanValue() |
1050 ? instr->FirstSuccessor() | 1060 ? instr->FirstSuccessor() |
1051 : instr->SecondSuccessor(); | 1061 : instr->SecondSuccessor(); |
1052 return new(zone()) LGoto(successor->block_id()); | 1062 return new(zone()) LGoto(successor); |
1053 } | 1063 } |
1054 | 1064 |
1055 ToBooleanStub::Types expected = instr->expected_input_types(); | 1065 ToBooleanStub::Types expected = instr->expected_input_types(); |
1056 | 1066 |
1057 // Tagged values that are not known smis or booleans require a | 1067 // Tagged values that are not known smis or booleans require a |
1058 // deoptimization environment. If the instruction is generic no | 1068 // deoptimization environment. If the instruction is generic no |
1059 // environment is needed since all cases are handled. | 1069 // environment is needed since all cases are handled. |
1060 Representation rep = value->representation(); | 1070 Representation rep = value->representation(); |
1061 HType type = value->type(); | 1071 HType type = value->type(); |
1062 if (!rep.IsTagged() || type.IsSmi() || type.IsBoolean()) { | 1072 if (!rep.IsTagged() || type.IsSmi() || type.IsBoolean()) { |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2722 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2713 LOperand* object = UseRegister(instr->object()); | 2723 LOperand* object = UseRegister(instr->object()); |
2714 LOperand* index = UseTempRegister(instr->index()); | 2724 LOperand* index = UseTempRegister(instr->index()); |
2715 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2725 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2716 } | 2726 } |
2717 | 2727 |
2718 | 2728 |
2719 } } // namespace v8::internal | 2729 } } // namespace v8::internal |
2720 | 2730 |
2721 #endif // V8_TARGET_ARCH_IA32 | 2731 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |