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

Side by Side Diff: src/isolate.cc

Issue 9083001: Use a random seed for the string hash algorithm. Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 11 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 | « src/isolate.h ('k') | src/objects.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 preallocated_storage_preallocated_(false), 1430 preallocated_storage_preallocated_(false),
1431 inner_pointer_to_code_cache_(NULL), 1431 inner_pointer_to_code_cache_(NULL),
1432 write_input_buffer_(NULL), 1432 write_input_buffer_(NULL),
1433 global_handles_(NULL), 1433 global_handles_(NULL),
1434 context_switcher_(NULL), 1434 context_switcher_(NULL),
1435 thread_manager_(NULL), 1435 thread_manager_(NULL),
1436 fp_stubs_generated_(false), 1436 fp_stubs_generated_(false),
1437 has_installed_extensions_(false), 1437 has_installed_extensions_(false),
1438 string_tracker_(NULL), 1438 string_tracker_(NULL),
1439 regexp_stack_(NULL), 1439 regexp_stack_(NULL),
1440 embedder_data_(NULL) { 1440 embedder_data_(NULL),
1441 hasher_seed_(0) {
1441 TRACE_ISOLATE(constructor); 1442 TRACE_ISOLATE(constructor);
1442 1443
1443 memset(isolate_addresses_, 0, 1444 memset(isolate_addresses_, 0,
1444 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); 1445 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1));
1445 1446
1446 heap_.isolate_ = this; 1447 heap_.isolate_ = this;
1447 zone_.isolate_ = this; 1448 zone_.isolate_ = this;
1448 stack_guard_.isolate_ = this; 1449 stack_guard_.isolate_ = this;
1449 1450
1450 // ThreadManager is initialized early to support locking an isolate 1451 // ThreadManager is initialized early to support locking an isolate
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 unicode_cache_ = new UnicodeCache(); 1727 unicode_cache_ = new UnicodeCache();
1727 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); 1728 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this);
1728 write_input_buffer_ = new StringInputBuffer(); 1729 write_input_buffer_ = new StringInputBuffer();
1729 global_handles_ = new GlobalHandles(this); 1730 global_handles_ = new GlobalHandles(this);
1730 bootstrapper_ = new Bootstrapper(); 1731 bootstrapper_ = new Bootstrapper();
1731 handle_scope_implementer_ = new HandleScopeImplementer(this); 1732 handle_scope_implementer_ = new HandleScopeImplementer(this);
1732 stub_cache_ = new StubCache(this); 1733 stub_cache_ = new StubCache(this);
1733 regexp_stack_ = new RegExpStack(); 1734 regexp_stack_ = new RegExpStack();
1734 regexp_stack_->isolate_ = this; 1735 regexp_stack_->isolate_ = this;
1735 1736
1737 // Setup the seed that is used to randomize the string hash function.
1738 ASSERT(hasher_seed_ == 0);
1739 if (FLAG_randomize_string_hashes) {
1740 if (FLAG_string_hash_seed == 0) {
1741 hasher_seed_ = V8::RandomPrivate(this);
1742 } else {
1743 hasher_seed_ = FLAG_string_hash_seed;
1744 }
1745 }
1746
1736 // Enable logging before setting up the heap 1747 // Enable logging before setting up the heap
1737 logger_->Setup(); 1748 logger_->Setup();
1738 1749
1739 CpuProfiler::Setup(); 1750 CpuProfiler::Setup();
1740 HeapProfiler::Setup(); 1751 HeapProfiler::Setup();
1741 1752
1742 // Initialize other runtime facilities 1753 // Initialize other runtime facilities
1743 #if defined(USE_SIMULATOR) 1754 #if defined(USE_SIMULATOR)
1744 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) 1755 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS)
1745 Simulator::Initialize(this); 1756 Simulator::Initialize(this);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 1912
1902 #ifdef DEBUG 1913 #ifdef DEBUG
1903 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 1914 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
1904 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 1915 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
1905 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 1916 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
1906 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 1917 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
1907 #undef ISOLATE_FIELD_OFFSET 1918 #undef ISOLATE_FIELD_OFFSET
1908 #endif 1919 #endif
1909 1920
1910 } } // namespace v8::internal 1921 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698