Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: src/objects.cc

Issue 923573002: Properly thread language mode to compilation cache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15336 matching lines...) Expand 10 before | Expand all | Expand 10 after
15347 entry = table->FindInsertionEntry(key->Hash()); 15347 entry = table->FindInsertionEntry(key->Hash());
15348 table->set(EntryToIndex(entry), *string); 15348 table->set(EntryToIndex(entry), *string);
15349 table->ElementAdded(); 15349 table->ElementAdded();
15350 15350
15351 isolate->factory()->set_string_table(table); 15351 isolate->factory()->set_string_table(table);
15352 return Handle<String>::cast(string); 15352 return Handle<String>::cast(string);
15353 } 15353 }
15354 15354
15355 15355
15356 Handle<Object> CompilationCacheTable::Lookup(Handle<String> src, 15356 Handle<Object> CompilationCacheTable::Lookup(Handle<String> src,
15357 Handle<Context> context) { 15357 Handle<Context> context,
15358 LanguageMode language_mode) {
15358 Isolate* isolate = GetIsolate(); 15359 Isolate* isolate = GetIsolate();
15359 Handle<SharedFunctionInfo> shared(context->closure()->shared()); 15360 Handle<SharedFunctionInfo> shared(context->closure()->shared());
15360 LanguageMode mode = construct_language_mode(FLAG_use_strict, FLAG_use_strong); 15361 StringSharedKey key(src, shared, language_mode, RelocInfo::kNoPosition);
15361 StringSharedKey key(src, shared, mode, RelocInfo::kNoPosition);
15362 int entry = FindEntry(&key); 15362 int entry = FindEntry(&key);
15363 if (entry == kNotFound) return isolate->factory()->undefined_value(); 15363 if (entry == kNotFound) return isolate->factory()->undefined_value();
15364 int index = EntryToIndex(entry); 15364 int index = EntryToIndex(entry);
15365 if (!get(index)->IsFixedArray()) return isolate->factory()->undefined_value(); 15365 if (!get(index)->IsFixedArray()) return isolate->factory()->undefined_value();
15366 return Handle<Object>(get(index + 1), isolate); 15366 return Handle<Object>(get(index + 1), isolate);
15367 } 15367 }
15368 15368
15369 15369
15370 Handle<Object> CompilationCacheTable::LookupEval( 15370 Handle<Object> CompilationCacheTable::LookupEval(
15371 Handle<String> src, Handle<SharedFunctionInfo> outer_info, 15371 Handle<String> src, Handle<SharedFunctionInfo> outer_info,
(...skipping 16 matching lines...) Expand all
15388 DisallowHeapAllocation no_allocation; 15388 DisallowHeapAllocation no_allocation;
15389 RegExpKey key(src, flags); 15389 RegExpKey key(src, flags);
15390 int entry = FindEntry(&key); 15390 int entry = FindEntry(&key);
15391 if (entry == kNotFound) return isolate->factory()->undefined_value(); 15391 if (entry == kNotFound) return isolate->factory()->undefined_value();
15392 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); 15392 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
15393 } 15393 }
15394 15394
15395 15395
15396 Handle<CompilationCacheTable> CompilationCacheTable::Put( 15396 Handle<CompilationCacheTable> CompilationCacheTable::Put(
15397 Handle<CompilationCacheTable> cache, Handle<String> src, 15397 Handle<CompilationCacheTable> cache, Handle<String> src,
15398 Handle<Context> context, Handle<Object> value) { 15398 Handle<Context> context, LanguageMode language_mode, Handle<Object> value) {
15399 Isolate* isolate = cache->GetIsolate(); 15399 Isolate* isolate = cache->GetIsolate();
15400 Handle<SharedFunctionInfo> shared(context->closure()->shared()); 15400 Handle<SharedFunctionInfo> shared(context->closure()->shared());
15401 LanguageMode mode = construct_language_mode(FLAG_use_strict, FLAG_use_strong); 15401 StringSharedKey key(src, shared, language_mode, RelocInfo::kNoPosition);
15402 StringSharedKey key(src, shared, mode, RelocInfo::kNoPosition);
15403 { 15402 {
15404 Handle<Object> k = key.AsHandle(isolate); 15403 Handle<Object> k = key.AsHandle(isolate);
15405 DisallowHeapAllocation no_allocation_scope; 15404 DisallowHeapAllocation no_allocation_scope;
15406 int entry = cache->FindEntry(&key); 15405 int entry = cache->FindEntry(&key);
15407 if (entry != kNotFound) { 15406 if (entry != kNotFound) {
15408 cache->set(EntryToIndex(entry), *k); 15407 cache->set(EntryToIndex(entry), *k);
15409 cache->set(EntryToIndex(entry) + 1, *value); 15408 cache->set(EntryToIndex(entry) + 1, *value);
15410 return cache; 15409 return cache;
15411 } 15410 }
15412 } 15411 }
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
17008 CompilationInfo* info) { 17007 CompilationInfo* info) {
17009 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( 17008 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo(
17010 handle(cell->dependent_code(), info->isolate()), 17009 handle(cell->dependent_code(), info->isolate()),
17011 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); 17010 DependentCode::kPropertyCellChangedGroup, info->object_wrapper());
17012 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 17011 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
17013 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 17012 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
17014 cell, info->zone()); 17013 cell, info->zone());
17015 } 17014 }
17016 17015
17017 } } // namespace v8::internal 17016 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698