Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 17608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 17619 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); | 17619 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); |
| 17620 } | 17620 } |
| 17621 | 17621 |
| 17622 | 17622 |
| 17623 Handle<CompilationCacheTable> CompilationCacheTable::Put( | 17623 Handle<CompilationCacheTable> CompilationCacheTable::Put( |
| 17624 Handle<CompilationCacheTable> cache, Handle<String> src, | 17624 Handle<CompilationCacheTable> cache, Handle<String> src, |
| 17625 Handle<Context> context, LanguageMode language_mode, Handle<Object> value) { | 17625 Handle<Context> context, LanguageMode language_mode, Handle<Object> value) { |
| 17626 Isolate* isolate = cache->GetIsolate(); | 17626 Isolate* isolate = cache->GetIsolate(); |
| 17627 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 17627 Handle<SharedFunctionInfo> shared(context->closure()->shared()); |
| 17628 StringSharedKey key(src, shared, language_mode, RelocInfo::kNoPosition); | 17628 StringSharedKey key(src, shared, language_mode, RelocInfo::kNoPosition); |
| 17629 Handle<Object> k = key.AsHandle(isolate); | |
| 17629 { | 17630 { |
| 17630 Handle<Object> k = key.AsHandle(isolate); | |
| 17631 DisallowHeapAllocation no_allocation_scope; | 17631 DisallowHeapAllocation no_allocation_scope; |
| 17632 int entry = cache->FindEntry(&key); | 17632 int entry = cache->FindEntry(&key); |
|
Yang
2016/04/15 12:03:38
I don't think this code path is actually possible.
| |
| 17633 if (entry != kNotFound) { | 17633 if (entry != kNotFound) { |
| 17634 cache->set(EntryToIndex(entry), *k); | 17634 cache->set(EntryToIndex(entry), *k); |
| 17635 cache->set(EntryToIndex(entry) + 1, *value); | 17635 cache->set(EntryToIndex(entry) + 1, *value); |
| 17636 return cache; | 17636 return cache; |
| 17637 } | 17637 } |
| 17638 } | 17638 } |
| 17639 | 17639 |
| 17640 cache = EnsureCapacity(cache, 1, &key); | 17640 cache = EnsureCapacity(cache, 1, &key); |
| 17641 int entry = cache->FindInsertionEntry(key.Hash()); | 17641 int entry = cache->FindInsertionEntry(key.Hash()); |
| 17642 Handle<Object> k = | |
| 17643 isolate->factory()->NewNumber(static_cast<double>(key.Hash())); | |
| 17644 cache->set(EntryToIndex(entry), *k); | 17642 cache->set(EntryToIndex(entry), *k); |
| 17645 cache->set(EntryToIndex(entry) + 1, Smi::FromInt(kHashGenerations)); | 17643 cache->set(EntryToIndex(entry) + 1, *value); |
| 17646 cache->ElementAdded(); | 17644 cache->ElementAdded(); |
| 17647 return cache; | 17645 return cache; |
| 17648 } | 17646 } |
| 17649 | 17647 |
| 17650 | 17648 |
| 17651 Handle<CompilationCacheTable> CompilationCacheTable::PutEval( | 17649 Handle<CompilationCacheTable> CompilationCacheTable::PutEval( |
| 17652 Handle<CompilationCacheTable> cache, Handle<String> src, | 17650 Handle<CompilationCacheTable> cache, Handle<String> src, |
| 17653 Handle<SharedFunctionInfo> outer_info, Handle<SharedFunctionInfo> value, | 17651 Handle<SharedFunctionInfo> outer_info, Handle<SharedFunctionInfo> value, |
| 17654 int scope_position) { | 17652 int scope_position) { |
| 17655 Isolate* isolate = cache->GetIsolate(); | 17653 Isolate* isolate = cache->GetIsolate(); |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 19376 if (cell->value() != *new_value) { | 19374 if (cell->value() != *new_value) { |
| 19377 cell->set_value(*new_value); | 19375 cell->set_value(*new_value); |
| 19378 Isolate* isolate = cell->GetIsolate(); | 19376 Isolate* isolate = cell->GetIsolate(); |
| 19379 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19377 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19380 isolate, DependentCode::kPropertyCellChangedGroup); | 19378 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19381 } | 19379 } |
| 19382 } | 19380 } |
| 19383 | 19381 |
| 19384 } // namespace internal | 19382 } // namespace internal |
| 19385 } // namespace v8 | 19383 } // namespace v8 |
| OLD | NEW |