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

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

Issue 100613004: Use optimized code map to cache OSR code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: correctly upload stuff Created 7 years 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
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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 unoptimized->set_allow_osr_at_loop_nesting_level(0); 1691 unoptimized->set_allow_osr_at_loop_nesting_level(0);
1692 // Assert that none of the back edges are patched anymore. 1692 // Assert that none of the back edges are patched anymore.
1693 ASSERT(Verify(isolate, unoptimized, -1)); 1693 ASSERT(Verify(isolate, unoptimized, -1));
1694 } 1694 }
1695 1695
1696 1696
1697 void BackEdgeTable::AddStackCheck(CompilationInfo* info) { 1697 void BackEdgeTable::AddStackCheck(CompilationInfo* info) {
1698 DisallowHeapAllocation no_gc; 1698 DisallowHeapAllocation no_gc;
1699 Isolate* isolate = info->isolate(); 1699 Isolate* isolate = info->isolate();
1700 Code* code = info->shared_info()->code(); 1700 Code* code = info->shared_info()->code();
1701 Address pc = code->instruction_start() + info->osr_pc_offset(); 1701 Address pc = code->instruction_start() +
1702 code->TranslateAstIdToPcOffset(info->osr_ast_id());
1702 ASSERT_EQ(ON_STACK_REPLACEMENT, GetBackEdgeState(isolate, code, pc)); 1703 ASSERT_EQ(ON_STACK_REPLACEMENT, GetBackEdgeState(isolate, code, pc));
1703 Code* patch = isolate->builtins()->builtin(Builtins::kOsrAfterStackCheck); 1704 Code* patch = isolate->builtins()->builtin(Builtins::kOsrAfterStackCheck);
1704 PatchAt(code, pc, OSR_AFTER_STACK_CHECK, patch); 1705 PatchAt(code, pc, OSR_AFTER_STACK_CHECK, patch);
1705 } 1706 }
1706 1707
1707 1708
1708 void BackEdgeTable::RemoveStackCheck(CompilationInfo* info) { 1709 void BackEdgeTable::RemoveStackCheck(CompilationInfo* info) {
1709 DisallowHeapAllocation no_gc; 1710 DisallowHeapAllocation no_gc;
1710 Isolate* isolate = info->isolate(); 1711 Isolate* isolate = info->isolate();
1711 Code* code = info->shared_info()->code(); 1712 Code* code = info->shared_info()->code();
1712 Address pc = code->instruction_start() + info->osr_pc_offset(); 1713 Address pc = code->instruction_start() +
1714 code->TranslateAstIdToPcOffset(info->osr_ast_id());
1713 if (GetBackEdgeState(isolate, code, pc) == OSR_AFTER_STACK_CHECK) { 1715 if (GetBackEdgeState(isolate, code, pc) == OSR_AFTER_STACK_CHECK) {
1714 Code* patch = isolate->builtins()->builtin(Builtins::kOnStackReplacement); 1716 Code* patch = isolate->builtins()->builtin(Builtins::kOnStackReplacement);
1715 PatchAt(code, pc, ON_STACK_REPLACEMENT, patch); 1717 PatchAt(code, pc, ON_STACK_REPLACEMENT, patch);
1716 } 1718 }
1717 } 1719 }
1718 1720
1719 1721
1720 #ifdef DEBUG 1722 #ifdef DEBUG
1721 bool BackEdgeTable::Verify(Isolate* isolate, 1723 bool BackEdgeTable::Verify(Isolate* isolate,
1722 Code* unoptimized, 1724 Code* unoptimized,
(...skipping 12 matching lines...) Expand all
1735 } 1737 }
1736 return true; 1738 return true;
1737 } 1739 }
1738 #endif // DEBUG 1740 #endif // DEBUG
1739 1741
1740 1742
1741 #undef __ 1743 #undef __
1742 1744
1743 1745
1744 } } // namespace v8::internal 1746 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/hydrogen-instructions.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698