OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 CHECK(target == NULL ? encoding == 0 : encoding != 0); | 1292 CHECK(target == NULL ? encoding == 0 : encoding != 0); |
1293 int representation; | 1293 int representation; |
1294 // Can't use a ternary operator because of gcc. | 1294 // Can't use a ternary operator because of gcc. |
1295 if (rinfo->IsCodedSpecially()) { | 1295 if (rinfo->IsCodedSpecially()) { |
1296 representation = kStartOfObject + kFromCode; | 1296 representation = kStartOfObject + kFromCode; |
1297 } else { | 1297 } else { |
1298 representation = kStartOfObject + kPlain; | 1298 representation = kStartOfObject + kPlain; |
1299 } | 1299 } |
1300 sink_->Put(kExternalReference + representation, "ExternalReference"); | 1300 sink_->Put(kExternalReference + representation, "ExternalReference"); |
1301 sink_->PutInt(encoding, "reference id"); | 1301 sink_->PutInt(encoding, "reference id"); |
1302 bytes_processed_so_far_ += Assembler::kExternalTargetSize; | 1302 bytes_processed_so_far_ += rinfo->target_address_size(); |
1303 } | 1303 } |
1304 | 1304 |
1305 | 1305 |
1306 void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) { | 1306 void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) { |
1307 CHECK(RelocInfo::IsCodeTarget(rinfo->rmode())); | 1307 CHECK(RelocInfo::IsCodeTarget(rinfo->rmode())); |
1308 Address target_start = rinfo->target_address_address(); | 1308 Address target_start = rinfo->target_address_address(); |
1309 OutputRawData(target_start); | 1309 OutputRawData(target_start); |
1310 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1310 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1311 serializer_->SerializeObject(target, kFromCode, kFirstInstruction); | 1311 serializer_->SerializeObject(target, kFromCode, kFirstInstruction); |
1312 bytes_processed_so_far_ += Assembler::kCallTargetSize; | 1312 bytes_processed_so_far_ += rinfo->target_address_size(); |
1313 } | 1313 } |
1314 | 1314 |
1315 | 1315 |
1316 void Serializer::ObjectSerializer::VisitExternalAsciiString( | 1316 void Serializer::ObjectSerializer::VisitExternalAsciiString( |
1317 v8::String::ExternalAsciiStringResource** resource_pointer) { | 1317 v8::String::ExternalAsciiStringResource** resource_pointer) { |
1318 Address references_start = reinterpret_cast<Address>(resource_pointer); | 1318 Address references_start = reinterpret_cast<Address>(resource_pointer); |
1319 OutputRawData(references_start); | 1319 OutputRawData(references_start); |
1320 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { | 1320 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
1321 Object* source = Heap::natives_source_cache()->get(i); | 1321 Object* source = Heap::natives_source_cache()->get(i); |
1322 if (!source->IsUndefined()) { | 1322 if (!source->IsUndefined()) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1426 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
1427 } | 1427 } |
1428 } | 1428 } |
1429 int allocation_address = fullness_[space]; | 1429 int allocation_address = fullness_[space]; |
1430 fullness_[space] = allocation_address + size; | 1430 fullness_[space] = allocation_address + size; |
1431 return allocation_address; | 1431 return allocation_address; |
1432 } | 1432 } |
1433 | 1433 |
1434 | 1434 |
1435 } } // namespace v8::internal | 1435 } } // namespace v8::internal |
OLD | NEW |