Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 17568015: New array bounds check elimination pass (focused on induction variables and bitwise operations). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Switched flag to false by default. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4430 matching lines...) Expand 10 before | Expand all | Expand 10 after
4441 ASSERT(ToRegister(instr->value()).is(eax)); 4441 ASSERT(ToRegister(instr->value()).is(eax));
4442 4442
4443 __ mov(ecx, instr->name()); 4443 __ mov(ecx, instr->name());
4444 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 4444 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
4445 ? isolate()->builtins()->StoreIC_Initialize_Strict() 4445 ? isolate()->builtins()->StoreIC_Initialize_Strict()
4446 : isolate()->builtins()->StoreIC_Initialize(); 4446 : isolate()->builtins()->StoreIC_Initialize();
4447 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4447 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4448 } 4448 }
4449 4449
4450 4450
4451 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) {
4452 if (FLAG_debug_code && check->hydrogen()->skip_check()) {
4453 Label done;
4454 __ j(NegateCondition(cc), &done, Label::kNear);
4455 __ int3();
4456 __ bind(&done);
4457 } else {
4458 DeoptimizeIf(cc, check->environment());
4459 }
4460 }
4461
4462
4451 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4463 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4452 if (instr->hydrogen()->skip_check()) return; 4464 if (instr->hydrogen()->skip_check() && !FLAG_debug_code) return;
4453 4465
4454 if (instr->index()->IsConstantOperand()) { 4466 if (instr->index()->IsConstantOperand()) {
4455 int constant_index = 4467 int constant_index =
4456 ToInteger32(LConstantOperand::cast(instr->index())); 4468 ToInteger32(LConstantOperand::cast(instr->index()));
4457 if (instr->hydrogen()->length()->representation().IsSmi()) { 4469 if (instr->hydrogen()->length()->representation().IsSmi()) {
4458 __ cmp(ToOperand(instr->length()), 4470 __ cmp(ToOperand(instr->length()),
4459 Immediate(Smi::FromInt(constant_index))); 4471 Immediate(Smi::FromInt(constant_index)));
4460 } else { 4472 } else {
4461 __ cmp(ToOperand(instr->length()), Immediate(constant_index)); 4473 __ cmp(ToOperand(instr->length()), Immediate(constant_index));
4462 } 4474 }
4463 DeoptimizeIf(below_equal, instr->environment()); 4475 Condition condition =
4476 instr->hydrogen()->allow_equality() ? below : below_equal;
4477 ApplyCheckIf(condition, instr);
4464 } else { 4478 } else {
4465 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); 4479 __ cmp(ToRegister(instr->index()), ToOperand(instr->length()));
4466 DeoptimizeIf(above_equal, instr->environment()); 4480 Condition condition =
4481 instr->hydrogen()->allow_equality() ? above : above_equal;
4482 ApplyCheckIf(condition, instr);
4467 } 4483 }
4468 } 4484 }
4469 4485
4470 4486
4471 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 4487 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4472 ElementsKind elements_kind = instr->elements_kind(); 4488 ElementsKind elements_kind = instr->elements_kind();
4473 LOperand* key = instr->key(); 4489 LOperand* key = instr->key();
4474 if (!key->IsConstantOperand() && 4490 if (!key->IsConstantOperand() &&
4475 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(), 4491 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(),
4476 elements_kind)) { 4492 elements_kind)) {
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
6499 FixedArray::kHeaderSize - kPointerSize)); 6515 FixedArray::kHeaderSize - kPointerSize));
6500 __ bind(&done); 6516 __ bind(&done);
6501 } 6517 }
6502 6518
6503 6519
6504 #undef __ 6520 #undef __
6505 6521
6506 } } // namespace v8::internal 6522 } } // namespace v8::internal
6507 6523
6508 #endif // V8_TARGET_ARCH_IA32 6524 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698