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

Side by Side Diff: src/full-codegen.cc

Issue 11745027: Replaced a bailout ID assertion with quadratic time complexity by a linear one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/full-codegen.h ('k') | src/lithium-allocator.h » ('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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 441
442 442
443 void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, State state) { 443 void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, State state) {
444 // There's no need to prepare this code for bailouts from already optimized 444 // There's no need to prepare this code for bailouts from already optimized
445 // code or code that can't be optimized. 445 // code or code that can't be optimized.
446 if (!info_->HasDeoptimizationSupport()) return; 446 if (!info_->HasDeoptimizationSupport()) return;
447 unsigned pc_and_state = 447 unsigned pc_and_state =
448 StateField::encode(state) | PcField::encode(masm_->pc_offset()); 448 StateField::encode(state) | PcField::encode(masm_->pc_offset());
449 ASSERT(Smi::IsValid(pc_and_state)); 449 ASSERT(Smi::IsValid(pc_and_state));
450 BailoutEntry entry = { id, pc_and_state }; 450 BailoutEntry entry = { id, pc_and_state };
451 #ifdef DEBUG 451 ASSERT(!prepared_bailout_ids_.Contains(id.ToInt()));
452 if (FLAG_enable_slow_asserts) { 452 prepared_bailout_ids_.Add(id.ToInt(), zone());
453 // Assert that we don't have multiple bailout entries for the same node.
454 for (int i = 0; i < bailout_entries_.length(); i++) {
455 if (bailout_entries_.at(i).id == entry.id) {
456 AstPrinter printer;
457 PrintF("%s", printer.PrintProgram(info_->function()));
458 UNREACHABLE();
459 }
460 }
461 }
462 #endif // DEBUG
463 bailout_entries_.Add(entry, zone()); 453 bailout_entries_.Add(entry, zone());
464 } 454 }
465 455
466 456
467 void FullCodeGenerator::RecordTypeFeedbackCell( 457 void FullCodeGenerator::RecordTypeFeedbackCell(
468 TypeFeedbackId id, Handle<JSGlobalPropertyCell> cell) { 458 TypeFeedbackId id, Handle<JSGlobalPropertyCell> cell) {
469 TypeFeedbackCellEntry entry = { id, cell }; 459 TypeFeedbackCellEntry entry = { id, cell };
470 type_feedback_cells_.Add(entry, zone()); 460 type_feedback_cells_.Add(entry, zone());
471 } 461 }
472 462
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 } 1568 }
1579 1569
1580 return false; 1570 return false;
1581 } 1571 }
1582 1572
1583 1573
1584 #undef __ 1574 #undef __
1585 1575
1586 1576
1587 } } // namespace v8::internal 1577 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/lithium-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698