| 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 14026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14037 int scope_position) { | 14037 int scope_position) { |
| 14038 uint32_t hash = source->Hash(); | 14038 uint32_t hash = source->Hash(); |
| 14039 if (shared->HasSourceCode()) { | 14039 if (shared->HasSourceCode()) { |
| 14040 // Instead of using the SharedFunctionInfo pointer in the hash | 14040 // Instead of using the SharedFunctionInfo pointer in the hash |
| 14041 // code computation, we use a combination of the hash of the | 14041 // code computation, we use a combination of the hash of the |
| 14042 // script source code and the start position of the calling scope. | 14042 // script source code and the start position of the calling scope. |
| 14043 // We do this to ensure that the cache entries can survive garbage | 14043 // We do this to ensure that the cache entries can survive garbage |
| 14044 // collection. | 14044 // collection. |
| 14045 Script* script(Script::cast(shared->script())); | 14045 Script* script(Script::cast(shared->script())); |
| 14046 hash ^= String::cast(script->source())->Hash(); | 14046 hash ^= String::cast(script->source())->Hash(); |
| 14047 STATIC_ASSERT(LANGUAGE_END == 2); | 14047 STATIC_ASSERT(LANGUAGE_END == 3); |
| 14048 if (is_strict(language_mode)) hash ^= 0x8000; | 14048 if (is_strict(language_mode)) hash ^= 0x8000; |
| 14049 if (is_strong(language_mode)) hash ^= 0x10000; |
| 14049 hash += scope_position; | 14050 hash += scope_position; |
| 14050 } | 14051 } |
| 14051 return hash; | 14052 return hash; |
| 14052 } | 14053 } |
| 14053 | 14054 |
| 14054 uint32_t Hash() OVERRIDE { | 14055 uint32_t Hash() OVERRIDE { |
| 14055 return StringSharedHashHelper(*source_, *shared_, language_mode_, | 14056 return StringSharedHashHelper(*source_, *shared_, language_mode_, |
| 14056 scope_position_); | 14057 scope_position_); |
| 14057 } | 14058 } |
| 14058 | 14059 |
| (...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16880 Handle<DependentCode> codes = | 16881 Handle<DependentCode> codes = |
| 16881 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16882 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16882 DependentCode::kPropertyCellChangedGroup, | 16883 DependentCode::kPropertyCellChangedGroup, |
| 16883 info->object_wrapper()); | 16884 info->object_wrapper()); |
| 16884 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16885 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16885 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16886 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16886 cell, info->zone()); | 16887 cell, info->zone()); |
| 16887 } | 16888 } |
| 16888 | 16889 |
| 16889 } } // namespace v8::internal | 16890 } } // namespace v8::internal |
| OLD | NEW |