Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/code-serializer.h" | 5 #include "src/snapshot/code-serializer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/log.h" | 10 #include "src/log.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 DisallowHeapAllocation no_gc; | 408 DisallowHeapAllocation no_gc; |
| 409 SerializedCodeData scd(cached_data); | 409 SerializedCodeData scd(cached_data); |
| 410 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); | 410 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); |
| 411 if (*rejection_result != CHECK_SUCCESS) { | 411 if (*rejection_result != CHECK_SUCCESS) { |
| 412 cached_data->Reject(); | 412 cached_data->Reject(); |
| 413 return SerializedCodeData(nullptr, 0); | 413 return SerializedCodeData(nullptr, 0); |
| 414 } | 414 } |
| 415 return scd; | 415 return scd; |
| 416 } | 416 } |
| 417 | 417 |
| 418 void SerializedCodeData::InvalidateVersionForTest(byte* buffer, | |
|
Yang
2016/10/13 06:52:59
I'm not really happy with introducing test APIs. C
Mircea Trofin
2016/10/13 16:09:10
The former is more complicated, because the field
| |
| 419 size_t buffer_size) { | |
| 420 DCHECK_GE(buffer_size, static_cast<size_t>(kVersionHashOffset + kInt32Size)); | |
| 421 uint32_t expected_version_hash = Version::Hash(); | |
| 422 uint32_t invalid_version_hash = expected_version_hash + 1; | |
| 423 SerializedData::SetHeaderValueInBuffer(buffer, kVersionHashOffset, | |
| 424 invalid_version_hash); | |
| 425 } | |
| 426 | |
| 418 } // namespace internal | 427 } // namespace internal |
| 419 } // namespace v8 | 428 } // namespace v8 |
| OLD | NEW |