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

Side by Side Diff: src/bootstrapper.cc

Issue 1074943002: Split TemplateHashMapImpl::Lookup into two methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm (and ppc) builds Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 2507
2508 static uint32_t Hash(RegisteredExtension* extension) { 2508 static uint32_t Hash(RegisteredExtension* extension) {
2509 return v8::internal::ComputePointerHash(extension); 2509 return v8::internal::ComputePointerHash(extension);
2510 } 2510 }
2511 2511
2512 2512
2513 Genesis::ExtensionStates::ExtensionStates() : map_(HashMap::PointersMatch, 8) {} 2513 Genesis::ExtensionStates::ExtensionStates() : map_(HashMap::PointersMatch, 8) {}
2514 2514
2515 Genesis::ExtensionTraversalState Genesis::ExtensionStates::get_state( 2515 Genesis::ExtensionTraversalState Genesis::ExtensionStates::get_state(
2516 RegisteredExtension* extension) { 2516 RegisteredExtension* extension) {
2517 i::HashMap::Entry* entry = map_.Lookup(extension, Hash(extension), false); 2517 i::HashMap::Entry* entry = map_.Lookup(extension, Hash(extension));
2518 if (entry == NULL) { 2518 if (entry == NULL) {
2519 return UNVISITED; 2519 return UNVISITED;
2520 } 2520 }
2521 return static_cast<ExtensionTraversalState>( 2521 return static_cast<ExtensionTraversalState>(
2522 reinterpret_cast<intptr_t>(entry->value)); 2522 reinterpret_cast<intptr_t>(entry->value));
2523 } 2523 }
2524 2524
2525 void Genesis::ExtensionStates::set_state(RegisteredExtension* extension, 2525 void Genesis::ExtensionStates::set_state(RegisteredExtension* extension,
2526 ExtensionTraversalState state) { 2526 ExtensionTraversalState state) {
2527 map_.Lookup(extension, Hash(extension), true)->value = 2527 map_.LookupOrInsert(extension, Hash(extension))->value =
2528 reinterpret_cast<void*>(static_cast<intptr_t>(state)); 2528 reinterpret_cast<void*>(static_cast<intptr_t>(state));
2529 } 2529 }
2530 2530
2531 2531
2532 bool Genesis::InstallExtensions(Handle<Context> native_context, 2532 bool Genesis::InstallExtensions(Handle<Context> native_context,
2533 v8::ExtensionConfiguration* extensions) { 2533 v8::ExtensionConfiguration* extensions) {
2534 Isolate* isolate = native_context->GetIsolate(); 2534 Isolate* isolate = native_context->GetIsolate();
2535 ExtensionStates extension_states; // All extensions have state UNVISITED. 2535 ExtensionStates extension_states; // All extensions have state UNVISITED.
2536 return InstallAutoExtensions(isolate, &extension_states) && 2536 return InstallAutoExtensions(isolate, &extension_states) &&
2537 (!FLAG_expose_free_buffer || 2537 (!FLAG_expose_free_buffer ||
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 return from + sizeof(NestingCounterType); 2964 return from + sizeof(NestingCounterType);
2965 } 2965 }
2966 2966
2967 2967
2968 // Called when the top-level V8 mutex is destroyed. 2968 // Called when the top-level V8 mutex is destroyed.
2969 void Bootstrapper::FreeThreadResources() { 2969 void Bootstrapper::FreeThreadResources() {
2970 DCHECK(!IsActive()); 2970 DCHECK(!IsActive());
2971 } 2971 }
2972 2972
2973 } } // namespace v8::internal 2973 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast-value-factory.cc ('k') | src/compiler/state-values-utils.cc » ('j') | src/hashmap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698