| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/snapshot/serialize.h" | 5 #include "src/snapshot/serialize.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 "Code::MarkCodeAsExecuted"); | 115 "Code::MarkCodeAsExecuted"); |
| 116 Add(ExternalReference::is_profiling_address(isolate).address(), | 116 Add(ExternalReference::is_profiling_address(isolate).address(), |
| 117 "CpuProfiler::is_profiling"); | 117 "CpuProfiler::is_profiling"); |
| 118 Add(ExternalReference::scheduled_exception_address(isolate).address(), | 118 Add(ExternalReference::scheduled_exception_address(isolate).address(), |
| 119 "Isolate::scheduled_exception"); | 119 "Isolate::scheduled_exception"); |
| 120 Add(ExternalReference::invoke_function_callback(isolate).address(), | 120 Add(ExternalReference::invoke_function_callback(isolate).address(), |
| 121 "InvokeFunctionCallback"); | 121 "InvokeFunctionCallback"); |
| 122 Add(ExternalReference::invoke_accessor_getter_callback(isolate).address(), | 122 Add(ExternalReference::invoke_accessor_getter_callback(isolate).address(), |
| 123 "InvokeAccessorGetterCallback"); | 123 "InvokeAccessorGetterCallback"); |
| 124 Add(ExternalReference::flush_icache_function(isolate).address(), | 124 Add(ExternalReference::flush_icache_function(isolate).address(), |
| 125 "CpuFeatures::FlushICache"); | 125 "Assembler::FlushICacheWithoutIsolate"); |
| 126 Add(ExternalReference::log_enter_external_function(isolate).address(), | 126 Add(ExternalReference::log_enter_external_function(isolate).address(), |
| 127 "Logger::EnterExternal"); | 127 "Logger::EnterExternal"); |
| 128 Add(ExternalReference::log_leave_external_function(isolate).address(), | 128 Add(ExternalReference::log_leave_external_function(isolate).address(), |
| 129 "Logger::LeaveExternal"); | 129 "Logger::LeaveExternal"); |
| 130 Add(ExternalReference::address_of_minus_one_half().address(), | 130 Add(ExternalReference::address_of_minus_one_half().address(), |
| 131 "double_constants.minus_one_half"); | 131 "double_constants.minus_one_half"); |
| 132 Add(ExternalReference::stress_deopt_count(isolate).address(), | 132 Add(ExternalReference::stress_deopt_count(isolate).address(), |
| 133 "Isolate::stress_deopt_count_address()"); | 133 "Isolate::stress_deopt_count_address()"); |
| 134 | 134 |
| 135 // Debug addresses | 135 // Debug addresses |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) current_chunk_[i] = 0; | 498 for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) current_chunk_[i] = 0; |
| 499 } | 499 } |
| 500 | 500 |
| 501 | 501 |
| 502 void Deserializer::FlushICacheForNewIsolate() { | 502 void Deserializer::FlushICacheForNewIsolate() { |
| 503 DCHECK(!deserializing_user_code_); | 503 DCHECK(!deserializing_user_code_); |
| 504 // The entire isolate is newly deserialized. Simply flush all code pages. | 504 // The entire isolate is newly deserialized. Simply flush all code pages. |
| 505 PageIterator it(isolate_->heap()->code_space()); | 505 PageIterator it(isolate_->heap()->code_space()); |
| 506 while (it.has_next()) { | 506 while (it.has_next()) { |
| 507 Page* p = it.next(); | 507 Page* p = it.next(); |
| 508 CpuFeatures::FlushICache(p->area_start(), p->area_end() - p->area_start()); | 508 Assembler::FlushICache(isolate_, p->area_start(), |
| 509 p->area_end() - p->area_start()); |
| 509 } | 510 } |
| 510 } | 511 } |
| 511 | 512 |
| 512 | 513 |
| 513 void Deserializer::FlushICacheForNewCodeObjects() { | 514 void Deserializer::FlushICacheForNewCodeObjects() { |
| 514 DCHECK(deserializing_user_code_); | 515 DCHECK(deserializing_user_code_); |
| 515 for (Code* code : new_code_objects_) { | 516 for (Code* code : new_code_objects_) { |
| 516 CpuFeatures::FlushICache(code->instruction_start(), | 517 Assembler::FlushICache(isolate_, code->instruction_start(), |
| 517 code->instruction_size()); | 518 code->instruction_size()); |
| 518 } | 519 } |
| 519 } | 520 } |
| 520 | 521 |
| 521 | 522 |
| 522 bool Deserializer::ReserveSpace() { | 523 bool Deserializer::ReserveSpace() { |
| 523 #ifdef DEBUG | 524 #ifdef DEBUG |
| 524 for (int i = NEW_SPACE; i < kNumberOfSpaces; ++i) { | 525 for (int i = NEW_SPACE; i < kNumberOfSpaces; ++i) { |
| 525 CHECK(reservations_[i].length() > 0); | 526 CHECK(reservations_[i].length() > 0); |
| 526 } | 527 } |
| 527 #endif // DEBUG | 528 #endif // DEBUG |
| (...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2880 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 2881 SerializedCodeData* scd = new SerializedCodeData(cached_data); |
| 2881 SanityCheckResult r = scd->SanityCheck(isolate, source); | 2882 SanityCheckResult r = scd->SanityCheck(isolate, source); |
| 2882 if (r == CHECK_SUCCESS) return scd; | 2883 if (r == CHECK_SUCCESS) return scd; |
| 2883 cached_data->Reject(); | 2884 cached_data->Reject(); |
| 2884 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 2885 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); |
| 2885 delete scd; | 2886 delete scd; |
| 2886 return NULL; | 2887 return NULL; |
| 2887 } | 2888 } |
| 2888 } // namespace internal | 2889 } // namespace internal |
| 2889 } // namespace v8 | 2890 } // namespace v8 |
| OLD | NEW |