OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <stdarg.h> | 5 #include <stdarg.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 offset = 0; | 722 offset = 0; |
723 } | 723 } |
724 if (size != 0) { | 724 if (size != 0) { |
725 FlushOnePage(i_cache, start, size); | 725 FlushOnePage(i_cache, start, size); |
726 } | 726 } |
727 } | 727 } |
728 | 728 |
729 | 729 |
730 CachePage* Simulator::GetCachePage(v8::internal::HashMap* i_cache, void* page) { | 730 CachePage* Simulator::GetCachePage(v8::internal::HashMap* i_cache, void* page) { |
731 v8::internal::HashMap::Entry* entry = | 731 v8::internal::HashMap::Entry* entry = |
732 i_cache->Lookup(page, ICacheHash(page), true); | 732 i_cache->LookupOrInsert(page, ICacheHash(page)); |
733 if (entry->value == NULL) { | 733 if (entry->value == NULL) { |
734 CachePage* new_page = new CachePage(); | 734 CachePage* new_page = new CachePage(); |
735 entry->value = new_page; | 735 entry->value = new_page; |
736 } | 736 } |
737 return reinterpret_cast<CachePage*>(entry->value); | 737 return reinterpret_cast<CachePage*>(entry->value); |
738 } | 738 } |
739 | 739 |
740 | 740 |
741 // Flush from start up to and not including start + size. | 741 // Flush from start up to and not including start + size. |
742 void Simulator::FlushOnePage(v8::internal::HashMap* i_cache, intptr_t start, | 742 void Simulator::FlushOnePage(v8::internal::HashMap* i_cache, intptr_t start, |
(...skipping 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3875 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); | 3875 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); |
3876 uintptr_t address = *stack_slot; | 3876 uintptr_t address = *stack_slot; |
3877 set_register(sp, current_sp + sizeof(uintptr_t)); | 3877 set_register(sp, current_sp + sizeof(uintptr_t)); |
3878 return address; | 3878 return address; |
3879 } | 3879 } |
3880 } | 3880 } |
3881 } // namespace v8::internal | 3881 } // namespace v8::internal |
3882 | 3882 |
3883 #endif // USE_SIMULATOR | 3883 #endif // USE_SIMULATOR |
3884 #endif // V8_TARGET_ARCH_PPC | 3884 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |