| OLD | NEW |
| 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 4014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4026 isolate()->factory()->NewJSGlobalPropertyCell(target); | 4026 isolate()->factory()->NewJSGlobalPropertyCell(target); |
| 4027 __ cmp(reg, Operand::Cell(cell)); | 4027 __ cmp(reg, Operand::Cell(cell)); |
| 4028 } else { | 4028 } else { |
| 4029 Operand operand = ToOperand(instr->value()); | 4029 Operand operand = ToOperand(instr->value()); |
| 4030 __ cmp(operand, target); | 4030 __ cmp(operand, target); |
| 4031 } | 4031 } |
| 4032 DeoptimizeIf(not_equal, instr->environment()); | 4032 DeoptimizeIf(not_equal, instr->environment()); |
| 4033 } | 4033 } |
| 4034 | 4034 |
| 4035 | 4035 |
| 4036 void LCodeGen::DoCheckMapCommon(Register reg, |
| 4037 Handle<Map> map, |
| 4038 MapCheckMode mode, |
| 4039 LEnvironment* env) { |
| 4040 Label success; |
| 4041 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), Immediate(map)); |
| 4042 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { |
| 4043 bool ignore; |
| 4044 Map* transitioned_double_map = |
| 4045 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore); |
| 4046 ASSERT(transitioned_double_map == NULL || |
| 4047 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); |
| 4048 Map* transitioned_fast_element_map = |
| 4049 map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore); |
| 4050 ASSERT(transitioned_fast_element_map == NULL || |
| 4051 map->elements_kind() != FAST_ELEMENTS); |
| 4052 if (transitioned_fast_element_map != NULL) { |
| 4053 __ j(equal, &success, Label::kNear); |
| 4054 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
| 4055 Immediate(Handle<Map>(transitioned_fast_element_map))); |
| 4056 } |
| 4057 |
| 4058 if (transitioned_double_map != NULL) { |
| 4059 __ j(equal, &success, Label::kNear); |
| 4060 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
| 4061 Immediate(Handle<Map>(transitioned_double_map))); |
| 4062 } |
| 4063 } |
| 4064 DeoptimizeIf(not_equal, env); |
| 4065 __ bind(&success); |
| 4066 } |
| 4067 |
| 4068 |
| 4036 void LCodeGen::DoCheckMap(LCheckMap* instr) { | 4069 void LCodeGen::DoCheckMap(LCheckMap* instr) { |
| 4037 LOperand* input = instr->InputAt(0); | 4070 LOperand* input = instr->InputAt(0); |
| 4038 ASSERT(input->IsRegister()); | 4071 ASSERT(input->IsRegister()); |
| 4039 Register reg = ToRegister(input); | 4072 Register reg = ToRegister(input); |
| 4040 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 4073 Handle<Map> map = Handle<Map>(instr->hydrogen()->map()); |
| 4041 instr->hydrogen()->map()); | 4074 DoCheckMapCommon(reg, map, instr->hydrogen()->mode(), instr->environment()); |
| 4042 DeoptimizeIf(not_equal, instr->environment()); | |
| 4043 } | 4075 } |
| 4044 | 4076 |
| 4045 | 4077 |
| 4046 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 4078 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
| 4047 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); | 4079 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); |
| 4048 Register result_reg = ToRegister(instr->result()); | 4080 Register result_reg = ToRegister(instr->result()); |
| 4049 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); | 4081 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); |
| 4050 } | 4082 } |
| 4051 | 4083 |
| 4052 | 4084 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4095 Register reg = ToRegister(instr->TempAt(0)); | 4127 Register reg = ToRegister(instr->TempAt(0)); |
| 4096 | 4128 |
| 4097 Handle<JSObject> holder = instr->holder(); | 4129 Handle<JSObject> holder = instr->holder(); |
| 4098 Handle<JSObject> current_prototype = instr->prototype(); | 4130 Handle<JSObject> current_prototype = instr->prototype(); |
| 4099 | 4131 |
| 4100 // Load prototype object. | 4132 // Load prototype object. |
| 4101 __ LoadHeapObject(reg, current_prototype); | 4133 __ LoadHeapObject(reg, current_prototype); |
| 4102 | 4134 |
| 4103 // Check prototype maps up to the holder. | 4135 // Check prototype maps up to the holder. |
| 4104 while (!current_prototype.is_identical_to(holder)) { | 4136 while (!current_prototype.is_identical_to(holder)) { |
| 4105 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 4137 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()), |
| 4106 Handle<Map>(current_prototype->map())); | 4138 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
| 4107 DeoptimizeIf(not_equal, instr->environment()); | 4139 |
| 4108 current_prototype = | 4140 current_prototype = |
| 4109 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | 4141 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); |
| 4110 // Load next prototype object. | 4142 // Load next prototype object. |
| 4111 __ LoadHeapObject(reg, current_prototype); | 4143 __ LoadHeapObject(reg, current_prototype); |
| 4112 } | 4144 } |
| 4113 | 4145 |
| 4114 // Check the holder map. | 4146 // Check the holder map. |
| 4115 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 4147 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()), |
| 4116 Handle<Map>(current_prototype->map())); | 4148 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
| 4117 DeoptimizeIf(not_equal, instr->environment()); | |
| 4118 } | 4149 } |
| 4119 | 4150 |
| 4120 | 4151 |
| 4121 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 4152 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
| 4122 ASSERT(ToRegister(instr->context()).is(esi)); | 4153 ASSERT(ToRegister(instr->context()).is(esi)); |
| 4123 Heap* heap = isolate()->heap(); | 4154 Heap* heap = isolate()->heap(); |
| 4124 ElementsKind boilerplate_elements_kind = | 4155 ElementsKind boilerplate_elements_kind = |
| 4125 instr->hydrogen()->boilerplate_elements_kind(); | 4156 instr->hydrogen()->boilerplate_elements_kind(); |
| 4126 | 4157 |
| 4127 // Deopt if the array literal boilerplate ElementsKind is of a type different | 4158 // Deopt if the array literal boilerplate ElementsKind is of a type different |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4612 this, pointers, Safepoint::kLazyDeopt); | 4643 this, pointers, Safepoint::kLazyDeopt); |
| 4613 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4644 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
| 4614 } | 4645 } |
| 4615 | 4646 |
| 4616 | 4647 |
| 4617 #undef __ | 4648 #undef __ |
| 4618 | 4649 |
| 4619 } } // namespace v8::internal | 4650 } } // namespace v8::internal |
| 4620 | 4651 |
| 4621 #endif // V8_TARGET_ARCH_IA32 | 4652 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |