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

Side by Side Diff: src/serialize.cc

Issue 817143002: Contribution of PowerPC port (continuation of 422063005) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
OLDNEW
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 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 // code object. 1154 // code object.
1155 CASE_STATEMENT(kNewObject, kPlain, kInnerPointer, CODE_SPACE) 1155 CASE_STATEMENT(kNewObject, kPlain, kInnerPointer, CODE_SPACE)
1156 CASE_BODY(kNewObject, kPlain, kInnerPointer, CODE_SPACE) 1156 CASE_BODY(kNewObject, kPlain, kInnerPointer, CODE_SPACE)
1157 // Deserialize a new code object and write a pointer to its first 1157 // Deserialize a new code object and write a pointer to its first
1158 // instruction to the current code object. 1158 // instruction to the current code object.
1159 ALL_SPACES(kNewObject, kFromCode, kInnerPointer) 1159 ALL_SPACES(kNewObject, kFromCode, kInnerPointer)
1160 // Find a recently deserialized object using its offset from the current 1160 // Find a recently deserialized object using its offset from the current
1161 // allocation point and write a pointer to it to the current object. 1161 // allocation point and write a pointer to it to the current object.
1162 ALL_SPACES(kBackref, kPlain, kStartOfObject) 1162 ALL_SPACES(kBackref, kPlain, kStartOfObject)
1163 ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject) 1163 ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject)
1164 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL || \ 1164 #if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64) || \
1165 defined(V8_TARGET_ARCH_MIPS64) 1165 defined(V8_TARGET_ARCH_PPC) || V8_OOL_CONSTANT_POOL
1166 // Deserialize a new object from pointer found in code and write 1166 // Deserialize a new object from pointer found in code and write
1167 // a pointer to it to the current object. Required only for MIPS or ARM 1167 // a pointer to it to the current object. Required only for MIPS, PPC or
1168 // with ool constant pool, and omitted on the other architectures because 1168 // ARM with ool constant pool, and omitted on the other architectures
1169 // it is fully unrolled and would cause bloat. 1169 // because it is fully unrolled and would cause bloat.
1170 ALL_SPACES(kNewObject, kFromCode, kStartOfObject) 1170 ALL_SPACES(kNewObject, kFromCode, kStartOfObject)
1171 // Find a recently deserialized code object using its offset from the 1171 // Find a recently deserialized code object using its offset from the
1172 // current allocation point and write a pointer to it to the current 1172 // current allocation point and write a pointer to it to the current
1173 // object. Required only for MIPS or ARM with ool constant pool. 1173 // object. Required only for MIPS, PPC or ARM with ool constant pool.
1174 ALL_SPACES(kBackref, kFromCode, kStartOfObject) 1174 ALL_SPACES(kBackref, kFromCode, kStartOfObject)
1175 ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject) 1175 ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject)
1176 #endif 1176 #endif
1177 // Find a recently deserialized code object using its offset from the 1177 // Find a recently deserialized code object using its offset from the
1178 // current allocation point and write a pointer to its first instruction 1178 // current allocation point and write a pointer to its first instruction
1179 // to the current code object or the instruction pointer in a function 1179 // to the current code object or the instruction pointer in a function
1180 // object. 1180 // object.
1181 ALL_SPACES(kBackref, kFromCode, kInnerPointer) 1181 ALL_SPACES(kBackref, kFromCode, kInnerPointer)
1182 ALL_SPACES(kBackrefWithSkip, kFromCode, kInnerPointer) 1182 ALL_SPACES(kBackrefWithSkip, kFromCode, kInnerPointer)
1183 ALL_SPACES(kBackref, kPlain, kInnerPointer) 1183 ALL_SPACES(kBackref, kPlain, kInnerPointer)
1184 ALL_SPACES(kBackrefWithSkip, kPlain, kInnerPointer) 1184 ALL_SPACES(kBackrefWithSkip, kPlain, kInnerPointer)
1185 // Find an object in the roots array and write a pointer to it to the 1185 // Find an object in the roots array and write a pointer to it to the
1186 // current object. 1186 // current object.
1187 CASE_STATEMENT(kRootArray, kPlain, kStartOfObject, 0) 1187 CASE_STATEMENT(kRootArray, kPlain, kStartOfObject, 0)
1188 CASE_BODY(kRootArray, kPlain, kStartOfObject, 0) 1188 CASE_BODY(kRootArray, kPlain, kStartOfObject, 0)
1189 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL || \ 1189 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL || \
1190 defined(V8_TARGET_ARCH_MIPS64) 1190 defined(V8_TARGET_ARCH_MIPS64) || defined(V8_TARGET_ARCH_PPC)
1191 // Find an object in the roots array and write a pointer to it to in code. 1191 // Find an object in the roots array and write a pointer to it to in code.
1192 CASE_STATEMENT(kRootArray, kFromCode, kStartOfObject, 0) 1192 CASE_STATEMENT(kRootArray, kFromCode, kStartOfObject, 0)
1193 CASE_BODY(kRootArray, kFromCode, kStartOfObject, 0) 1193 CASE_BODY(kRootArray, kFromCode, kStartOfObject, 0)
1194 #endif 1194 #endif
1195 // Find an object in the partial snapshots cache and write a pointer to it 1195 // Find an object in the partial snapshots cache and write a pointer to it
1196 // to the current object. 1196 // to the current object.
1197 CASE_STATEMENT(kPartialSnapshotCache, kPlain, kStartOfObject, 0) 1197 CASE_STATEMENT(kPartialSnapshotCache, kPlain, kStartOfObject, 0)
1198 CASE_BODY(kPartialSnapshotCache, 1198 CASE_BODY(kPartialSnapshotCache,
1199 kPlain, 1199 kPlain,
1200 kStartOfObject, 1200 kStartOfObject,
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2477 return GetHeaderValue(kNumInternalizedStringsOffset); 2477 return GetHeaderValue(kNumInternalizedStringsOffset);
2478 } 2478 }
2479 2479
2480 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { 2480 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const {
2481 int reservations_size = GetHeaderValue(kReservationsOffset) * kInt32Size; 2481 int reservations_size = GetHeaderValue(kReservationsOffset) * kInt32Size;
2482 const byte* start = data_ + kHeaderSize + reservations_size; 2482 const byte* start = data_ + kHeaderSize + reservations_size;
2483 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), 2483 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start),
2484 GetHeaderValue(kNumCodeStubKeysOffset)); 2484 GetHeaderValue(kNumCodeStubKeysOffset));
2485 } 2485 }
2486 } } // namespace v8::internal 2486 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698