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

Side by Side Diff: src/objects.cc

Issue 339843004: Reduce number of writes to DependentCode array when inserting dependent IC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | « no previous file | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 12043 matching lines...) Expand 10 before | Expand all | Expand 10 after
12054 bool marked = MarkCodeForDeoptimization(isolate, group); 12054 bool marked = MarkCodeForDeoptimization(isolate, group);
12055 12055
12056 if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate); 12056 if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate);
12057 } 12057 }
12058 12058
12059 12059
12060 void DependentCode::AddToDependentICList(Handle<Code> stub) { 12060 void DependentCode::AddToDependentICList(Handle<Code> stub) {
12061 DisallowHeapAllocation no_heap_allocation; 12061 DisallowHeapAllocation no_heap_allocation;
12062 GroupStartIndexes starts(this); 12062 GroupStartIndexes starts(this);
12063 int i = starts.at(kWeakICGroup); 12063 int i = starts.at(kWeakICGroup);
12064 stub->set_next_code_link(object_at(i)); 12064 Object* head = object_at(i);
12065 set_object_at(i, *stub); 12065 // Try to insert the stub after the head of the list to minimize number of
12066 // writes to the DependentCode array, since a write to the array can make it
12067 // strong if it was alread marked by incremental marker.
12068 if (head->IsCode()) {
12069 stub->set_next_code_link(Code::cast(head)->next_code_link());
12070 Code::cast(head)->set_next_code_link(*stub);
12071 } else {
12072 stub->set_next_code_link(head);
12073 set_object_at(i, *stub);
12074 }
12066 } 12075 }
12067 12076
12068 12077
12069 Handle<Map> Map::TransitionToPrototype(Handle<Map> map, 12078 Handle<Map> Map::TransitionToPrototype(Handle<Map> map,
12070 Handle<Object> prototype) { 12079 Handle<Object> prototype) {
12071 Handle<Map> new_map = GetPrototypeTransition(map, prototype); 12080 Handle<Map> new_map = GetPrototypeTransition(map, prototype);
12072 if (new_map.is_null()) { 12081 if (new_map.is_null()) {
12073 new_map = Copy(map); 12082 new_map = Copy(map);
12074 PutPrototypeTransition(map, prototype, new_map); 12083 PutPrototypeTransition(map, prototype, new_map);
12075 new_map->set_prototype(*prototype); 12084 new_map->set_prototype(*prototype);
(...skipping 4878 matching lines...) Expand 10 before | Expand all | Expand 10 after
16954 #define ERROR_MESSAGES_TEXTS(C, T) T, 16963 #define ERROR_MESSAGES_TEXTS(C, T) T,
16955 static const char* error_messages_[] = { 16964 static const char* error_messages_[] = {
16956 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16965 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16957 }; 16966 };
16958 #undef ERROR_MESSAGES_TEXTS 16967 #undef ERROR_MESSAGES_TEXTS
16959 return error_messages_[reason]; 16968 return error_messages_[reason];
16960 } 16969 }
16961 16970
16962 16971
16963 } } // namespace v8::internal 16972 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698