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

Side by Side Diff: src/isolate.cc

Issue 196103004: Add support for per-isolate private symbols (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More comments; force dictionary mode Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/isolate.h ('k') | src/macros.py » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 2322
2323 2323
2324 #ifdef DEBUG 2324 #ifdef DEBUG
2325 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2325 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2326 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2326 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2327 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2327 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2328 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2328 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2329 #undef ISOLATE_FIELD_OFFSET 2329 #undef ISOLATE_FIELD_OFFSET
2330 #endif 2330 #endif
2331 2331
2332
2333 Handle<JSObject> Isolate::GetSymbolRegistry() {
2334 if (heap()->symbol_registry()->IsUndefined()) {
2335 Handle<Map> map = factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
2336 Handle<JSObject> registry = factory()->NewJSObjectFromMap(map);
2337 heap()->set_symbol_registry(*registry);
2338
2339 static const char* nested[] = {
2340 "for", "for_api", "for_intern", "keyFor", "private_api", "private_intern"
2341 };
2342 for (unsigned i = 0; i < ARRAY_SIZE(nested); ++i) {
2343 Handle<String> name = factory()->InternalizeUtf8String(nested[i]);
2344 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map);
2345 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8);
rossberg 2014/03/24 15:54:47 Now forcing into dictionary mode.
2346 JSObject::SetProperty(registry, name, obj, NONE, STRICT);
2347 }
2348 }
2349 return Handle<JSObject>::cast(factory()->symbol_registry());
2350 }
2351
2352
2332 } } // namespace v8::internal 2353 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698