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 4361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4372 ASSERT(ToRegister(instr->value()).is(eax)); | 4372 ASSERT(ToRegister(instr->value()).is(eax)); |
4373 | 4373 |
4374 __ mov(ecx, instr->name()); | 4374 __ mov(ecx, instr->name()); |
4375 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4375 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
4376 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 4376 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
4377 : isolate()->builtins()->StoreIC_Initialize(); | 4377 : isolate()->builtins()->StoreIC_Initialize(); |
4378 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4378 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4379 } | 4379 } |
4380 | 4380 |
4381 | 4381 |
4382 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { | |
titzer
2013/06/24 14:03:30
Is this a remnant of debugging code? What does thi
| |
4383 if (FLAG_debug_code && check->hydrogen()->skip_check()) { | |
4384 Label done; | |
4385 __ j(NegateCondition(cc), &done, Label::kNear); | |
4386 __ int3(); | |
4387 __ bind(&done); | |
4388 } else { | |
4389 DeoptimizeIf(cc, check->environment()); | |
4390 } | |
4391 } | |
4392 | |
4393 | |
4382 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4394 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4383 if (instr->hydrogen()->skip_check()) return; | 4395 if (instr->hydrogen()->skip_check() && !FLAG_debug_code) return; |
4384 | 4396 |
4385 if (instr->index()->IsConstantOperand()) { | 4397 if (instr->index()->IsConstantOperand()) { |
4386 int constant_index = | 4398 int constant_index = |
4387 ToInteger32(LConstantOperand::cast(instr->index())); | 4399 ToInteger32(LConstantOperand::cast(instr->index())); |
4388 if (instr->hydrogen()->length()->representation().IsSmi()) { | 4400 if (instr->hydrogen()->length()->representation().IsSmi()) { |
4389 __ cmp(ToOperand(instr->length()), | 4401 __ cmp(ToOperand(instr->length()), |
4390 Immediate(Smi::FromInt(constant_index))); | 4402 Immediate(Smi::FromInt(constant_index))); |
4391 } else { | 4403 } else { |
4392 __ cmp(ToOperand(instr->length()), Immediate(constant_index)); | 4404 __ cmp(ToOperand(instr->length()), Immediate(constant_index)); |
4393 } | 4405 } |
4394 DeoptimizeIf(below_equal, instr->environment()); | 4406 Condition condition = |
4407 instr->hydrogen()->allow_equality() ? below : below_equal; | |
4408 ApplyCheckIf(condition, instr); | |
4395 } else { | 4409 } else { |
4396 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); | 4410 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); |
4397 DeoptimizeIf(above_equal, instr->environment()); | 4411 Condition condition = |
4412 instr->hydrogen()->allow_equality() ? above : above_equal; | |
4413 ApplyCheckIf(condition, instr); | |
4398 } | 4414 } |
4399 } | 4415 } |
4400 | 4416 |
4401 | 4417 |
4402 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { | 4418 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
4403 ElementsKind elements_kind = instr->elements_kind(); | 4419 ElementsKind elements_kind = instr->elements_kind(); |
4404 LOperand* key = instr->key(); | 4420 LOperand* key = instr->key(); |
4405 if (!key->IsConstantOperand() && | 4421 if (!key->IsConstantOperand() && |
4406 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(), | 4422 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(), |
4407 elements_kind)) { | 4423 elements_kind)) { |
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6504 FixedArray::kHeaderSize - kPointerSize)); | 6520 FixedArray::kHeaderSize - kPointerSize)); |
6505 __ bind(&done); | 6521 __ bind(&done); |
6506 } | 6522 } |
6507 | 6523 |
6508 | 6524 |
6509 #undef __ | 6525 #undef __ |
6510 | 6526 |
6511 } } // namespace v8::internal | 6527 } } // namespace v8::internal |
6512 | 6528 |
6513 #endif // V8_TARGET_ARCH_IA32 | 6529 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |