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

Side by Side Diff: src/lithium.cc

Issue 11575007: Make embedded maps in optimized code weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/lithium.h ('k') | src/mark-compact.h » ('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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 422
423 if (generator.GenerateCode()) { 423 if (generator.GenerateCode()) {
424 if (FLAG_trace_codegen) { 424 if (FLAG_trace_codegen) {
425 PrintF("Crankshaft Compiler - "); 425 PrintF("Crankshaft Compiler - ");
426 } 426 }
427 CodeGenerator::MakeCodePrologue(info()); 427 CodeGenerator::MakeCodePrologue(info());
428 Code::Flags flags = Code::ComputeFlags(kind); 428 Code::Flags flags = Code::ComputeFlags(kind);
429 Handle<Code> code = 429 Handle<Code> code =
430 CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); 430 CodeGenerator::MakeCodeEpilogue(&assembler, flags, info());
431 generator.FinishCode(code); 431 generator.FinishCode(code);
432 RegisterDependentCodeForEmbeddedMaps(code);
432 CodeGenerator::PrintCode(code, info()); 433 CodeGenerator::PrintCode(code, info());
433 return code; 434 return code;
434 } 435 }
435 return Handle<Code>::null(); 436 return Handle<Code>::null();
436 } 437 }
437 438
438 439
440 void LChunk::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) {
441 ZoneList<Handle<Map> > maps(1, zone());
442 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
443 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
444 RelocInfo::Mode mode = it.rinfo()->rmode();
445 if (mode == RelocInfo::EMBEDDED_OBJECT &&
446 it.rinfo()->target_object()->IsMap()) {
447 Handle<Map> map(Map::cast(it.rinfo()->target_object()));
448 if (map->CanTransition()) {
449 maps.Add(map, zone());
450 }
451 }
452 }
453 for (int i = 0; i < maps.length(); i++) {
454 maps.at(i)->AddDependentCode(code);
455 }
456 }
457
439 } } // namespace v8::internal 458 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium.h ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698