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

Side by Side Diff: src/objects.cc

Issue 22424002: Wrap back edge table in an iterator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/full-codegen.h ('k') | src/runtime.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 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 10777 matching lines...) Expand 10 before | Expand all | Expand 10 after
10788 PrintF(out, " argc: %d", entry.argument_count()); 10788 PrintF(out, " argc: %d", entry.argument_count());
10789 } 10789 }
10790 PrintF(out, "\n"); 10790 PrintF(out, "\n");
10791 } 10791 }
10792 PrintF(out, "\n"); 10792 PrintF(out, "\n");
10793 } else if (kind() == FUNCTION) { 10793 } else if (kind() == FUNCTION) {
10794 unsigned offset = back_edge_table_offset(); 10794 unsigned offset = back_edge_table_offset();
10795 // If there is no back edge table, the "table start" will be at or after 10795 // If there is no back edge table, the "table start" will be at or after
10796 // (due to alignment) the end of the instruction stream. 10796 // (due to alignment) the end of the instruction stream.
10797 if (static_cast<int>(offset) < instruction_size()) { 10797 if (static_cast<int>(offset) < instruction_size()) {
10798 Address back_edge_cursor = instruction_start() + offset; 10798 FullCodeGenerator::BackEdgeTableIterator back_edges(this);
10799 uint32_t table_length = Memory::uint32_at(back_edge_cursor); 10799
10800 PrintF(out, "Back edges (size = %u)\n", table_length); 10800 PrintF(out, "Back edges (size = %u)\n", back_edges.table_length());
10801 PrintF(out, "ast_id pc_offset loop_depth\n"); 10801 PrintF(out, "ast_id pc_offset loop_depth\n");
10802 for (uint32_t i = 0; i < table_length; ++i) { 10802
10803 uint32_t ast_id = Memory::uint32_at(back_edge_cursor); 10803 for ( ; !back_edges.Done(); back_edges.Next()) {
10804 uint32_t pc_offset = Memory::uint32_at(back_edge_cursor + kIntSize); 10804 PrintF(out, "%6d %9u %10u\n", back_edges.ast_id().ToInt(),
10805 uint32_t loop_depth = Memory::uint32_at(back_edge_cursor + 10805 back_edges.pc_offset(),
10806 2 * kIntSize); 10806 back_edges.loop_depth());
10807 PrintF(out, "%6u %9u %10u\n", ast_id, pc_offset, loop_depth);
10808 back_edge_cursor += FullCodeGenerator::kBackEdgeEntrySize;
10809 } 10807 }
10808
10810 PrintF(out, "\n"); 10809 PrintF(out, "\n");
10811 } 10810 }
10812 #ifdef OBJECT_PRINT 10811 #ifdef OBJECT_PRINT
10813 if (!type_feedback_info()->IsUndefined()) { 10812 if (!type_feedback_info()->IsUndefined()) {
10814 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out); 10813 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out);
10815 PrintF(out, "\n"); 10814 PrintF(out, "\n");
10816 } 10815 }
10817 #endif 10816 #endif
10818 } 10817 }
10819 10818
(...skipping 5151 matching lines...) Expand 10 before | Expand all | Expand 10 after
15971 #define ERROR_MESSAGES_TEXTS(C, T) T, 15970 #define ERROR_MESSAGES_TEXTS(C, T) T,
15972 static const char* error_messages_[] = { 15971 static const char* error_messages_[] = {
15973 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 15972 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
15974 }; 15973 };
15975 #undef ERROR_MESSAGES_TEXTS 15974 #undef ERROR_MESSAGES_TEXTS
15976 return error_messages_[reason]; 15975 return error_messages_[reason];
15977 } 15976 }
15978 15977
15979 15978
15980 } } // namespace v8::internal 15979 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698