| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4010 ASSERT(ToRegister(instr->value()).is(rax)); | 4010 ASSERT(ToRegister(instr->value()).is(rax)); |
| 4011 | 4011 |
| 4012 __ Move(rcx, instr->hydrogen()->name()); | 4012 __ Move(rcx, instr->hydrogen()->name()); |
| 4013 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4013 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
| 4014 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 4014 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 4015 : isolate()->builtins()->StoreIC_Initialize(); | 4015 : isolate()->builtins()->StoreIC_Initialize(); |
| 4016 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4016 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4017 } | 4017 } |
| 4018 | 4018 |
| 4019 | 4019 |
| 4020 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { |
| 4021 if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
| 4022 Label done; |
| 4023 __ j(NegateCondition(cc), &done, Label::kNear); |
| 4024 __ int3(); |
| 4025 __ bind(&done); |
| 4026 } else { |
| 4027 DeoptimizeIf(cc, check->environment()); |
| 4028 } |
| 4029 } |
| 4030 |
| 4031 |
| 4020 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4032 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 4021 if (instr->hydrogen()->skip_check()) return; | 4033 if (instr->hydrogen()->skip_check()) return; |
| 4022 | 4034 |
| 4023 if (instr->length()->IsRegister()) { | 4035 if (instr->length()->IsRegister()) { |
| 4024 Register reg = ToRegister(instr->length()); | 4036 Register reg = ToRegister(instr->length()); |
| 4025 if (!instr->hydrogen()->length()->representation().IsSmi()) { | 4037 if (!instr->hydrogen()->length()->representation().IsSmi()) { |
| 4026 __ AssertZeroExtended(reg); | 4038 __ AssertZeroExtended(reg); |
| 4027 } | 4039 } |
| 4028 if (instr->index()->IsConstantOperand()) { | 4040 if (instr->index()->IsConstantOperand()) { |
| 4029 int constant_index = | 4041 int constant_index = |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4047 ToInteger32(LConstantOperand::cast(instr->index())); | 4059 ToInteger32(LConstantOperand::cast(instr->index())); |
| 4048 if (instr->hydrogen()->length()->representation().IsSmi()) { | 4060 if (instr->hydrogen()->length()->representation().IsSmi()) { |
| 4049 __ Cmp(length, Smi::FromInt(constant_index)); | 4061 __ Cmp(length, Smi::FromInt(constant_index)); |
| 4050 } else { | 4062 } else { |
| 4051 __ cmpq(length, Immediate(constant_index)); | 4063 __ cmpq(length, Immediate(constant_index)); |
| 4052 } | 4064 } |
| 4053 } else { | 4065 } else { |
| 4054 __ cmpq(length, ToRegister(instr->index())); | 4066 __ cmpq(length, ToRegister(instr->index())); |
| 4055 } | 4067 } |
| 4056 } | 4068 } |
| 4057 DeoptimizeIf(below_equal, instr->environment()); | 4069 Condition condition = |
| 4070 instr->hydrogen()->allow_equality() ? below : below_equal; |
| 4071 ApplyCheckIf(condition, instr); |
| 4058 } | 4072 } |
| 4059 | 4073 |
| 4060 | 4074 |
| 4061 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { | 4075 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
| 4062 ElementsKind elements_kind = instr->elements_kind(); | 4076 ElementsKind elements_kind = instr->elements_kind(); |
| 4063 LOperand* key = instr->key(); | 4077 LOperand* key = instr->key(); |
| 4064 if (!key->IsConstantOperand()) { | 4078 if (!key->IsConstantOperand()) { |
| 4065 Register key_reg = ToRegister(key); | 4079 Register key_reg = ToRegister(key); |
| 4066 // Even though the HLoad/StoreKeyedFastElement instructions force | 4080 // Even though the HLoad/StoreKeyedFastElement instructions force |
| 4067 // the input representation for the key to be an integer, the input | 4081 // the input representation for the key to be an integer, the input |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5536 FixedArray::kHeaderSize - kPointerSize)); | 5550 FixedArray::kHeaderSize - kPointerSize)); |
| 5537 __ bind(&done); | 5551 __ bind(&done); |
| 5538 } | 5552 } |
| 5539 | 5553 |
| 5540 | 5554 |
| 5541 #undef __ | 5555 #undef __ |
| 5542 | 5556 |
| 5543 } } // namespace v8::internal | 5557 } } // namespace v8::internal |
| 5544 | 5558 |
| 5545 #endif // V8_TARGET_ARCH_X64 | 5559 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |