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

Side by Side Diff: src/stub-cache.cc

Issue 197283017: Refactor GetCodeCopyFromTemplate to get a single point where objects are replaced in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment Created 6 years, 9 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') | no next file » | 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 Handle<Code> StubCache::ComputeCompareNil(Handle<Map> receiver_map, 327 Handle<Code> StubCache::ComputeCompareNil(Handle<Map> receiver_map,
328 CompareNilICStub& stub) { 328 CompareNilICStub& stub) {
329 Handle<String> name(isolate_->heap()->empty_string()); 329 Handle<String> name(isolate_->heap()->empty_string());
330 if (!receiver_map->is_shared()) { 330 if (!receiver_map->is_shared()) {
331 Handle<Code> cached_ic = FindIC(name, receiver_map, Code::COMPARE_NIL_IC, 331 Handle<Code> cached_ic = FindIC(name, receiver_map, Code::COMPARE_NIL_IC,
332 stub.GetExtraICState()); 332 stub.GetExtraICState());
333 if (!cached_ic.is_null()) return cached_ic; 333 if (!cached_ic.is_null()) return cached_ic;
334 } 334 }
335 335
336 Handle<Code> ic = stub.GetCodeCopyFromTemplate(isolate_); 336 Code::FindAndReplacePattern pattern;
337 ic->ReplaceNthObject(1, isolate_->heap()->meta_map(), *receiver_map); 337 pattern.Add(isolate_->factory()->meta_map(), receiver_map);
338 Handle<Code> ic = stub.GetCodeCopy(isolate_, pattern);
338 339
339 if (!receiver_map->is_shared()) { 340 if (!receiver_map->is_shared()) {
340 Map::UpdateCodeCache(receiver_map, name, ic); 341 Map::UpdateCodeCache(receiver_map, name, ic);
341 } 342 }
342 343
343 return ic; 344 return ic;
344 } 345 }
345 346
346 347
347 // TODO(verwaest): Change this method so it takes in a TypeHandleList. 348 // TODO(verwaest): Change this method so it takes in a TypeHandleList.
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 Handle<FunctionTemplateInfo>( 1463 Handle<FunctionTemplateInfo>(
1463 FunctionTemplateInfo::cast(signature->receiver())); 1464 FunctionTemplateInfo::cast(signature->receiver()));
1464 } 1465 }
1465 } 1466 }
1466 1467
1467 is_simple_api_call_ = true; 1468 is_simple_api_call_ = true;
1468 } 1469 }
1469 1470
1470 1471
1471 } } // namespace v8::internal 1472 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698