OLD | NEW |
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 Loading... |
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 if (FLAG_weak_embedded_maps_in_optimized_code) { |
| 433 RegisterDependentCodeForEmbeddedMaps(code); |
| 434 } |
433 CodeGenerator::PrintCode(code, info()); | 435 CodeGenerator::PrintCode(code, info()); |
434 return code; | 436 return code; |
435 } | 437 } |
436 return Handle<Code>::null(); | 438 return Handle<Code>::null(); |
437 } | 439 } |
438 | 440 |
439 | 441 |
440 void LChunk::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 442 void LChunk::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
441 ZoneList<Handle<Map> > maps(1, zone()); | 443 ZoneList<Handle<Map> > maps(1, zone()); |
442 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 444 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
443 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 445 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
444 RelocInfo::Mode mode = it.rinfo()->rmode(); | 446 RelocInfo::Mode mode = it.rinfo()->rmode(); |
445 if (mode == RelocInfo::EMBEDDED_OBJECT && | 447 if (mode == RelocInfo::EMBEDDED_OBJECT && |
446 it.rinfo()->target_object()->IsMap()) { | 448 it.rinfo()->target_object()->IsMap()) { |
447 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | 449 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
448 if (map->CanTransition()) { | 450 if (map->CanTransition()) { |
449 maps.Add(map, zone()); | 451 maps.Add(map, zone()); |
450 } | 452 } |
451 } | 453 } |
452 } | 454 } |
453 for (int i = 0; i < maps.length(); i++) { | 455 for (int i = 0; i < maps.length(); i++) { |
454 maps.at(i)->AddDependentCode(code); | 456 maps.at(i)->AddDependentCode(code); |
455 } | 457 } |
456 } | 458 } |
457 | 459 |
458 } } // namespace v8::internal | 460 } } // namespace v8::internal |
OLD | NEW |