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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } | 440 } |
441 } | 441 } |
442 | 442 |
443 | 443 |
444 static int FindPatchAddressForReturnAddress(Code* code, int pc) { | 444 static int FindPatchAddressForReturnAddress(Code* code, int pc) { |
445 DeoptimizationInputData* input_data = | 445 DeoptimizationInputData* input_data = |
446 DeoptimizationInputData::cast(code->deoptimization_data()); | 446 DeoptimizationInputData::cast(code->deoptimization_data()); |
447 int patch_count = input_data->ReturnAddressPatchCount(); | 447 int patch_count = input_data->ReturnAddressPatchCount(); |
448 for (int i = 0; i < patch_count; i++) { | 448 for (int i = 0; i < patch_count; i++) { |
449 int return_pc = input_data->ReturnAddressPc(i)->value(); | 449 int return_pc = input_data->ReturnAddressPc(i)->value(); |
450 int patch_pc = input_data->PatchedAddressPc(i)->value(); | 450 if (pc == return_pc) { |
451 // If the supplied pc matches the return pc or if the address | 451 return input_data->PatchedAddressPc(i)->value(); |
452 // has been already patched, return the patch pc. | |
453 if (pc == return_pc || pc == patch_pc) { | |
454 return patch_pc; | |
455 } | 452 } |
456 } | 453 } |
457 return -1; | 454 return -1; |
458 } | 455 } |
459 | 456 |
460 | 457 |
461 // For all marked Turbofanned code on stack, change the return address to go | 458 // For all marked Turbofanned code on stack, change the return address to go |
462 // to the deoptimization block. | 459 // to the deoptimization block. |
463 void Deoptimizer::PatchStackForMarkedCode(Isolate* isolate) { | 460 void Deoptimizer::PatchStackForMarkedCode(Isolate* isolate) { |
464 // TODO(jarin) We should tolerate missing patch entry for the topmost frame. | 461 // TODO(jarin) We should tolerate missing patch entry for the topmost frame. |
(...skipping 3211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3676 } | 3673 } |
3677 | 3674 |
3678 | 3675 |
3679 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3676 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3680 v->VisitPointer(BitCast<Object**>(&function_)); | 3677 v->VisitPointer(BitCast<Object**>(&function_)); |
3681 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3678 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3682 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3679 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3683 } | 3680 } |
3684 | 3681 |
3685 } } // namespace v8::internal | 3682 } } // namespace v8::internal |
OLD | NEW |