OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 int Deoptimizer::patch_size() { | 40 int Deoptimizer::patch_size() { |
41 const int kCallInstructionSizeInWords = 4; | 41 const int kCallInstructionSizeInWords = 4; |
42 return kCallInstructionSizeInWords * Assembler::kInstrSize; | 42 return kCallInstructionSizeInWords * Assembler::kInstrSize; |
43 } | 43 } |
44 | 44 |
45 | 45 |
46 void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( | 46 void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( |
47 JSFunction* function) { | 47 JSFunction* function) { |
48 Isolate* isolate = function->GetIsolate(); | 48 Isolate* isolate = function->GetIsolate(); |
49 HandleScope scope(isolate); | 49 HandleScope scope(isolate); |
50 AssertNoAllocation no_allocation; | 50 DisallowHeapAllocation nha; |
51 | 51 |
52 ASSERT(function->IsOptimized()); | 52 ASSERT(function->IsOptimized()); |
53 ASSERT(function->FunctionsInFunctionListShareSameCode()); | 53 ASSERT(function->FunctionsInFunctionListShareSameCode()); |
54 | 54 |
55 // Get the optimized code. | 55 // Get the optimized code. |
56 Code* code = function->code(); | 56 Code* code = function->code(); |
57 Address code_start_address = code->instruction_start(); | 57 Address code_start_address = code->instruction_start(); |
58 | 58 |
59 // The optimized code is going to be patched, so we cannot use it any more. | 59 // The optimized code is going to be patched, so we cannot use it any more. |
60 function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); | 60 function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 } | 666 } |
667 | 667 |
668 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), | 668 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), |
669 count() * table_entry_size_); | 669 count() * table_entry_size_); |
670 } | 670 } |
671 | 671 |
672 #undef __ | 672 #undef __ |
673 | 673 |
674 | 674 |
675 } } // namespace v8::internal | 675 } } // namespace v8::internal |
OLD | NEW |