| Index: src/deoptimizer.cc
|
| diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
|
| index b23665d9a229fbcf185b2935d4c1b47a89e56d36..9363551a425133c9805b82ca6c60a9b5dff0adcb 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++;
|
| @@ -989,7 +992,7 @@ void Deoptimizer::DoComputeJSFrame(TranslatedFrame* translated_frame,
|
| }
|
| // Read the context from the translations.
|
| Object* context = context_pos->GetRawValue();
|
| - if (context == isolate_->heap()->undefined_value()) {
|
| + if (context->IsUndefined(isolate_)) {
|
| // If the context was optimized away, just use the context from
|
| // the activation. This should only apply to Crankshaft code.
|
| CHECK(!compiled_code_->is_turbofanned());
|
| @@ -3789,7 +3792,7 @@ Handle<Object> TranslatedState::MaterializeAt(int frame_index,
|
| object->set_context(Context::cast(*context));
|
| object->set_literals(LiteralsArray::cast(*literals));
|
| CHECK(entry->IsNumber()); // Entry to compile lazy stub.
|
| - CHECK(next_link->IsUndefined());
|
| + CHECK(next_link->IsUndefined(isolate_));
|
| return object;
|
| }
|
| case FIXED_ARRAY_TYPE: {
|
|
|