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

Side by Side Diff: src/runtime.cc

Issue 19693017: Merged r15782 into 3.19 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.19
Patch Set: Created 7 years, 5 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.cc ('k') | src/version.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 8192 matching lines...) Expand 10 before | Expand all | Expand 10 after
8203 ASSERT(frame->LookupCode() == *unoptimized); 8203 ASSERT(frame->LookupCode() == *unoptimized);
8204 ASSERT(unoptimized->contains(frame->pc())); 8204 ASSERT(unoptimized->contains(frame->pc()));
8205 8205
8206 // Use linear search of the unoptimized code's back edge table to find 8206 // Use linear search of the unoptimized code's back edge table to find
8207 // the AST id matching the PC. 8207 // the AST id matching the PC.
8208 Address start = unoptimized->instruction_start(); 8208 Address start = unoptimized->instruction_start();
8209 unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start); 8209 unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start);
8210 Address table_cursor = start + unoptimized->back_edge_table_offset(); 8210 Address table_cursor = start + unoptimized->back_edge_table_offset();
8211 uint32_t table_length = Memory::uint32_at(table_cursor); 8211 uint32_t table_length = Memory::uint32_at(table_cursor);
8212 table_cursor += kIntSize; 8212 table_cursor += kIntSize;
8213 uint8_t loop_depth = 0; 8213 uint32_t loop_depth = 0;
8214 for (unsigned i = 0; i < table_length; ++i) { 8214 for (unsigned i = 0; i < table_length; ++i) {
8215 // Table entries are (AST id, pc offset) pairs. 8215 // Table entries are (AST id, pc offset) pairs.
8216 uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize); 8216 uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize);
8217 if (pc_offset == target_pc_offset) { 8217 if (pc_offset == target_pc_offset) {
8218 ast_id = BailoutId(static_cast<int>(Memory::uint32_at(table_cursor))); 8218 ast_id = BailoutId(static_cast<int>(Memory::uint32_at(table_cursor)));
8219 loop_depth = Memory::uint8_at(table_cursor + 2 * kIntSize); 8219 loop_depth = Memory::uint32_at(table_cursor + 2 * kIntSize);
8220 break; 8220 break;
8221 } 8221 }
8222 table_cursor += FullCodeGenerator::kBackEdgeEntrySize; 8222 table_cursor += FullCodeGenerator::kBackEdgeEntrySize;
8223 } 8223 }
8224 ASSERT(!ast_id.IsNone()); 8224 ASSERT(!ast_id.IsNone());
8225 if (FLAG_trace_osr) { 8225 if (FLAG_trace_osr) {
8226 PrintF("[replacing on-stack at AST id %d, loop depth %d in ", 8226 PrintF("[replacing on-stack at AST id %d, loop depth %d in ",
8227 ast_id.ToInt(), loop_depth); 8227 ast_id.ToInt(), loop_depth);
8228 function->PrintName(); 8228 function->PrintName();
8229 PrintF("]\n"); 8229 PrintF("]\n");
(...skipping 5423 matching lines...) Expand 10 before | Expand all | Expand 10 after
13653 // Handle last resort GC and make sure to allow future allocations 13653 // Handle last resort GC and make sure to allow future allocations
13654 // to grow the heap without causing GCs (if possible). 13654 // to grow the heap without causing GCs (if possible).
13655 isolate->counters()->gc_last_resort_from_js()->Increment(); 13655 isolate->counters()->gc_last_resort_from_js()->Increment();
13656 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13656 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13657 "Runtime::PerformGC"); 13657 "Runtime::PerformGC");
13658 } 13658 }
13659 } 13659 }
13660 13660
13661 13661
13662 } } // namespace v8::internal 13662 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698