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 DEBUG | |
Florian Schneider
2012/06/12 09:01:13
We usually use FLAG_debug_code to emit assertion i
danno
2012/06/12 09:59:22
Done.
| |
3884 Label ok; | |
3885 __ test(ToRegister(input), Immediate(kSmiTagMask)); | |
3886 __ j(zero, &ok, Label::kNear); | |
3887 __ int3(); | |
3888 __ bind(&ok); | |
Florian Schneider
2012/06/12 09:01:13
You could replace this block of instructions with:
danno
2012/06/12 09:59:22
Done.
| |
3889 #endif | |
3877 } | 3890 } |
3878 __ SmiUntag(ToRegister(input)); | 3891 __ SmiUntag(ToRegister(input)); |
3879 } | 3892 } |
3880 | 3893 |
3881 | 3894 |
3882 void LCodeGen::EmitNumberUntagD(Register input_reg, | 3895 void LCodeGen::EmitNumberUntagD(Register input_reg, |
3883 Register temp_reg, | 3896 Register temp_reg, |
3884 XMMRegister result_reg, | 3897 XMMRegister result_reg, |
3885 bool deoptimize_on_undefined, | 3898 bool deoptimize_on_undefined, |
3886 bool deoptimize_on_minus_zero, | 3899 bool deoptimize_on_minus_zero, |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5108 FixedArray::kHeaderSize - kPointerSize)); | 5121 FixedArray::kHeaderSize - kPointerSize)); |
5109 __ bind(&done); | 5122 __ bind(&done); |
5110 } | 5123 } |
5111 | 5124 |
5112 | 5125 |
5113 #undef __ | 5126 #undef __ |
5114 | 5127 |
5115 } } // namespace v8::internal | 5128 } } // namespace v8::internal |
5116 | 5129 |
5117 #endif // V8_TARGET_ARCH_IA32 | 5130 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |