Chromium Code Reviews| OLD | NEW | 
|---|---|
| 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 <sstream> | 5 #include <sstream> | 
| 6 | 6 | 
| 7 #include "src/v8.h" | 7 #include "src/v8.h" | 
| 8 | 8 | 
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" | 
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" | 
| (...skipping 10366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10377 | 10377 | 
| 10378 void Code::ClearInlineCaches(Code::Kind* kind) { | 10378 void Code::ClearInlineCaches(Code::Kind* kind) { | 
| 10379 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 10379 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 
| 10380 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 10380 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 
| 10381 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID); | 10381 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID); | 
| 10382 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10382 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 
| 10383 RelocInfo* info = it.rinfo(); | 10383 RelocInfo* info = it.rinfo(); | 
| 10384 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 10384 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 
| 10385 if (target->is_inline_cache_stub()) { | 10385 if (target->is_inline_cache_stub()) { | 
| 10386 if (kind == NULL || *kind == target->kind()) { | 10386 if (kind == NULL || *kind == target->kind()) { | 
| 10387 IC::Clear(this->GetIsolate(), info->pc(), | 10387 Object* feedback_info = | 
| 10388 target->kind() == FUNCTION ? type_feedback_info() : NULL; | |
| 
 
Jakob Kummerow
2014/10/14 15:27:20
I think you're confused here (or is it a bad merge
 
mvstanton
2014/10/16 10:54:14
Yes, this is hilarious and sad. Sorry 'bout that!
 
 | |
| 10389 TypeFeedbackVector* vector = | |
| 10390 feedback_info->IsTypeFeedbackInfo() | |
| 
 
Jakob Kummerow
2014/10/14 15:27:20
feedback_info is NULL here!
 
mvstanton
2014/10/16 10:54:14
The logic was revisited.
 
 | |
| 10391 ? TypeFeedbackInfo::cast(feedback_info)->feedback_vector() | |
| 10392 : NULL; | |
| 10393 FeedbackVectorICSlot slot = | |
| 10394 FeedbackVectorICSlot(static_cast<unsigned>(info->data())); | |
| 10395 | |
| 10396 IC::Clear(this->GetIsolate(), info->pc(), vector, slot, | |
| 10388 info->host()->constant_pool()); | 10397 info->host()->constant_pool()); | 
| 10389 } | 10398 } | 
| 10390 } | 10399 } | 
| 10391 } | 10400 } | 
| 10392 } | 10401 } | 
| 10393 | 10402 | 
| 10394 | 10403 | 
| 10395 void SharedFunctionInfo::ClearTypeFeedbackInfo() { | 10404 void SharedFunctionInfo::ClearTypeFeedbackInfo() { | 
| 10396 TypeFeedbackVector* vector = feedback_vector(); | 10405 feedback_vector()->ClearSlots(); | 
| 10397 Heap* heap = GetHeap(); | |
| 10398 int length = vector->length(); | |
| 10399 | |
| 10400 for (int i = 0; i < length; i++) { | |
| 10401 Object* obj = vector->get(i); | |
| 10402 if (obj->IsHeapObject()) { | |
| 10403 InstanceType instance_type = | |
| 10404 HeapObject::cast(obj)->map()->instance_type(); | |
| 10405 switch (instance_type) { | |
| 10406 case ALLOCATION_SITE_TYPE: | |
| 10407 // AllocationSites are not cleared because they do not store | |
| 10408 // information that leaks. | |
| 10409 break; | |
| 10410 // Fall through... | |
| 10411 default: | |
| 10412 vector->set(i, TypeFeedbackVector::RawUninitializedSentinel(heap), | |
| 10413 SKIP_WRITE_BARRIER); | |
| 10414 } | |
| 10415 } | |
| 10416 } | |
| 10417 } | 10406 } | 
| 10418 | 10407 | 
| 10419 | 10408 | 
| 10420 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { | 10409 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { | 
| 10421 DisallowHeapAllocation no_gc; | 10410 DisallowHeapAllocation no_gc; | 
| 10422 DCHECK(kind() == FUNCTION); | 10411 DCHECK(kind() == FUNCTION); | 
| 10423 BackEdgeTable back_edges(this, &no_gc); | 10412 BackEdgeTable back_edges(this, &no_gc); | 
| 10424 for (uint32_t i = 0; i < back_edges.length(); i++) { | 10413 for (uint32_t i = 0; i < back_edges.length(); i++) { | 
| 10425 if (back_edges.pc_offset(i) == pc_offset) return back_edges.ast_id(i); | 10414 if (back_edges.pc_offset(i) == pc_offset) return back_edges.ast_id(i); | 
| 10426 } | 10415 } | 
| (...skipping 5961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16388 Handle<DependentCode> codes = | 16377 Handle<DependentCode> codes = | 
| 16389 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16378 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 
| 16390 DependentCode::kPropertyCellChangedGroup, | 16379 DependentCode::kPropertyCellChangedGroup, | 
| 16391 info->object_wrapper()); | 16380 info->object_wrapper()); | 
| 16392 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16381 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 
| 16393 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16382 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 
| 16394 cell, info->zone()); | 16383 cell, info->zone()); | 
| 16395 } | 16384 } | 
| 16396 | 16385 | 
| 16397 } } // namespace v8::internal | 16386 } } // namespace v8::internal | 
| OLD | NEW |