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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 List<Handle<Object> > contexts(2); | 1048 List<Handle<Object> > contexts(2); |
1049 while (HandleScopeImplementer::instance()->HasSavedContexts()) { | 1049 while (HandleScopeImplementer::instance()->HasSavedContexts()) { |
1050 Handle<Object> context = | 1050 Handle<Object> context = |
1051 HandleScopeImplementer::instance()->RestoreContext(); | 1051 HandleScopeImplementer::instance()->RestoreContext(); |
1052 contexts.Add(context); | 1052 contexts.Add(context); |
1053 } | 1053 } |
1054 for (int i = contexts.length() - 1; i >= 0; i--) { | 1054 for (int i = contexts.length() - 1; i >= 0; i--) { |
1055 HandleScopeImplementer::instance()->SaveContext(contexts[i]); | 1055 HandleScopeImplementer::instance()->SaveContext(contexts[i]); |
1056 } | 1056 } |
1057 PutGlobalHandleStack(contexts); | 1057 PutGlobalHandleStack(contexts); |
1058 | |
1059 List<Handle<Object> > security_contexts(2); | |
1060 while (HandleScopeImplementer::instance()->HasSavedSecurityContexts()) { | |
1061 Handle<Object> context = | |
1062 HandleScopeImplementer::instance()->RestoreSecurityContext(); | |
1063 security_contexts.Add(context); | |
1064 } | |
1065 for (int i = security_contexts.length() - 1; i >= 0; i--) { | |
1066 Handle<Object> context = security_contexts[i]; | |
1067 HandleScopeImplementer::instance()->SaveSecurityContext(context); | |
1068 } | |
1069 PutGlobalHandleStack(security_contexts); | |
1070 } | 1058 } |
1071 | 1059 |
1072 | 1060 |
1073 void Serializer::PutEncodedAddress(Address addr) { | 1061 void Serializer::PutEncodedAddress(Address addr) { |
1074 writer_->PutC('P'); | 1062 writer_->PutC('P'); |
1075 writer_->PutInt(reinterpret_cast<int>(addr)); | 1063 writer_->PutInt(reinterpret_cast<int>(addr)); |
1076 } | 1064 } |
1077 | 1065 |
1078 | 1066 |
1079 Address Serializer::Encode(Object* o, bool* serialized) { | 1067 Address Serializer::Encode(Object* o, bool* serialized) { |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 reader_.ExpectC(']'); | 1371 reader_.ExpectC(']'); |
1384 } | 1372 } |
1385 | 1373 |
1386 | 1374 |
1387 void Deserializer::GetContextStack() { | 1375 void Deserializer::GetContextStack() { |
1388 List<Handle<Object> > entered_contexts(2); | 1376 List<Handle<Object> > entered_contexts(2); |
1389 GetGlobalHandleStack(&entered_contexts); | 1377 GetGlobalHandleStack(&entered_contexts); |
1390 for (int i = 0; i < entered_contexts.length(); i++) { | 1378 for (int i = 0; i < entered_contexts.length(); i++) { |
1391 HandleScopeImplementer::instance()->SaveContext(entered_contexts[i]); | 1379 HandleScopeImplementer::instance()->SaveContext(entered_contexts[i]); |
1392 } | 1380 } |
1393 List<Handle<Object> > security_contexts(2); | |
1394 GetGlobalHandleStack(&security_contexts); | |
1395 for (int i = 0; i < security_contexts.length(); i++) { | |
1396 HandleScopeImplementer::instance()-> | |
1397 SaveSecurityContext(security_contexts[i]); | |
1398 } | |
1399 } | 1381 } |
1400 | 1382 |
1401 | 1383 |
1402 Address Deserializer::GetEncodedAddress() { | 1384 Address Deserializer::GetEncodedAddress() { |
1403 reader_.ExpectC('P'); | 1385 reader_.ExpectC('P'); |
1404 return reinterpret_cast<Address>(reader_.GetInt()); | 1386 return reinterpret_cast<Address>(reader_.GetInt()); |
1405 } | 1387 } |
1406 | 1388 |
1407 | 1389 |
1408 Object* Deserializer::GetObject() { | 1390 Object* Deserializer::GetObject() { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 ASSERT(index < large_objects_.length()); | 1507 ASSERT(index < large_objects_.length()); |
1526 } | 1508 } |
1527 return large_objects_[index]; // s.page_offset() is ignored. | 1509 return large_objects_[index]; // s.page_offset() is ignored. |
1528 } | 1510 } |
1529 UNREACHABLE(); | 1511 UNREACHABLE(); |
1530 return NULL; | 1512 return NULL; |
1531 } | 1513 } |
1532 | 1514 |
1533 | 1515 |
1534 } } // namespace v8::internal | 1516 } } // namespace v8::internal |
OLD | NEW |