| 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 14706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14717 Isolate* isolate = GetIsolate(); | 14717 Isolate* isolate = GetIsolate(); |
| 14718 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 14718 Handle<SharedFunctionInfo> shared(context->closure()->shared()); |
| 14719 StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY, | 14719 StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY, |
| 14720 RelocInfo::kNoPosition); | 14720 RelocInfo::kNoPosition); |
| 14721 int entry = FindEntry(&key); | 14721 int entry = FindEntry(&key); |
| 14722 if (entry == kNotFound) return isolate->factory()->undefined_value(); | 14722 if (entry == kNotFound) return isolate->factory()->undefined_value(); |
| 14723 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); | 14723 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); |
| 14724 } | 14724 } |
| 14725 | 14725 |
| 14726 | 14726 |
| 14727 Handle<Object> CompilationCacheTable::LookupEval(Handle<String> src, | 14727 Handle<Object> CompilationCacheTable::LookupEval( |
| 14728 Handle<Context> context, | 14728 Handle<String> src, Handle<SharedFunctionInfo> outer_info, |
| 14729 StrictMode strict_mode, | 14729 StrictMode strict_mode, int scope_position) { |
| 14730 int scope_position) { | |
| 14731 Isolate* isolate = GetIsolate(); | 14730 Isolate* isolate = GetIsolate(); |
| 14732 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 14731 // Cache key is the tuple (source, outer shared function info, scope position) |
| 14733 StringSharedKey key(src, shared, strict_mode, scope_position); | 14732 // to unambiguously identify the context chain the cached eval code assumes. |
| 14733 StringSharedKey key(src, outer_info, strict_mode, scope_position); |
| 14734 int entry = FindEntry(&key); | 14734 int entry = FindEntry(&key); |
| 14735 if (entry == kNotFound) return isolate->factory()->undefined_value(); | 14735 if (entry == kNotFound) return isolate->factory()->undefined_value(); |
| 14736 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); | 14736 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); |
| 14737 } | 14737 } |
| 14738 | 14738 |
| 14739 | 14739 |
| 14740 Handle<Object> CompilationCacheTable::LookupRegExp(Handle<String> src, | 14740 Handle<Object> CompilationCacheTable::LookupRegExp(Handle<String> src, |
| 14741 JSRegExp::Flags flags) { | 14741 JSRegExp::Flags flags) { |
| 14742 Isolate* isolate = GetIsolate(); | 14742 Isolate* isolate = GetIsolate(); |
| 14743 DisallowHeapAllocation no_allocation; | 14743 DisallowHeapAllocation no_allocation; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 14760 int entry = cache->FindInsertionEntry(key.Hash()); | 14760 int entry = cache->FindInsertionEntry(key.Hash()); |
| 14761 cache->set(EntryToIndex(entry), *k); | 14761 cache->set(EntryToIndex(entry), *k); |
| 14762 cache->set(EntryToIndex(entry) + 1, *value); | 14762 cache->set(EntryToIndex(entry) + 1, *value); |
| 14763 cache->ElementAdded(); | 14763 cache->ElementAdded(); |
| 14764 return cache; | 14764 return cache; |
| 14765 } | 14765 } |
| 14766 | 14766 |
| 14767 | 14767 |
| 14768 Handle<CompilationCacheTable> CompilationCacheTable::PutEval( | 14768 Handle<CompilationCacheTable> CompilationCacheTable::PutEval( |
| 14769 Handle<CompilationCacheTable> cache, Handle<String> src, | 14769 Handle<CompilationCacheTable> cache, Handle<String> src, |
| 14770 Handle<Context> context, Handle<SharedFunctionInfo> value, | 14770 Handle<SharedFunctionInfo> outer_info, Handle<SharedFunctionInfo> value, |
| 14771 int scope_position) { | 14771 int scope_position) { |
| 14772 Isolate* isolate = cache->GetIsolate(); | 14772 Isolate* isolate = cache->GetIsolate(); |
| 14773 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 14773 StringSharedKey key(src, outer_info, value->strict_mode(), scope_position); |
| 14774 StringSharedKey key(src, shared, value->strict_mode(), scope_position); | |
| 14775 cache = EnsureCapacity(cache, 1, &key); | 14774 cache = EnsureCapacity(cache, 1, &key); |
| 14776 Handle<Object> k = key.AsHandle(isolate); | 14775 Handle<Object> k = key.AsHandle(isolate); |
| 14777 int entry = cache->FindInsertionEntry(key.Hash()); | 14776 int entry = cache->FindInsertionEntry(key.Hash()); |
| 14778 cache->set(EntryToIndex(entry), *k); | 14777 cache->set(EntryToIndex(entry), *k); |
| 14779 cache->set(EntryToIndex(entry) + 1, *value); | 14778 cache->set(EntryToIndex(entry) + 1, *value); |
| 14780 cache->ElementAdded(); | 14779 cache->ElementAdded(); |
| 14781 return cache; | 14780 return cache; |
| 14782 } | 14781 } |
| 14783 | 14782 |
| 14784 | 14783 |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16354 Handle<DependentCode> codes = | 16353 Handle<DependentCode> codes = |
| 16355 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16354 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16356 DependentCode::kPropertyCellChangedGroup, | 16355 DependentCode::kPropertyCellChangedGroup, |
| 16357 info->object_wrapper()); | 16356 info->object_wrapper()); |
| 16358 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16357 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16359 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16358 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16360 cell, info->zone()); | 16359 cell, info->zone()); |
| 16361 } | 16360 } |
| 16362 | 16361 |
| 16363 } } // namespace v8::internal | 16362 } } // namespace v8::internal |
| OLD | NEW |