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 5008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5019 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 5019 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
5020 LOperand* input = instr->value(); | 5020 LOperand* input = instr->value(); |
5021 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 5021 ASSERT(input->IsRegister() && input->Equals(instr->result())); |
5022 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); | 5022 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); |
5023 __ SmiTag(ToRegister(input)); | 5023 __ SmiTag(ToRegister(input)); |
5024 } | 5024 } |
5025 | 5025 |
5026 | 5026 |
5027 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { | 5027 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
5028 LOperand* input = instr->value(); | 5028 LOperand* input = instr->value(); |
5029 Register result = ToRegister(input); | |
5029 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 5030 ASSERT(input->IsRegister() && input->Equals(instr->result())); |
5030 if (instr->needs_check()) { | 5031 if (instr->needs_check()) { |
5031 __ test(ToRegister(input), Immediate(kSmiTagMask)); | 5032 __ test(result, Immediate(kSmiTagMask)); |
5032 DeoptimizeIf(not_zero, instr->environment()); | 5033 DeoptimizeIf(not_zero, instr->environment()); |
5034 } else if (instr->hydrogen()->value()->IsLoadKeyed()) { | |
5035 HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value()); | |
5036 if (load->UsesMustHandleHole()) { | |
Jakob Kummerow
2013/05/22 14:06:07
As discussed offline, I think you need to consider
| |
5037 Label done; | |
5038 __ test(result, Immediate(kSmiTagMask)); | |
5039 __ j(equal, &done); | |
5040 __ xor_(result, result); | |
5041 __ bind(&done); | |
5042 } else { | |
5043 __ AssertSmi(result); | |
5044 } | |
5033 } else { | 5045 } else { |
5034 __ AssertSmi(ToRegister(input)); | 5046 __ AssertSmi(result); |
5035 } | 5047 } |
5036 __ SmiUntag(ToRegister(input)); | 5048 __ SmiUntag(result); |
5037 } | 5049 } |
5038 | 5050 |
5039 | 5051 |
5040 void LCodeGen::EmitNumberUntagDNoSSE2(Register input_reg, | 5052 void LCodeGen::EmitNumberUntagDNoSSE2(Register input_reg, |
5041 Register temp_reg, | 5053 Register temp_reg, |
5042 bool deoptimize_on_undefined, | 5054 bool deoptimize_on_undefined, |
5043 bool deoptimize_on_minus_zero, | 5055 bool deoptimize_on_minus_zero, |
5044 LEnvironment* env, | 5056 LEnvironment* env, |
5045 NumberUntagDMode mode) { | 5057 NumberUntagDMode mode) { |
5046 Label load_smi, done; | 5058 Label load_smi, done; |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6511 FixedArray::kHeaderSize - kPointerSize)); | 6523 FixedArray::kHeaderSize - kPointerSize)); |
6512 __ bind(&done); | 6524 __ bind(&done); |
6513 } | 6525 } |
6514 | 6526 |
6515 | 6527 |
6516 #undef __ | 6528 #undef __ |
6517 | 6529 |
6518 } } // namespace v8::internal | 6530 } } // namespace v8::internal |
6519 | 6531 |
6520 #endif // V8_TARGET_ARCH_IA32 | 6532 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |