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

Side by Side Diff: src/isolate.cc

Issue 645533003: Use hash map to look for objects in the root array when serializing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: make use of the hash map more often. Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 #ifdef DEBUG 2203 #ifdef DEBUG
2204 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2204 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2205 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2205 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2206 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2206 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2207 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2207 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2208 #undef ISOLATE_FIELD_OFFSET 2208 #undef ISOLATE_FIELD_OFFSET
2209 #endif 2209 #endif
2210 2210
2211 2211
2212 Handle<JSObject> Isolate::GetSymbolRegistry() { 2212 Handle<JSObject> Isolate::GetSymbolRegistry() {
2213 if (heap()->symbol_registry()->IsUndefined()) { 2213 if (heap()->symbol_registry()->IsSmi()) {
2214 Handle<Map> map = factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 2214 Handle<Map> map = factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
2215 Handle<JSObject> registry = factory()->NewJSObjectFromMap(map); 2215 Handle<JSObject> registry = factory()->NewJSObjectFromMap(map);
2216 heap()->set_symbol_registry(*registry); 2216 heap()->set_symbol_registry(*registry);
2217 2217
2218 static const char* nested[] = { 2218 static const char* nested[] = {
2219 "for", "for_api", "for_intern", "keyFor", "private_api", "private_intern" 2219 "for", "for_api", "for_intern", "keyFor", "private_api", "private_intern"
2220 }; 2220 };
2221 for (unsigned i = 0; i < arraysize(nested); ++i) { 2221 for (unsigned i = 0; i < arraysize(nested); ++i) {
2222 Handle<String> name = factory()->InternalizeUtf8String(nested[i]); 2222 Handle<String> name = factory()->InternalizeUtf8String(nested[i]);
2223 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); 2223 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2403 if (prev_ && prev_->Intercept(flag)) return true; 2403 if (prev_ && prev_->Intercept(flag)) return true;
2404 // Then check whether this scope intercepts. 2404 // Then check whether this scope intercepts.
2405 if ((flag & intercept_mask_)) { 2405 if ((flag & intercept_mask_)) {
2406 intercepted_flags_ |= flag; 2406 intercepted_flags_ |= flag;
2407 return true; 2407 return true;
2408 } 2408 }
2409 return false; 2409 return false;
2410 } 2410 }
2411 2411
2412 } } // namespace v8::internal 2412 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/serialize.h » ('j') | src/serialize.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698