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

Side by Side Diff: src/objects.cc

Issue 188783003: Make maps in monomorphic IC stubs weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add flags: is_weak_stub, is_invalidated_weak_stub Created 6 years, 8 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 4529 matching lines...) Expand 10 before | Expand all | Expand 10 after
4540 // except for the code cache, which can contain some ics which can be 4540 // except for the code cache, which can contain some ics which can be
4541 // applied to the shared map. 4541 // applied to the shared map.
4542 Handle<Map> fresh = Map::CopyNormalized(handle(obj->map()), mode, 4542 Handle<Map> fresh = Map::CopyNormalized(handle(obj->map()), mode,
4543 SHARED_NORMALIZED_MAP); 4543 SHARED_NORMALIZED_MAP);
4544 4544
4545 ASSERT(memcmp(fresh->address(), 4545 ASSERT(memcmp(fresh->address(),
4546 Handle<Map>::cast(result)->address(), 4546 Handle<Map>::cast(result)->address(),
4547 Map::kCodeCacheOffset) == 0); 4547 Map::kCodeCacheOffset) == 0);
4548 STATIC_ASSERT(Map::kDependentCodeOffset == 4548 STATIC_ASSERT(Map::kDependentCodeOffset ==
4549 Map::kCodeCacheOffset + kPointerSize); 4549 Map::kCodeCacheOffset + kPointerSize);
4550 int offset = Map::kDependentCodeOffset + kPointerSize; 4550 STATIC_ASSERT(Map::kDependentICOffset ==
4551 Map::kDependentCodeOffset + kPointerSize);
4552 int offset = Map::kDependentICOffset + kPointerSize;
4551 ASSERT(memcmp(fresh->address() + offset, 4553 ASSERT(memcmp(fresh->address() + offset,
4552 Handle<Map>::cast(result)->address() + offset, 4554 Handle<Map>::cast(result)->address() + offset,
4553 Map::kSize - offset) == 0); 4555 Map::kSize - offset) == 0);
4554 } 4556 }
4555 #endif 4557 #endif
4556 return Handle<Map>::cast(result); 4558 return Handle<Map>::cast(result);
4557 } 4559 }
4558 4560
4559 Isolate* isolate = cache->GetIsolate(); 4561 Isolate* isolate = cache->GetIsolate();
4560 Handle<Map> map = Map::CopyNormalized(handle(obj->map()), mode, 4562 Handle<Map> map = Map::CopyNormalized(handle(obj->map()), mode,
(...skipping 6967 matching lines...) Expand 10 before | Expand all | Expand 10 after
11528 11530
11529 11531
11530 void Map::AddDependentCode(DependentCode::DependencyGroup group, 11532 void Map::AddDependentCode(DependentCode::DependencyGroup group,
11531 Handle<Code> code) { 11533 Handle<Code> code) {
11532 Handle<DependentCode> codes = DependentCode::Insert( 11534 Handle<DependentCode> codes = DependentCode::Insert(
11533 Handle<DependentCode>(dependent_code()), group, code); 11535 Handle<DependentCode>(dependent_code()), group, code);
11534 if (*codes != dependent_code()) set_dependent_code(*codes); 11536 if (*codes != dependent_code()) set_dependent_code(*codes);
11535 } 11537 }
11536 11538
11537 11539
11540 void Map::AddDependentIC(Handle<Code> stub) {
11541 ASSERT(stub->next_code_link()->IsUndefined());
11542 stub->set_next_code_link(dependent_ic());
11543 set_dependent_ic(*stub);
11544 }
11545
11546
11538 DependentCode::GroupStartIndexes::GroupStartIndexes(DependentCode* entries) { 11547 DependentCode::GroupStartIndexes::GroupStartIndexes(DependentCode* entries) {
11539 Recompute(entries); 11548 Recompute(entries);
11540 } 11549 }
11541 11550
11542 11551
11543 void DependentCode::GroupStartIndexes::Recompute(DependentCode* entries) { 11552 void DependentCode::GroupStartIndexes::Recompute(DependentCode* entries) {
11544 start_indexes_[0] = 0; 11553 start_indexes_[0] = 0;
11545 for (int g = 1; g <= kGroupCount; g++) { 11554 for (int g = 1; g <= kGroupCount; g++) {
11546 int count = entries->number_of_entries(static_cast<DependencyGroup>(g - 1)); 11555 int count = entries->number_of_entries(static_cast<DependencyGroup>(g - 1));
11547 start_indexes_[g] = start_indexes_[g - 1] + count; 11556 start_indexes_[g] = start_indexes_[g - 1] + count;
(...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after
16461 #define ERROR_MESSAGES_TEXTS(C, T) T, 16470 #define ERROR_MESSAGES_TEXTS(C, T) T,
16462 static const char* error_messages_[] = { 16471 static const char* error_messages_[] = {
16463 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16472 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16464 }; 16473 };
16465 #undef ERROR_MESSAGES_TEXTS 16474 #undef ERROR_MESSAGES_TEXTS
16466 return error_messages_[reason]; 16475 return error_messages_[reason];
16467 } 16476 }
16468 16477
16469 16478
16470 } } // namespace v8::internal 16479 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | src/objects-visiting.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698