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

Side by Side Diff: src/objects.cc

Issue 236193014: Handlify AddDependentCode(), AddDependentCompilationInfo() and AddDependentIC(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address nit 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
« 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 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 11671 matching lines...) Expand 10 before | Expand all | Expand 10 after
11682 11682
11683 11683
11684 void Map::ZapPrototypeTransitions() { 11684 void Map::ZapPrototypeTransitions() {
11685 FixedArray* proto_transitions = GetPrototypeTransitions(); 11685 FixedArray* proto_transitions = GetPrototypeTransitions();
11686 MemsetPointer(proto_transitions->data_start(), 11686 MemsetPointer(proto_transitions->data_start(),
11687 GetHeap()->the_hole_value(), 11687 GetHeap()->the_hole_value(),
11688 proto_transitions->length()); 11688 proto_transitions->length());
11689 } 11689 }
11690 11690
11691 11691
11692 void Map::AddDependentCompilationInfo(DependentCode::DependencyGroup group, 11692 // static
11693 void Map::AddDependentCompilationInfo(Handle<Map> map,
11694 DependentCode::DependencyGroup group,
11693 CompilationInfo* info) { 11695 CompilationInfo* info) {
11694 Handle<DependentCode> dep(dependent_code());
11695 Handle<DependentCode> codes = 11696 Handle<DependentCode> codes =
11696 DependentCode::Insert(dep, group, info->object_wrapper()); 11697 DependentCode::Insert(handle(map->dependent_code(), info->isolate()),
11697 if (*codes != dependent_code()) set_dependent_code(*codes); 11698 group, info->object_wrapper());
11698 info->dependencies(group)->Add(Handle<HeapObject>(this), info->zone()); 11699 if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
11700 info->dependencies(group)->Add(map, info->zone());
11699 } 11701 }
11700 11702
11701 11703
11702 void Map::AddDependentCode(DependentCode::DependencyGroup group, 11704 // static
11705 void Map::AddDependentCode(Handle<Map> map,
11706 DependentCode::DependencyGroup group,
11703 Handle<Code> code) { 11707 Handle<Code> code) {
11704 Handle<DependentCode> codes = DependentCode::Insert( 11708 Handle<DependentCode> codes = DependentCode::Insert(
11705 Handle<DependentCode>(dependent_code()), group, code); 11709 Handle<DependentCode>(map->dependent_code()), group, code);
11706 if (*codes != dependent_code()) set_dependent_code(*codes); 11710 if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
11707 } 11711 }
11708 11712
11709 11713
11710 void Map::AddDependentIC(Handle<Code> stub) { 11714 // static
11715 void Map::AddDependentIC(Handle<Map> map,
11716 Handle<Code> stub) {
11711 ASSERT(stub->next_code_link()->IsUndefined()); 11717 ASSERT(stub->next_code_link()->IsUndefined());
11712 int n = dependent_code()->number_of_entries(DependentCode::kWeakICGroup); 11718 int n = map->dependent_code()->number_of_entries(DependentCode::kWeakICGroup);
11713 if (n == 0) { 11719 if (n == 0) {
11714 // Slow path: insert the head of the list with possible heap allocation. 11720 // Slow path: insert the head of the list with possible heap allocation.
11715 AddDependentCode(DependentCode::kWeakICGroup, stub); 11721 Map::AddDependentCode(map, DependentCode::kWeakICGroup, stub);
11716 } else { 11722 } else {
11717 // Fast path: link the stub to the existing head of the list without any 11723 // Fast path: link the stub to the existing head of the list without any
11718 // heap allocation. 11724 // heap allocation.
11719 ASSERT(n == 1); 11725 ASSERT(n == 1);
11720 dependent_code()->AddToDependentICList(stub); 11726 map->dependent_code()->AddToDependentICList(stub);
11721 } 11727 }
11722 } 11728 }
11723 11729
11724 11730
11725 DependentCode::GroupStartIndexes::GroupStartIndexes(DependentCode* entries) { 11731 DependentCode::GroupStartIndexes::GroupStartIndexes(DependentCode* entries) {
11726 Recompute(entries); 11732 Recompute(entries);
11727 } 11733 }
11728 11734
11729 11735
11730 void DependentCode::GroupStartIndexes::Recompute(DependentCode* entries) { 11736 void DependentCode::GroupStartIndexes::Recompute(DependentCode* entries) {
(...skipping 4866 matching lines...) Expand 10 before | Expand all | Expand 10 after
16597 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, 16603 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
16598 Handle<Object> value) { 16604 Handle<Object> value) {
16599 cell->set_value(*value); 16605 cell->set_value(*value);
16600 if (!HeapType::Any()->Is(cell->type())) { 16606 if (!HeapType::Any()->Is(cell->type())) {
16601 Handle<HeapType> new_type = UpdatedType(cell, value); 16607 Handle<HeapType> new_type = UpdatedType(cell, value);
16602 cell->set_type(*new_type); 16608 cell->set_type(*new_type);
16603 } 16609 }
16604 } 16610 }
16605 16611
16606 16612
16607 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { 16613 // static
16608 Handle<DependentCode> dep(dependent_code()); 16614 void PropertyCell::AddDependentCompilationInfo(Handle<PropertyCell> cell,
16615 CompilationInfo* info) {
16609 Handle<DependentCode> codes = 16616 Handle<DependentCode> codes =
16610 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, 16617 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16618 DependentCode::kPropertyCellChangedGroup,
16611 info->object_wrapper()); 16619 info->object_wrapper());
16612 if (*codes != dependent_code()) set_dependent_code(*codes); 16620 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16613 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16621 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16614 Handle<HeapObject>(this), info->zone()); 16622 cell, info->zone());
16615 } 16623 }
16616 16624
16617 16625
16618 const char* GetBailoutReason(BailoutReason reason) { 16626 const char* GetBailoutReason(BailoutReason reason) {
16619 ASSERT(reason < kLastErrorMessage); 16627 ASSERT(reason < kLastErrorMessage);
16620 #define ERROR_MESSAGES_TEXTS(C, T) T, 16628 #define ERROR_MESSAGES_TEXTS(C, T) T,
16621 static const char* error_messages_[] = { 16629 static const char* error_messages_[] = {
16622 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16630 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16623 }; 16631 };
16624 #undef ERROR_MESSAGES_TEXTS 16632 #undef ERROR_MESSAGES_TEXTS
16625 return error_messages_[reason]; 16633 return error_messages_[reason];
16626 } 16634 }
16627 16635
16628 16636
16629 } } // namespace v8::internal 16637 } } // 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