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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 // code object. | 1101 // code object. |
1102 CASE_STATEMENT(kNewObject, kPlain, kInnerPointer, CODE_SPACE) | 1102 CASE_STATEMENT(kNewObject, kPlain, kInnerPointer, CODE_SPACE) |
1103 CASE_BODY(kNewObject, kPlain, kInnerPointer, CODE_SPACE) | 1103 CASE_BODY(kNewObject, kPlain, kInnerPointer, CODE_SPACE) |
1104 // Deserialize a new code object and write a pointer to its first | 1104 // Deserialize a new code object and write a pointer to its first |
1105 // instruction to the current code object. | 1105 // instruction to the current code object. |
1106 ALL_SPACES(kNewObject, kFromCode, kInnerPointer) | 1106 ALL_SPACES(kNewObject, kFromCode, kInnerPointer) |
1107 // Find a recently deserialized object using its offset from the current | 1107 // Find a recently deserialized object using its offset from the current |
1108 // allocation point and write a pointer to it to the current object. | 1108 // allocation point and write a pointer to it to the current object. |
1109 ALL_SPACES(kBackref, kPlain, kStartOfObject) | 1109 ALL_SPACES(kBackref, kPlain, kStartOfObject) |
1110 ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject) | 1110 ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject) |
1111 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL | 1111 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL || \ |
| 1112 defined(V8_TARGET_ARCH_MIPS64) |
1112 // Deserialize a new object from pointer found in code and write | 1113 // Deserialize a new object from pointer found in code and write |
1113 // a pointer to it to the current object. Required only for MIPS or ARM | 1114 // a pointer to it to the current object. Required only for MIPS or ARM |
1114 // with ool constant pool, and omitted on the other architectures because | 1115 // with ool constant pool, and omitted on the other architectures because |
1115 // it is fully unrolled and would cause bloat. | 1116 // it is fully unrolled and would cause bloat. |
1116 ALL_SPACES(kNewObject, kFromCode, kStartOfObject) | 1117 ALL_SPACES(kNewObject, kFromCode, kStartOfObject) |
1117 // Find a recently deserialized code object using its offset from the | 1118 // Find a recently deserialized code object using its offset from the |
1118 // current allocation point and write a pointer to it to the current | 1119 // current allocation point and write a pointer to it to the current |
1119 // object. Required only for MIPS or ARM with ool constant pool. | 1120 // object. Required only for MIPS or ARM with ool constant pool. |
1120 ALL_SPACES(kBackref, kFromCode, kStartOfObject) | 1121 ALL_SPACES(kBackref, kFromCode, kStartOfObject) |
1121 ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject) | 1122 ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject) |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 return length; | 1320 return length; |
1320 } | 1321 } |
1321 | 1322 |
1322 | 1323 |
1323 int Serializer::RootIndex(HeapObject* heap_object, HowToCode from) { | 1324 int Serializer::RootIndex(HeapObject* heap_object, HowToCode from) { |
1324 Heap* heap = isolate()->heap(); | 1325 Heap* heap = isolate()->heap(); |
1325 if (heap->InNewSpace(heap_object)) return kInvalidRootIndex; | 1326 if (heap->InNewSpace(heap_object)) return kInvalidRootIndex; |
1326 for (int i = 0; i < root_index_wave_front_; i++) { | 1327 for (int i = 0; i < root_index_wave_front_; i++) { |
1327 Object* root = heap->roots_array_start()[i]; | 1328 Object* root = heap->roots_array_start()[i]; |
1328 if (!root->IsSmi() && root == heap_object) { | 1329 if (!root->IsSmi() && root == heap_object) { |
1329 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL | 1330 #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL || \ |
| 1331 defined(V8_TARGET_ARCH_MIPS64) |
1330 if (from == kFromCode) { | 1332 if (from == kFromCode) { |
1331 // In order to avoid code bloat in the deserializer we don't have | 1333 // In order to avoid code bloat in the deserializer we don't have |
1332 // support for the encoding that specifies a particular root should | 1334 // support for the encoding that specifies a particular root should |
1333 // be written from within code. | 1335 // be written from within code. |
1334 return kInvalidRootIndex; | 1336 return kInvalidRootIndex; |
1335 } | 1337 } |
1336 #endif | 1338 #endif |
1337 return i; | 1339 return i; |
1338 } | 1340 } |
1339 } | 1341 } |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 deserializer.set_reservation( | 1907 deserializer.set_reservation( |
1906 i, raw_data[CodeSerializer::kReservationsOffset + i]); | 1908 i, raw_data[CodeSerializer::kReservationsOffset + i]); |
1907 } | 1909 } |
1908 Object* root; | 1910 Object* root; |
1909 deserializer.DeserializePartial(isolate, &root); | 1911 deserializer.DeserializePartial(isolate, &root); |
1910 deserializer.FlushICacheForNewCodeObjects(); | 1912 deserializer.FlushICacheForNewCodeObjects(); |
1911 ASSERT(root->IsSharedFunctionInfo()); | 1913 ASSERT(root->IsSharedFunctionInfo()); |
1912 return root; | 1914 return root; |
1913 } | 1915 } |
1914 } } // namespace v8::internal | 1916 } } // namespace v8::internal |
OLD | NEW |