OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 } | 1295 } |
1296 | 1296 |
1297 // Copy the data to ensure it is properly aligned. | 1297 // Copy the data to ensure it is properly aligned. |
1298 int deserialized_data_length = length / sizeof(unsigned); | 1298 int deserialized_data_length = length / sizeof(unsigned); |
1299 // If aligned, don't create a copy of the data. | 1299 // If aligned, don't create a copy of the data. |
1300 if (reinterpret_cast<intptr_t>(data) % sizeof(unsigned) == 0) { | 1300 if (reinterpret_cast<intptr_t>(data) % sizeof(unsigned) == 0) { |
1301 return new i::ScriptDataImpl(data, length); | 1301 return new i::ScriptDataImpl(data, length); |
1302 } | 1302 } |
1303 // Copy the data to align it. | 1303 // Copy the data to align it. |
1304 unsigned* deserialized_data = i::NewArray<unsigned>(deserialized_data_length); | 1304 unsigned* deserialized_data = i::NewArray<unsigned>(deserialized_data_length); |
1305 i::MemCopy(deserialized_data, data, length); | 1305 i::OS::MemCopy(deserialized_data, data, length); |
1306 | 1306 |
1307 return new i::ScriptDataImpl( | 1307 return new i::ScriptDataImpl( |
1308 i::Vector<unsigned>(deserialized_data, deserialized_data_length)); | 1308 i::Vector<unsigned>(deserialized_data, deserialized_data_length)); |
1309 } | 1309 } |
1310 | 1310 |
1311 | 1311 |
1312 // --- S c r i p t --- | 1312 // --- S c r i p t --- |
1313 | 1313 |
1314 | 1314 |
1315 Local<Script> Script::New(v8::Handle<String> source, | 1315 Local<Script> Script::New(v8::Handle<String> source, |
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5640 | 5640 |
5641 | 5641 |
5642 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5642 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
5643 HandleScopeImplementer* scope_implementer = | 5643 HandleScopeImplementer* scope_implementer = |
5644 reinterpret_cast<HandleScopeImplementer*>(storage); | 5644 reinterpret_cast<HandleScopeImplementer*>(storage); |
5645 scope_implementer->IterateThis(v); | 5645 scope_implementer->IterateThis(v); |
5646 return storage + ArchiveSpacePerThread(); | 5646 return storage + ArchiveSpacePerThread(); |
5647 } | 5647 } |
5648 | 5648 |
5649 } } // namespace v8::internal | 5649 } } // namespace v8::internal |
OLD | NEW |