OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2066 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx); | 2066 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx); |
2067 __ bind(&aligned); | 2067 __ bind(&aligned); |
2068 } | 2068 } |
2069 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx); | 2069 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx); |
2070 } | 2070 } |
2071 | 2071 |
2072 | 2072 |
2073 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2073 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
2074 Register result = ToRegister(instr->result()); | 2074 Register result = ToRegister(instr->result()); |
2075 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); | 2075 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); |
2076 if (instr->hydrogen()->check_hole_value()) { | 2076 if (instr->hydrogen()->RequiresHoleCheck()) { |
2077 __ cmp(result, factory()->the_hole_value()); | 2077 __ cmp(result, factory()->the_hole_value()); |
2078 DeoptimizeIf(equal, instr->environment()); | 2078 DeoptimizeIf(equal, instr->environment()); |
2079 } | 2079 } |
2080 } | 2080 } |
2081 | 2081 |
2082 | 2082 |
2083 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2083 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2084 ASSERT(ToRegister(instr->context()).is(esi)); | 2084 ASSERT(ToRegister(instr->context()).is(esi)); |
2085 ASSERT(ToRegister(instr->global_object()).is(eax)); | 2085 ASSERT(ToRegister(instr->global_object()).is(eax)); |
2086 ASSERT(ToRegister(instr->result()).is(eax)); | 2086 ASSERT(ToRegister(instr->result()).is(eax)); |
(...skipping 13 matching lines...) Expand all Loading... |
2100 ASSERT(!value.is(object)); | 2100 ASSERT(!value.is(object)); |
2101 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); | 2101 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); |
2102 | 2102 |
2103 int offset = JSGlobalPropertyCell::kValueOffset; | 2103 int offset = JSGlobalPropertyCell::kValueOffset; |
2104 __ mov(object, Immediate(cell_handle)); | 2104 __ mov(object, Immediate(cell_handle)); |
2105 | 2105 |
2106 // If the cell we are storing to contains the hole it could have | 2106 // If the cell we are storing to contains the hole it could have |
2107 // been deleted from the property dictionary. In that case, we need | 2107 // been deleted from the property dictionary. In that case, we need |
2108 // to update the property details in the property dictionary to mark | 2108 // to update the property details in the property dictionary to mark |
2109 // it as no longer deleted. We deoptimize in that case. | 2109 // it as no longer deleted. We deoptimize in that case. |
2110 if (instr->hydrogen()->check_hole_value()) { | 2110 if (instr->hydrogen()->RequiresHoleCheck()) { |
2111 __ cmp(FieldOperand(object, offset), factory()->the_hole_value()); | 2111 __ cmp(FieldOperand(object, offset), factory()->the_hole_value()); |
2112 DeoptimizeIf(equal, instr->environment()); | 2112 DeoptimizeIf(equal, instr->environment()); |
2113 } | 2113 } |
2114 | 2114 |
2115 // Store the value. | 2115 // Store the value. |
2116 __ mov(FieldOperand(object, offset), value); | 2116 __ mov(FieldOperand(object, offset), value); |
2117 | 2117 |
2118 // Cells are always in the remembered set. | 2118 // Cells are always in the remembered set. |
2119 __ RecordWriteField(object, | 2119 __ RecordWriteField(object, |
2120 offset, | 2120 offset, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 __ cmp(result, factory()->the_hole_value()); | 2362 __ cmp(result, factory()->the_hole_value()); |
2363 DeoptimizeIf(equal, instr->environment()); | 2363 DeoptimizeIf(equal, instr->environment()); |
2364 } | 2364 } |
2365 } | 2365 } |
2366 | 2366 |
2367 | 2367 |
2368 void LCodeGen::DoLoadKeyedFastDoubleElement( | 2368 void LCodeGen::DoLoadKeyedFastDoubleElement( |
2369 LLoadKeyedFastDoubleElement* instr) { | 2369 LLoadKeyedFastDoubleElement* instr) { |
2370 XMMRegister result = ToDoubleRegister(instr->result()); | 2370 XMMRegister result = ToDoubleRegister(instr->result()); |
2371 | 2371 |
2372 if (instr->hydrogen()->RequiresHoleCheck()) { | 2372 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + |
2373 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + | 2373 sizeof(kHoleNanLower32); |
2374 sizeof(kHoleNanLower32); | 2374 Operand hole_check_operand = BuildFastArrayOperand( |
2375 Operand hole_check_operand = BuildFastArrayOperand( | 2375 instr->elements(), instr->key(), |
2376 instr->elements(), instr->key(), | 2376 FAST_DOUBLE_ELEMENTS, |
2377 FAST_DOUBLE_ELEMENTS, | 2377 offset); |
2378 offset); | 2378 __ cmp(hole_check_operand, Immediate(kHoleNanUpper32)); |
2379 __ cmp(hole_check_operand, Immediate(kHoleNanUpper32)); | 2379 DeoptimizeIf(equal, instr->environment()); |
2380 DeoptimizeIf(equal, instr->environment()); | |
2381 } | |
2382 | 2380 |
2383 Operand double_load_operand = BuildFastArrayOperand( | 2381 Operand double_load_operand = BuildFastArrayOperand( |
2384 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, | 2382 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, |
2385 FixedDoubleArray::kHeaderSize - kHeapObjectTag); | 2383 FixedDoubleArray::kHeaderSize - kHeapObjectTag); |
2386 __ movdbl(result, double_load_operand); | 2384 __ movdbl(result, double_load_operand); |
2387 } | 2385 } |
2388 | 2386 |
2389 | 2387 |
2390 Operand LCodeGen::BuildFastArrayOperand( | 2388 Operand LCodeGen::BuildFastArrayOperand( |
2391 LOperand* elements_pointer, | 2389 LOperand* elements_pointer, |
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4484 env->deoptimization_index()); | 4482 env->deoptimization_index()); |
4485 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4483 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4486 } | 4484 } |
4487 | 4485 |
4488 | 4486 |
4489 #undef __ | 4487 #undef __ |
4490 | 4488 |
4491 } } // namespace v8::internal | 4489 } } // namespace v8::internal |
4492 | 4490 |
4493 #endif // V8_TARGET_ARCH_IA32 | 4491 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |