| 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 15274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15285 | 15285 |
| 15286 isolate->factory()->set_string_table(table); | 15286 isolate->factory()->set_string_table(table); |
| 15287 return Handle<String>::cast(string); | 15287 return Handle<String>::cast(string); |
| 15288 } | 15288 } |
| 15289 | 15289 |
| 15290 | 15290 |
| 15291 Handle<Object> CompilationCacheTable::Lookup(Handle<String> src, | 15291 Handle<Object> CompilationCacheTable::Lookup(Handle<String> src, |
| 15292 Handle<Context> context) { | 15292 Handle<Context> context) { |
| 15293 Isolate* isolate = GetIsolate(); | 15293 Isolate* isolate = GetIsolate(); |
| 15294 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 15294 Handle<SharedFunctionInfo> shared(context->closure()->shared()); |
| 15295 StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY, | 15295 LanguageMode mode = construct_language_mode(FLAG_use_strict, FLAG_use_strong); |
| 15296 RelocInfo::kNoPosition); | 15296 StringSharedKey key(src, shared, mode, RelocInfo::kNoPosition); |
| 15297 int entry = FindEntry(&key); | 15297 int entry = FindEntry(&key); |
| 15298 if (entry == kNotFound) return isolate->factory()->undefined_value(); | 15298 if (entry == kNotFound) return isolate->factory()->undefined_value(); |
| 15299 int index = EntryToIndex(entry); | 15299 int index = EntryToIndex(entry); |
| 15300 if (!get(index)->IsFixedArray()) return isolate->factory()->undefined_value(); | 15300 if (!get(index)->IsFixedArray()) return isolate->factory()->undefined_value(); |
| 15301 return Handle<Object>(get(index + 1), isolate); | 15301 return Handle<Object>(get(index + 1), isolate); |
| 15302 } | 15302 } |
| 15303 | 15303 |
| 15304 | 15304 |
| 15305 Handle<Object> CompilationCacheTable::LookupEval( | 15305 Handle<Object> CompilationCacheTable::LookupEval( |
| 15306 Handle<String> src, Handle<SharedFunctionInfo> outer_info, | 15306 Handle<String> src, Handle<SharedFunctionInfo> outer_info, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 15326 if (entry == kNotFound) return isolate->factory()->undefined_value(); | 15326 if (entry == kNotFound) return isolate->factory()->undefined_value(); |
| 15327 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); | 15327 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); |
| 15328 } | 15328 } |
| 15329 | 15329 |
| 15330 | 15330 |
| 15331 Handle<CompilationCacheTable> CompilationCacheTable::Put( | 15331 Handle<CompilationCacheTable> CompilationCacheTable::Put( |
| 15332 Handle<CompilationCacheTable> cache, Handle<String> src, | 15332 Handle<CompilationCacheTable> cache, Handle<String> src, |
| 15333 Handle<Context> context, Handle<Object> value) { | 15333 Handle<Context> context, Handle<Object> value) { |
| 15334 Isolate* isolate = cache->GetIsolate(); | 15334 Isolate* isolate = cache->GetIsolate(); |
| 15335 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 15335 Handle<SharedFunctionInfo> shared(context->closure()->shared()); |
| 15336 StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY, | 15336 LanguageMode mode = construct_language_mode(FLAG_use_strict, FLAG_use_strong); |
| 15337 RelocInfo::kNoPosition); | 15337 StringSharedKey key(src, shared, mode, RelocInfo::kNoPosition); |
| 15338 { | 15338 { |
| 15339 Handle<Object> k = key.AsHandle(isolate); | 15339 Handle<Object> k = key.AsHandle(isolate); |
| 15340 DisallowHeapAllocation no_allocation_scope; | 15340 DisallowHeapAllocation no_allocation_scope; |
| 15341 int entry = cache->FindEntry(&key); | 15341 int entry = cache->FindEntry(&key); |
| 15342 if (entry != kNotFound) { | 15342 if (entry != kNotFound) { |
| 15343 cache->set(EntryToIndex(entry), *k); | 15343 cache->set(EntryToIndex(entry), *k); |
| 15344 cache->set(EntryToIndex(entry) + 1, *value); | 15344 cache->set(EntryToIndex(entry) + 1, *value); |
| 15345 return cache; | 15345 return cache; |
| 15346 } | 15346 } |
| 15347 } | 15347 } |
| (...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16940 Handle<DependentCode> codes = | 16940 Handle<DependentCode> codes = |
| 16941 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16941 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16942 DependentCode::kPropertyCellChangedGroup, | 16942 DependentCode::kPropertyCellChangedGroup, |
| 16943 info->object_wrapper()); | 16943 info->object_wrapper()); |
| 16944 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16944 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16945 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16945 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16946 cell, info->zone()); | 16946 cell, info->zone()); |
| 16947 } | 16947 } |
| 16948 | 16948 |
| 16949 } } // namespace v8::internal | 16949 } } // namespace v8::internal |
| OLD | NEW |