| 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 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 // Load the result. | 2428 // Load the result. |
| 2429 __ mov(result, | 2429 __ mov(result, |
| 2430 BuildFastArrayOperand(instr->elements(), | 2430 BuildFastArrayOperand(instr->elements(), |
| 2431 instr->key(), | 2431 instr->key(), |
| 2432 FAST_ELEMENTS, | 2432 FAST_ELEMENTS, |
| 2433 FixedArray::kHeaderSize - kHeapObjectTag, | 2433 FixedArray::kHeaderSize - kHeapObjectTag, |
| 2434 instr->additional_index())); | 2434 instr->additional_index())); |
| 2435 | 2435 |
| 2436 // Check for the hole value. | 2436 // Check for the hole value. |
| 2437 if (instr->hydrogen()->RequiresHoleCheck()) { | 2437 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2438 __ cmp(result, factory()->the_hole_value()); | 2438 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
| 2439 DeoptimizeIf(equal, instr->environment()); | 2439 __ test(result, Immediate(kSmiTagMask)); |
| 2440 DeoptimizeIf(not_equal, instr->environment()); |
| 2441 } else { |
| 2442 __ cmp(result, factory()->the_hole_value()); |
| 2443 DeoptimizeIf(equal, instr->environment()); |
| 2444 } |
| 2440 } | 2445 } |
| 2441 } | 2446 } |
| 2442 | 2447 |
| 2443 | 2448 |
| 2444 void LCodeGen::DoLoadKeyedFastDoubleElement( | 2449 void LCodeGen::DoLoadKeyedFastDoubleElement( |
| 2445 LLoadKeyedFastDoubleElement* instr) { | 2450 LLoadKeyedFastDoubleElement* instr) { |
| 2446 XMMRegister result = ToDoubleRegister(instr->result()); | 2451 XMMRegister result = ToDoubleRegister(instr->result()); |
| 2447 | 2452 |
| 2448 if (instr->hydrogen()->RequiresHoleCheck()) { | 2453 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2449 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + | 2454 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3867 __ SmiTag(ToRegister(input)); | 3872 __ SmiTag(ToRegister(input)); |
| 3868 } | 3873 } |
| 3869 | 3874 |
| 3870 | 3875 |
| 3871 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { | 3876 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
| 3872 LOperand* input = instr->InputAt(0); | 3877 LOperand* input = instr->InputAt(0); |
| 3873 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 3878 ASSERT(input->IsRegister() && input->Equals(instr->result())); |
| 3874 if (instr->needs_check()) { | 3879 if (instr->needs_check()) { |
| 3875 __ test(ToRegister(input), Immediate(kSmiTagMask)); | 3880 __ test(ToRegister(input), Immediate(kSmiTagMask)); |
| 3876 DeoptimizeIf(not_zero, instr->environment()); | 3881 DeoptimizeIf(not_zero, instr->environment()); |
| 3882 } else { |
| 3883 if (FLAG_debug_code) { |
| 3884 __ AbortIfNotSmi(ToRegister(input)); |
| 3885 } |
| 3877 } | 3886 } |
| 3878 __ SmiUntag(ToRegister(input)); | 3887 __ SmiUntag(ToRegister(input)); |
| 3879 } | 3888 } |
| 3880 | 3889 |
| 3881 | 3890 |
| 3882 void LCodeGen::EmitNumberUntagD(Register input_reg, | 3891 void LCodeGen::EmitNumberUntagD(Register input_reg, |
| 3883 Register temp_reg, | 3892 Register temp_reg, |
| 3884 XMMRegister result_reg, | 3893 XMMRegister result_reg, |
| 3885 bool deoptimize_on_undefined, | 3894 bool deoptimize_on_undefined, |
| 3886 bool deoptimize_on_minus_zero, | 3895 bool deoptimize_on_minus_zero, |
| (...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5108 FixedArray::kHeaderSize - kPointerSize)); | 5117 FixedArray::kHeaderSize - kPointerSize)); |
| 5109 __ bind(&done); | 5118 __ bind(&done); |
| 5110 } | 5119 } |
| 5111 | 5120 |
| 5112 | 5121 |
| 5113 #undef __ | 5122 #undef __ |
| 5114 | 5123 |
| 5115 } } // namespace v8::internal | 5124 } } // namespace v8::internal |
| 5116 | 5125 |
| 5117 #endif // V8_TARGET_ARCH_IA32 | 5126 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |