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

Side by Side Diff: src/mips/deoptimizer-mips.cc

Issue 184923002: Clear optimized code cache in shared function info when code gets deoptimized (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix assert Created 6 years, 9 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 1
2 // Copyright 2011 the V8 project authors. All rights reserved. 2 // Copyright 2011 the V8 project authors. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 DeoptimizationInputData* data = 63 DeoptimizationInputData* data =
64 DeoptimizationInputData::cast(code->deoptimization_data()); 64 DeoptimizationInputData::cast(code->deoptimization_data());
65 int osr_offset = data->OsrPcOffset()->value(); 65 int osr_offset = data->OsrPcOffset()->value();
66 if (osr_offset > 0) { 66 if (osr_offset > 0) {
67 CodePatcher osr_patcher(code->instruction_start() + osr_offset, 1); 67 CodePatcher osr_patcher(code->instruction_start() + osr_offset, 1);
68 osr_patcher.masm()->break_(0xCC); 68 osr_patcher.masm()->break_(0xCC);
69 } 69 }
70 } 70 }
71 71
72 // For each LLazyBailout instruction insert a call to the corresponding
73 // deoptimization entry.
74 DeoptimizationInputData* deopt_data = 72 DeoptimizationInputData* deopt_data =
75 DeoptimizationInputData::cast(code->deoptimization_data()); 73 DeoptimizationInputData::cast(code->deoptimization_data());
74 SharedFunctionInfo* shared =
75 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo());
76 shared->EvictFromOptimizedCodeMap(code, "deoptimized code");
76 #ifdef DEBUG 77 #ifdef DEBUG
77 Address prev_call_address = NULL; 78 Address prev_call_address = NULL;
78 #endif 79 #endif
80 // For each LLazyBailout instruction insert a call to the corresponding
81 // deoptimization entry.
79 for (int i = 0; i < deopt_data->DeoptCount(); i++) { 82 for (int i = 0; i < deopt_data->DeoptCount(); i++) {
80 if (deopt_data->Pc(i)->value() == -1) continue; 83 if (deopt_data->Pc(i)->value() == -1) continue;
81 Address call_address = code_start_address + deopt_data->Pc(i)->value(); 84 Address call_address = code_start_address + deopt_data->Pc(i)->value();
82 Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY); 85 Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY);
83 int call_size_in_bytes = MacroAssembler::CallSize(deopt_entry, 86 int call_size_in_bytes = MacroAssembler::CallSize(deopt_entry,
84 RelocInfo::NONE32); 87 RelocInfo::NONE32);
85 int call_size_in_words = call_size_in_bytes / Assembler::kInstrSize; 88 int call_size_in_words = call_size_in_bytes / Assembler::kInstrSize;
86 ASSERT(call_size_in_bytes % Assembler::kInstrSize == 0); 89 ASSERT(call_size_in_bytes % Assembler::kInstrSize == 0);
87 ASSERT(call_size_in_bytes <= patch_size()); 90 ASSERT(call_size_in_bytes <= patch_size());
88 CodePatcher patcher(call_address, call_size_in_words); 91 CodePatcher patcher(call_address, call_size_in_words);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 391
389 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { 392 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
390 SetFrameSlot(offset, value); 393 SetFrameSlot(offset, value);
391 } 394 }
392 395
393 396
394 #undef __ 397 #undef __
395 398
396 399
397 } } // namespace v8::internal 400 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698