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