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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 100613004: Use optimized code map to cache OSR code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove extra slot per entry for osr ast id. 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
« no previous file with comments | « no previous file | src/compiler.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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 is_optimized.Then(); 1182 is_optimized.Then();
1183 { 1183 {
1184 BuildInstallCode(js_function, shared_info); 1184 BuildInstallCode(js_function, shared_info);
1185 } 1185 }
1186 is_optimized.Else(); 1186 is_optimized.Else();
1187 { 1187 {
1188 AddIncrementCounter(counters->fast_new_closure_try_optimized()); 1188 AddIncrementCounter(counters->fast_new_closure_try_optimized());
1189 // optimized_map points to fixed array of 3-element entries 1189 // optimized_map points to fixed array of 3-element entries
1190 // (native context, optimized code, literals). 1190 // (native context, optimized code, literals).
1191 // Map must never be empty, so check the first elements. 1191 // Map must never be empty, so check the first elements.
1192 // Matching code that we find may have been compiled for OSR as opposed to
1193 // regular optimized code. That is probably because we never had the
1194 // chance to compile regular optimized code before OSR engaged. In that
1195 // case, it's probably a good idea to just reuse that OSR code right now.
Michael Starzinger 2013/12/03 15:27:32 I strongly disagree that this is a good idea! Once
1192 Label install_optimized; 1196 Label install_optimized;
1193 HValue* first_context_slot = Add<HLoadNamedField>(optimized_map, 1197 HValue* first_context_slot = Add<HLoadNamedField>(optimized_map,
1194 HObjectAccess::ForFirstContextSlot()); 1198 HObjectAccess::ForFirstContextSlot());
1195 IfBuilder already_in(this); 1199 IfBuilder already_in(this);
1196 already_in.If<HCompareObjectEqAndBranch>(native_context, 1200 already_in.If<HCompareObjectEqAndBranch>(native_context,
1197 first_context_slot); 1201 first_context_slot);
1198 already_in.Then(); 1202 already_in.Then();
1199 { 1203 {
1200 HValue* code_object = Add<HLoadNamedField>(optimized_map, 1204 HValue* code_object = Add<HLoadNamedField>(optimized_map,
1201 HObjectAccess::ForFirstCodeSlot()); 1205 HObjectAccess::ForFirstCodeSlot());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 return BuildUncheckedDictionaryElementLoad(receiver, key); 1334 return BuildUncheckedDictionaryElementLoad(receiver, key);
1331 } 1335 }
1332 1336
1333 1337
1334 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { 1338 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) {
1335 return DoGenerateCode(isolate, this); 1339 return DoGenerateCode(isolate, this);
1336 } 1340 }
1337 1341
1338 1342
1339 } } // namespace v8::internal 1343 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698