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

Side by Side Diff: src/objects.cc

Issue 11421219: Remove extraneous forced rejuvenations in code aging (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « src/objects.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 7954 matching lines...) Expand 10 before | Expand all | Expand 10 after
7965 FixedArray* code_map = FixedArray::cast(optimized_code_map()); 7965 FixedArray* code_map = FixedArray::cast(optimized_code_map());
7966 if (!bound()) { 7966 if (!bound()) {
7967 FixedArray* cached_literals = FixedArray::cast(code_map->get(index + 1)); 7967 FixedArray* cached_literals = FixedArray::cast(code_map->get(index + 1));
7968 ASSERT(cached_literals != NULL); 7968 ASSERT(cached_literals != NULL);
7969 function->set_literals(cached_literals); 7969 function->set_literals(cached_literals);
7970 } 7970 }
7971 Code* code = Code::cast(code_map->get(index)); 7971 Code* code = Code::cast(code_map->get(index));
7972 ASSERT(code != NULL); 7972 ASSERT(code != NULL);
7973 ASSERT(function->context()->native_context() == code_map->get(index - 1)); 7973 ASSERT(function->context()->native_context() == code_map->get(index - 1));
7974 function->ReplaceCode(code); 7974 function->ReplaceCode(code);
7975 code->MakeYoung();
7976 } 7975 }
7977 7976
7978 7977
7979 bool JSFunction::CompileLazy(Handle<JSFunction> function, 7978 bool JSFunction::CompileLazy(Handle<JSFunction> function,
7980 ClearExceptionFlag flag) { 7979 ClearExceptionFlag flag) {
7981 bool result = true; 7980 bool result = true;
7982 if (function->shared()->is_compiled()) { 7981 if (function->shared()->is_compiled()) {
7983 function->ReplaceCode(function->shared()->code()); 7982 function->ReplaceCode(function->shared()->code());
7984 function->shared()->set_code_age(0); 7983 function->shared()->set_code_age(0);
7985 } else { 7984 } else {
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
8834 (is_compare_ic_stub() && 8833 (is_compare_ic_stub() &&
8835 ICCompareStub::CompareState(stub_info()) == CompareIC::KNOWN_OBJECTS); 8834 ICCompareStub::CompareState(stub_info()) == CompareIC::KNOWN_OBJECTS);
8836 } 8835 }
8837 8836
8838 8837
8839 void Code::MakeCodeAgeSequenceYoung(byte* sequence) { 8838 void Code::MakeCodeAgeSequenceYoung(byte* sequence) {
8840 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY); 8839 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY);
8841 } 8840 }
8842 8841
8843 8842
8844 void Code::MakeYoung() {
8845 byte* sequence = FindCodeAgeSequence();
8846 if (sequence != NULL) {
8847 PatchPlatformCodeAge(sequence, kNoAge, NO_MARKING_PARITY);
8848 }
8849 }
8850
8851
8852 void Code::MakeOlder(MarkingParity current_parity) { 8843 void Code::MakeOlder(MarkingParity current_parity) {
8853 byte* sequence = FindCodeAgeSequence(); 8844 byte* sequence = FindCodeAgeSequence();
8854 if (sequence != NULL) { 8845 if (sequence != NULL) {
8855 Age age; 8846 Age age;
8856 MarkingParity code_parity; 8847 MarkingParity code_parity;
8857 GetCodeAgeAndParity(sequence, &age, &code_parity); 8848 GetCodeAgeAndParity(sequence, &age, &code_parity);
8858 if (age != kLastCodeAge && code_parity != current_parity) { 8849 if (age != kLastCodeAge && code_parity != current_parity) {
8859 PatchPlatformCodeAge(sequence, static_cast<Age>(age + 1), 8850 PatchPlatformCodeAge(sequence, static_cast<Age>(age + 1),
8860 current_parity); 8851 current_parity);
8861 } 8852 }
(...skipping 5019 matching lines...) Expand 10 before | Expand all | Expand 10 after
13881 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13872 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13882 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13873 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13883 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13874 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13884 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13875 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13885 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13876 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13886 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13877 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13887 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13878 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13888 } 13879 }
13889 13880
13890 } } // namespace v8::internal 13881 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698