Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index c698459fd0396c4f4a50ec008f0430b053bb7fd5..0e416a54e9312951a358208596ab290a8f94f529 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -56,9 +56,10 @@ DeoptimizerData::~DeoptimizerData() { |
Code* Deoptimizer::FindDeoptimizingCode(Address addr) { |
if (function_->IsHeapObject()) { |
// Search all deoptimizing code in the native context of the function. |
+ Isolate* isolate = function_->GetIsolate(); |
Context* native_context = function_->context()->native_context(); |
Object* element = native_context->DeoptimizedCodeListHead(); |
- while (!element->IsUndefined()) { |
+ while (!element->IsUndefined(isolate)) { |
Code* code = Code::cast(element); |
CHECK(code->kind() == Code::OPTIMIZED_FUNCTION); |
if (code->contains(addr)) return code; |
@@ -186,7 +187,8 @@ void Deoptimizer::VisitAllOptimizedFunctionsForContext( |
// no longer refer to optimized code. |
JSFunction* prev = NULL; |
Object* element = context->OptimizedFunctionsListHead(); |
- while (!element->IsUndefined()) { |
+ Isolate* isolate = context->GetIsolate(); |
+ while (!element->IsUndefined(isolate)) { |
JSFunction* function = JSFunction::cast(element); |
Object* next = function->next_function_link(); |
if (function->code()->kind() != Code::OPTIMIZED_FUNCTION || |
@@ -226,7 +228,7 @@ void Deoptimizer::VisitAllOptimizedFunctions( |
// Run through the list of all native contexts. |
Object* context = isolate->heap()->native_contexts_list(); |
- while (!context->IsUndefined()) { |
+ while (!context->IsUndefined(isolate)) { |
VisitAllOptimizedFunctionsForContext(Context::cast(context), visitor); |
context = Context::cast(context)->next_context_link(); |
} |
@@ -315,7 +317,7 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) { |
// Walk over all optimized code objects in this native context. |
Code* prev = NULL; |
Object* element = context->OptimizedCodeListHead(); |
- while (!element->IsUndefined()) { |
+ while (!element->IsUndefined(isolate)) { |
Code* code = Code::cast(element); |
CHECK_EQ(code->kind(), Code::OPTIMIZED_FUNCTION); |
Object* next = code->next_code_link(); |
@@ -385,7 +387,7 @@ void Deoptimizer::DeoptimizeAll(Isolate* isolate) { |
DisallowHeapAllocation no_allocation; |
// For all contexts, mark all code, then deoptimize. |
Object* context = isolate->heap()->native_contexts_list(); |
- while (!context->IsUndefined()) { |
+ while (!context->IsUndefined(isolate)) { |
Context* native_context = Context::cast(context); |
MarkAllCodeForContext(native_context); |
DeoptimizeMarkedCodeForContext(native_context); |
@@ -406,7 +408,7 @@ void Deoptimizer::DeoptimizeMarkedCode(Isolate* isolate) { |
DisallowHeapAllocation no_allocation; |
// For all contexts, deoptimize code already marked. |
Object* context = isolate->heap()->native_contexts_list(); |
- while (!context->IsUndefined()) { |
+ while (!context->IsUndefined(isolate)) { |
Context* native_context = Context::cast(context); |
DeoptimizeMarkedCodeForContext(native_context); |
context = native_context->next_context_link(); |
@@ -416,7 +418,8 @@ void Deoptimizer::DeoptimizeMarkedCode(Isolate* isolate) { |
void Deoptimizer::MarkAllCodeForContext(Context* context) { |
Object* element = context->OptimizedCodeListHead(); |
- while (!element->IsUndefined()) { |
+ Isolate* isolate = context->GetIsolate(); |
+ while (!element->IsUndefined(isolate)) { |
Code* code = Code::cast(element); |
CHECK_EQ(code->kind(), Code::OPTIMIZED_FUNCTION); |
code->set_marked_for_deoptimization(true); |
@@ -660,10 +663,10 @@ int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) { |
int length = 0; |
// Count all entries in the deoptimizing code list of every context. |
Object* context = isolate->heap()->native_contexts_list(); |
- while (!context->IsUndefined()) { |
+ while (!context->IsUndefined(isolate)) { |
Context* native_context = Context::cast(context); |
Object* element = native_context->DeoptimizedCodeListHead(); |
- while (!element->IsUndefined()) { |
+ while (!element->IsUndefined(isolate)) { |
Code* code = Code::cast(element); |
DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION); |
length++; |