Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: src/api.cc

Issue 6777007: Add thread-safety to creation of MemCopy and modulo functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add Release_Store to change. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698