OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 14012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14023 int scope_position) { | 14023 int scope_position) { |
14024 uint32_t hash = source->Hash(); | 14024 uint32_t hash = source->Hash(); |
14025 if (shared->HasSourceCode()) { | 14025 if (shared->HasSourceCode()) { |
14026 // Instead of using the SharedFunctionInfo pointer in the hash | 14026 // Instead of using the SharedFunctionInfo pointer in the hash |
14027 // code computation, we use a combination of the hash of the | 14027 // code computation, we use a combination of the hash of the |
14028 // script source code and the start position of the calling scope. | 14028 // script source code and the start position of the calling scope. |
14029 // We do this to ensure that the cache entries can survive garbage | 14029 // We do this to ensure that the cache entries can survive garbage |
14030 // collection. | 14030 // collection. |
14031 Script* script(Script::cast(shared->script())); | 14031 Script* script(Script::cast(shared->script())); |
14032 hash ^= String::cast(script->source())->Hash(); | 14032 hash ^= String::cast(script->source())->Hash(); |
14033 STATIC_ASSERT(LANGUAGE_END == 2); | 14033 STATIC_ASSERT(LANGUAGE_END == 3); |
14034 if (is_strict(language_mode)) hash ^= 0x8000; | 14034 if (is_strict(language_mode)) hash ^= 0x8000; |
| 14035 if (is_sane(language_mode)) hash ^= 0x10000; |
14035 hash += scope_position; | 14036 hash += scope_position; |
14036 } | 14037 } |
14037 return hash; | 14038 return hash; |
14038 } | 14039 } |
14039 | 14040 |
14040 uint32_t Hash() OVERRIDE { | 14041 uint32_t Hash() OVERRIDE { |
14041 return StringSharedHashHelper(*source_, *shared_, language_mode_, | 14042 return StringSharedHashHelper(*source_, *shared_, language_mode_, |
14042 scope_position_); | 14043 scope_position_); |
14043 } | 14044 } |
14044 | 14045 |
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16866 Handle<DependentCode> codes = | 16867 Handle<DependentCode> codes = |
16867 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16868 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16868 DependentCode::kPropertyCellChangedGroup, | 16869 DependentCode::kPropertyCellChangedGroup, |
16869 info->object_wrapper()); | 16870 info->object_wrapper()); |
16870 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16871 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16871 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16872 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16872 cell, info->zone()); | 16873 cell, info->zone()); |
16873 } | 16874 } |
16874 | 16875 |
16875 } } // namespace v8::internal | 16876 } } // namespace v8::internal |
OLD | NEW |