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

Side by Side Diff: src/objects.cc

Issue 13811014: Fix OSR for nested loops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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/objects.h ('k') | src/objects-inl.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 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 9079 matching lines...) Expand 10 before | Expand all | Expand 10 after
9090 return statement_position; 9090 return statement_position;
9091 } 9091 }
9092 9092
9093 9093
9094 SafepointEntry Code::GetSafepointEntry(Address pc) { 9094 SafepointEntry Code::GetSafepointEntry(Address pc) {
9095 SafepointTable table(this); 9095 SafepointTable table(this);
9096 return table.FindEntry(pc); 9096 return table.FindEntry(pc);
9097 } 9097 }
9098 9098
9099 9099
9100 void Code::SetNoStackCheckTable() {
9101 // Indicate the absence of a stack-check table by a table start after the
9102 // end of the instructions. Table start must be aligned, so round up.
9103 set_stack_check_table_offset(RoundUp(instruction_size(), kIntSize));
9104 }
9105
9106
9107 Map* Code::FindFirstMap() { 9100 Map* Code::FindFirstMap() {
9108 ASSERT(is_inline_cache_stub()); 9101 ASSERT(is_inline_cache_stub());
9109 AssertNoAllocation no_allocation; 9102 AssertNoAllocation no_allocation;
9110 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); 9103 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
9111 for (RelocIterator it(this, mask); !it.done(); it.next()) { 9104 for (RelocIterator it(this, mask); !it.done(); it.next()) {
9112 RelocInfo* info = it.rinfo(); 9105 RelocInfo* info = it.rinfo();
9113 Object* object = info->target_object(); 9106 Object* object = info->target_object();
9114 if (object->IsMap()) return Map::cast(object); 9107 if (object->IsMap()) return Map::cast(object);
9115 } 9108 }
9116 return NULL; 9109 return NULL;
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
9615 } else { 9608 } else {
9616 PrintF(out, " <none>"); 9609 PrintF(out, " <none>");
9617 } 9610 }
9618 if (entry.argument_count() > 0) { 9611 if (entry.argument_count() > 0) {
9619 PrintF(out, " argc: %d", entry.argument_count()); 9612 PrintF(out, " argc: %d", entry.argument_count());
9620 } 9613 }
9621 PrintF(out, "\n"); 9614 PrintF(out, "\n");
9622 } 9615 }
9623 PrintF(out, "\n"); 9616 PrintF(out, "\n");
9624 } else if (kind() == FUNCTION) { 9617 } else if (kind() == FUNCTION) {
9625 unsigned offset = stack_check_table_offset(); 9618 unsigned offset = back_edge_table_offset();
9626 // If there is no stack check table, the "table start" will at or after 9619 // If there is no back edge table, the "table start" will be at or after
9627 // (due to alignment) the end of the instruction stream. 9620 // (due to alignment) the end of the instruction stream.
9628 if (static_cast<int>(offset) < instruction_size()) { 9621 if (static_cast<int>(offset) < instruction_size()) {
9629 unsigned* address = 9622 Address back_edge_cursor = instruction_start() + offset;
9630 reinterpret_cast<unsigned*>(instruction_start() + offset); 9623 uint32_t table_length = Memory::uint32_at(back_edge_cursor);
9631 unsigned length = address[0]; 9624 PrintF(out, "Back edges (size = %u)\n", table_length);
9632 PrintF(out, "Stack checks (size = %u)\n", length); 9625 PrintF(out, "ast_id pc_offset loop_depth\n");
9633 PrintF(out, "ast_id pc_offset\n"); 9626 for (uint32_t i = 0; i < table_length; ++i) {
9634 for (unsigned i = 0; i < length; ++i) { 9627 uint32_t ast_id = Memory::uint32_at(back_edge_cursor);
9635 unsigned index = (2 * i) + 1; 9628 uint32_t pc_offset = Memory::uint32_at(back_edge_cursor + kIntSize);
9636 PrintF(out, "%6u %9u\n", address[index], address[index + 1]); 9629 uint8_t loop_depth = Memory::uint8_at(back_edge_cursor + 2 * kIntSize);
9630 PrintF(out, "%6u %9u %10u\n", ast_id, pc_offset, loop_depth);
9631 back_edge_cursor += FullCodeGenerator::kBackEdgeEntrySize;
9637 } 9632 }
9638 PrintF(out, "\n"); 9633 PrintF(out, "\n");
9639 } 9634 }
9640 #ifdef OBJECT_PRINT 9635 #ifdef OBJECT_PRINT
9641 if (!type_feedback_info()->IsUndefined()) { 9636 if (!type_feedback_info()->IsUndefined()) {
9642 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out); 9637 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out);
9643 PrintF(out, "\n"); 9638 PrintF(out, "\n");
9644 } 9639 }
9645 #endif 9640 #endif
9646 } 9641 }
(...skipping 4818 matching lines...) Expand 10 before | Expand all | Expand 10 after
14465 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14460 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14466 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14461 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14467 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14462 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14468 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14463 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14469 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14464 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14470 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14465 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14471 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14466 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14472 } 14467 }
14473 14468
14474 } } // namespace v8::internal 14469 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698