Chromium Code Reviews| 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/v8.h" | 5 #include "src/v8.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 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2113 // Code age headers are not serializable. | 2113 // Code age headers are not serializable. |
| 2114 code->MakeYoung(serializer_->isolate()); | 2114 code->MakeYoung(serializer_->isolate()); |
| 2115 WipeOutRelocations(code); | 2115 WipeOutRelocations(code); |
| 2116 // We need to wipe out the header fields *after* wiping out the | 2116 // We need to wipe out the header fields *after* wiping out the |
| 2117 // relocations, because some of these fields are needed for the latter. | 2117 // relocations, because some of these fields are needed for the latter. |
| 2118 code->WipeOutHeader(); | 2118 code->WipeOutHeader(); |
| 2119 object_start = code->address(); | 2119 object_start = code->address(); |
| 2120 } | 2120 } |
| 2121 | 2121 |
| 2122 const char* description = code_object_ ? "Code" : "Byte"; | 2122 const char* description = code_object_ ? "Code" : "Byte"; |
| 2123 #ifdef MEMORY_SANITIZER | |
| 2124 // Object sizes are usually rounded up with uninitialized padding space. | |
| 2125 MSAN_MEMORY_IS_INITIALIZED(object_start + base, bytes_to_output); | |
| 2126 #endif // MEMORY_SANITIZER | |
| 2123 sink_->PutRaw(object_start + base, bytes_to_output, description); | 2127 sink_->PutRaw(object_start + base, bytes_to_output, description); |
| 2124 if (code_object_) delete[] object_start; | 2128 if (code_object_) delete[] object_start; |
| 2125 } | 2129 } |
| 2126 if (to_skip != 0 && return_skip == kIgnoringReturn) { | 2130 if (to_skip != 0 && return_skip == kIgnoringReturn) { |
| 2127 sink_->Put(kSkip, "Skip"); | 2131 sink_->Put(kSkip, "Skip"); |
| 2128 sink_->PutInt(to_skip, "SkipDistance"); | 2132 sink_->PutInt(to_skip, "SkipDistance"); |
| 2129 to_skip = 0; | 2133 to_skip = 0; |
| 2130 } | 2134 } |
| 2131 return to_skip; | 2135 return to_skip; |
| 2132 } | 2136 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2522 // Unsigned overflow expected and intended. | 2526 // Unsigned overflow expected and intended. |
| 2523 a += *cur++; | 2527 a += *cur++; |
| 2524 b += a; | 2528 b += a; |
| 2525 } | 2529 } |
| 2526 #if V8_HOST_ARCH_64_BIT | 2530 #if V8_HOST_ARCH_64_BIT |
| 2527 a ^= a >> 32; | 2531 a ^= a >> 32; |
| 2528 b ^= b >> 32; | 2532 b ^= b >> 32; |
| 2529 #endif // V8_HOST_ARCH_64_BIT | 2533 #endif // V8_HOST_ARCH_64_BIT |
| 2530 a_ = static_cast<uint32_t>(a); | 2534 a_ = static_cast<uint32_t>(a); |
| 2531 b_ = static_cast<uint32_t>(b); | 2535 b_ = static_cast<uint32_t>(b); |
| 2536 printf("%d, %d\n", a_, b_); | |
|
jochen (gone - plz use gerrit)
2015/02/11 13:08:45
Why is that needed?
Yang
2015/02/11 13:24:15
Ummm.. hehe.. it's not.
| |
| 2532 } | 2537 } |
| 2533 | 2538 |
| 2534 bool Check(uint32_t a, uint32_t b) const { return a == a_ && b == b_; } | 2539 bool Check(uint32_t a, uint32_t b) const { return a == a_ && b == b_; } |
| 2535 | 2540 |
| 2536 uint32_t a() const { return a_; } | 2541 uint32_t a() const { return a_; } |
| 2537 uint32_t b() const { return b_; } | 2542 uint32_t b() const { return b_; } |
| 2538 | 2543 |
| 2539 private: | 2544 private: |
| 2540 uint32_t a_; | 2545 uint32_t a_; |
| 2541 uint32_t b_; | 2546 uint32_t b_; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2641 return GetHeaderValue(kNumInternalizedStringsOffset); | 2646 return GetHeaderValue(kNumInternalizedStringsOffset); |
| 2642 } | 2647 } |
| 2643 | 2648 |
| 2644 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { | 2649 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { |
| 2645 int reservations_size = GetHeaderValue(kNumReservationsOffset) * kInt32Size; | 2650 int reservations_size = GetHeaderValue(kNumReservationsOffset) * kInt32Size; |
| 2646 const byte* start = data_ + kHeaderSize + reservations_size; | 2651 const byte* start = data_ + kHeaderSize + reservations_size; |
| 2647 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), | 2652 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), |
| 2648 GetHeaderValue(kNumCodeStubKeysOffset)); | 2653 GetHeaderValue(kNumCodeStubKeysOffset)); |
| 2649 } | 2654 } |
| 2650 } } // namespace v8::internal | 2655 } } // namespace v8::internal |
| OLD | NEW |