Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: src/mips/simulator-mips.cc

Issue 1173343006: Replace OFFSET_OF with offsetof as far as possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed typing chaos on ARM. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/global-handles.cc ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 Redirection* current = isolate->simulator_redirection(); 1028 Redirection* current = isolate->simulator_redirection();
1029 for (; current != NULL; current = current->next_) { 1029 for (; current != NULL; current = current->next_) {
1030 if (current->external_function_ == external_function) return current; 1030 if (current->external_function_ == external_function) return current;
1031 } 1031 }
1032 return new Redirection(external_function, type); 1032 return new Redirection(external_function, type);
1033 } 1033 }
1034 1034
1035 static Redirection* FromSwiInstruction(Instruction* swi_instruction) { 1035 static Redirection* FromSwiInstruction(Instruction* swi_instruction) {
1036 char* addr_of_swi = reinterpret_cast<char*>(swi_instruction); 1036 char* addr_of_swi = reinterpret_cast<char*>(swi_instruction);
1037 char* addr_of_redirection = 1037 char* addr_of_redirection =
1038 addr_of_swi - OFFSET_OF(Redirection, swi_instruction_); 1038 addr_of_swi - offsetof(Redirection, swi_instruction_);
1039 return reinterpret_cast<Redirection*>(addr_of_redirection); 1039 return reinterpret_cast<Redirection*>(addr_of_redirection);
1040 } 1040 }
1041 1041
1042 static void* ReverseRedirection(int32_t reg) { 1042 static void* ReverseRedirection(int32_t reg) {
1043 Redirection* redirection = FromSwiInstruction( 1043 Redirection* redirection = FromSwiInstruction(
1044 reinterpret_cast<Instruction*>(reinterpret_cast<void*>(reg))); 1044 reinterpret_cast<Instruction*>(reinterpret_cast<void*>(reg)));
1045 return redirection->external_function(); 1045 return redirection->external_function();
1046 } 1046 }
1047 1047
1048 static void DeleteChain(Redirection* redirection) { 1048 static void DeleteChain(Redirection* redirection) {
(...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after
4431 4431
4432 4432
4433 #undef UNSUPPORTED 4433 #undef UNSUPPORTED
4434 4434
4435 } // namespace internal 4435 } // namespace internal
4436 } // namespace v8 4436 } // namespace v8
4437 4437
4438 #endif // USE_SIMULATOR 4438 #endif // USE_SIMULATOR
4439 4439
4440 #endif // V8_TARGET_ARCH_MIPS 4440 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/global-handles.cc ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698