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

Side by Side Diff: src/runtime.cc

Issue 6334083: Streamline the code for patching optimized code for lazy deopt. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Rewrite the incorrect comment mentioning absolute calls. Created 9 years, 10 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-inl.h ('k') | src/safepoint-table.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 6952 matching lines...) Expand 10 before | Expand all | Expand 10 after
6963 JavaScriptFrameIterator it; 6963 JavaScriptFrameIterator it;
6964 JavaScriptFrame* frame = it.frame(); 6964 JavaScriptFrame* frame = it.frame();
6965 ASSERT(frame->function() == *function); 6965 ASSERT(frame->function() == *function);
6966 ASSERT(frame->code() == *unoptimized); 6966 ASSERT(frame->code() == *unoptimized);
6967 ASSERT(unoptimized->contains(frame->pc())); 6967 ASSERT(unoptimized->contains(frame->pc()));
6968 6968
6969 // Use linear search of the unoptimized code's stack check table to find 6969 // Use linear search of the unoptimized code's stack check table to find
6970 // the AST id matching the PC. 6970 // the AST id matching the PC.
6971 Address start = unoptimized->instruction_start(); 6971 Address start = unoptimized->instruction_start();
6972 unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start); 6972 unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start);
6973 Address table_cursor = start + unoptimized->stack_check_table_start(); 6973 Address table_cursor = start + unoptimized->stack_check_table_offset();
6974 uint32_t table_length = Memory::uint32_at(table_cursor); 6974 uint32_t table_length = Memory::uint32_at(table_cursor);
6975 table_cursor += kIntSize; 6975 table_cursor += kIntSize;
6976 for (unsigned i = 0; i < table_length; ++i) { 6976 for (unsigned i = 0; i < table_length; ++i) {
6977 // Table entries are (AST id, pc offset) pairs. 6977 // Table entries are (AST id, pc offset) pairs.
6978 uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize); 6978 uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize);
6979 if (pc_offset == target_pc_offset) { 6979 if (pc_offset == target_pc_offset) {
6980 ast_id = static_cast<int>(Memory::uint32_at(table_cursor)); 6980 ast_id = static_cast<int>(Memory::uint32_at(table_cursor));
6981 break; 6981 break;
6982 } 6982 }
6983 table_cursor += 2 * kIntSize; 6983 table_cursor += 2 * kIntSize;
(...skipping 4006 matching lines...) Expand 10 before | Expand all | Expand 10 after
10990 } else { 10990 } else {
10991 // Handle last resort GC and make sure to allow future allocations 10991 // Handle last resort GC and make sure to allow future allocations
10992 // to grow the heap without causing GCs (if possible). 10992 // to grow the heap without causing GCs (if possible).
10993 Counters::gc_last_resort_from_js.Increment(); 10993 Counters::gc_last_resort_from_js.Increment();
10994 Heap::CollectAllGarbage(false); 10994 Heap::CollectAllGarbage(false);
10995 } 10995 }
10996 } 10996 }
10997 10997
10998 10998
10999 } } // namespace v8::internal 10999 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/safepoint-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698