|
Straightforward patch for allowing several V8 instances in process with retaining external API:
- Introduced V8ContextProvider, V8ContextBinder, AllowSeveralV8InstancesInProcess classes to public api (include\v8.h),
- Created v8::internal::V8Context class to hold the data of separate objects of v8 instance
- Created v8_context() inline function to return V8Context for accessing the data,
in case there is no AllowSeveralV8InstancesInProcess classes statically instantiated the function just returns global
pointer otherwise the data is retrieved from thread local variable
- Wrapped with locking dtoa calls in conversions.cc and pointer bounds handling/time calc activities in platform-win32.cc,
effectively doing mutex locking when AllowSeveralV8InstancesInProcess was instantiated
- Most of all other changes like moved static data of class/file XXX to XXXData.
- Moved static data of v8::internal::V8, static flag from v8::Locker, static callback pointer
exception_behavior from api.cc into v8::internal::V8Data as instance variables
- Moved static data of v8::internal::ThreadManager, v8::internal::ContextSwitcher, v8::internal::ThreadState,
static Thread::LocalStorageKey variables into v8::internal::ThreadManagerData
- Moved static data of v8::internal::Heap into v8::internal::HeapData as instance variables.
- MarkObjectVisitor and UnmarkObjectVisitor allocated on stack instead of static variables.
- static void MarkObjectRecursively(Object** p); becomes member of v8::internal::MarkObjectVisitor
- static void UnmarkObjectRecursively(Object** p); becomes member of v8::internal::UnmarkObjectVisitor
- Moved static data of heap.cc into v8::internal::PrivateHeapData as instance variables.
- static void MarkRootObjectRecursively(Object** root); moved to v8::internal::PrivateHeapData
- static data and types of v8::internal::TranscendentalCache moved to v8::internal::TranscendentalCacheData as
instance variables / types.
- static data and types of v8::internal::DescriptorLookupCache moved to v8::internal::DescriptorLookupCacheData
as instance variables / types.
- static data and types of v8::internal::KeyedLookupCacheData moved to v8::internal::KeyedLookupCacheDataData as
instance variables / types
- static data of v8::internal::Zone, v8::internal::ZoneScope, v8::internal::Zone,
v8::internal::AssertNoZoneAllocation, v8::internal::Segment moved to v8:internal::ZoneData
- static data of v8::internal::Top moved to v8::internal::TopData, static data of top.cc moved to
v8::internal::TopPrivateData as instance variables
- static data of v8::internal::StackGuard moved to v8::internal::StackGuard and static data of execution.cc moved
to v8::internal::StackGuardPrivateData as instance variables
- static data of v8::internal::RegExpStack and static data of regexp-macro-assembler.cc, jsregexp.cc moved to
v8::internal::RegExpStackData as instance variables
- static data of v8::internal::Serializer moved to class v8::internal::SerializerData, static data of serializer.cc
(ExternalReferenceTable, SerializationAddressMapper) moved to v8::internal::SerializerPrivateData
- static data of v8::internal::ContextSlotCache moved to v8::internal::ContextSlotCacheData
- HandleScopeImplementer singleton is member of v8::internal::V8Context now
- Static data of v8::internal::StubCache and v8::internal::CompilationCache become instance data of
v8::internal::StubCacheData and v8::internal::CompilationCachePrivateData
- All mutable statics of v8::internal::GlobalHandles become instance data of v8::internal::GlobalHandlesData
- All mutable statics of v8::internal::MemoryAllocator become instance data of v8::internal::MemoryAllocatorData
- All mutable statics of v8::internal::CodeRange become instance data of v8::internal::CodeRangeData
- All mutable statics of v8::internal::MarkCompactCollector become instance data of v8::internal::MarkCompactCollectorData
- All mutable statics of v8::internal::RelocatableData become instance data of v8::internal::RelocatableData
- All mutable statics of v8::internal::CodeGenerator become instance data of v8::internal::CodeGeneratorData
- All mutable statics of v8::internal::Bootstrapper become instance data of v8::internal::BootstrapperData
- All mutable statics of v8::internal::Scanner become instance data of v8::internal::ScannerData
- All mutable statics of v8::internal::Compiler become instance data of v8::internal::CompilerData
- All mutable statics of v8::internal::PreallocatedStorage, v8::internal::Page, v8::internal::NativeAllocationChecker
become instance data of v8::internal::StorageData
- All mutable statics of v8::internal::StatsTable become instance data of v8::internal::StatsTableData
- All mutable statics of v8::internal::Runtime become instance data of v8::internal::RuntimeData
- All mutable statics of v8::internal::Assembler become instance data of v8::internal::AssemblerData
- All mutable statics of api.cc become instance data of v8::internal::ApiData, except extensions
- All mutable statics of v8::internal::Bultins become instance data of v8::internal::BuiltinsData
- All mutable statics of v8::internal::Debug become instance data of v8::internal::DebugData
- All mutable statics of v8::internal::Debugger become instance data of v8::internal::DebuggerData
At this point 10 instances of V8 can run the benchmark for i386/Win32 :)
- Extensions processed in bootstrapper with v8shareddata lock if needed
- Counters class instance become a member of V8Context
- static instance of GlobalHandler::Pool moved to v8::internal::GlobalInstancePrivateData
- shell / cctest able to run with custom number of v8instances (not all tests are ready for this :)
- Statics of Logger and Log class moved to LoggerData/LogData
- Put all changes to forked V8 repository git://github.com/nicity/Embeddable-V8.git
- Handled shared data for Assembler on 64bit / Arm cpu
- Proper locking for reading/writing heap bounds for MacOS, Linux, BSD
BUG=http://code.google.com/p/v8/issues/detail?id=510
TEST=All tests should pass
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+4967 lines, -2940 lines) |
Patch |
|
M |
AUTHORS
|
View
|
8
9
10
11
12
13
14
15
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
include/v8.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
3 chunks |
+54 lines, -3 lines |
0 comments
|
Download
|
|
M |
samples/shell.cc
|
View
|
14
15
|
3 chunks |
+53 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/SConscript
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/allocation.h
|
View
|
12
13
14
15
|
3 chunks |
+55 lines, -38 lines |
0 comments
|
Download
|
|
M |
src/allocation.cc
|
View
|
12
13
14
15
|
5 chunks |
+23 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/api.h
|
View
|
12
13
14
15
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/api.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
24 chunks |
+39 lines, -31 lines |
0 comments
|
Download
|
|
M |
src/arm/assembler-arm.h
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/arm/assembler-arm.cc
|
View
|
|
3 chunks |
+24 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/arm/builtins-arm.cc
|
View
|
14
15
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/arm/disasm-arm.cc
|
View
|
12
13
14
15
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
src/arm/ic-arm.cc
|
View
|
14
15
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/arm/stub-cache-arm.cc
|
View
|
14
15
|
9 chunks |
+12 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/assembler.h
|
View
|
12
13
14
15
|
2 chunks |
+21 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/assembler.cc
|
View
|
12
13
14
15
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/bootstrapper.h
|
View
|
12
13
14
15
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/bootstrapper.cc
|
View
|
12
13
14
15
|
15 chunks |
+112 lines, -66 lines |
0 comments
|
Download
|
|
M |
src/builtins.h
|
View
|
12
13
14
15
|
4 chunks |
+39 lines, -20 lines |
0 comments
|
Download
|
|
M |
src/builtins.cc
|
View
|
12
13
14
15
|
7 chunks |
+24 lines, -21 lines |
0 comments
|
Download
|
|
M |
src/code-stubs.cc
|
View
|
14
15
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/codegen.h
|
View
|
12
13
14
15
|
1 chunk |
+7 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/codegen.cc
|
View
|
12
13
14
15
|
2 chunks |
+35 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/compilation-cache.h
|
View
|
10
11
12
13
14
15
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compilation-cache.cc
|
View
|
10
11
12
13
14
15
|
10 chunks |
+65 lines, -29 lines |
0 comments
|
Download
|
|
M |
src/compiler.h
|
View
|
12
13
14
15
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler.cc
|
View
|
12
13
14
15
|
8 chunks |
+12 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/conversions.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
8 chunks |
+12 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/counters.h
|
View
|
12
13
14
15
|
4 chunks |
+27 lines, -15 lines |
0 comments
|
Download
|
|
M |
src/counters.cc
|
View
|
12
13
14
15
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/dateparser.h
|
View
|
12
13
14
15
|
3 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
src/debug.h
|
View
|
12
13
14
15
|
7 chunks |
+165 lines, -113 lines |
0 comments
|
Download
|
|
M |
src/debug.cc
|
View
|
12
13
14
15
|
43 chunks |
+206 lines, -174 lines |
0 comments
|
Download
|
|
M |
src/disasm.h
|
View
|
12
13
14
15
|
2 chunks |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/disassembler.h
|
View
|
12
13
14
15
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
src/disassembler.cc
|
View
|
12
13
14
15
|
2 chunks |
+10 lines, -1 line |
0 comments
|
Download
|
|
M |
src/execution.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
5 chunks |
+67 lines, -39 lines |
0 comments
|
Download
|
|
M |
src/execution.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
8 chunks |
+88 lines, -45 lines |
0 comments
|
Download
|
|
M |
src/factory.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/flags.cc
|
View
|
14
15
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/frame-element.cc
|
View
|
12
13
14
15
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
src/global-handles.h
|
View
|
10
11
12
13
14
15
|
3 chunks |
+65 lines, -34 lines |
0 comments
|
Download
|
|
M |
src/global-handles.cc
|
View
|
10
11
12
13
14
15
|
17 chunks |
+56 lines, -33 lines |
0 comments
|
Download
|
|
M |
src/handles.h
|
View
|
10
11
12
13
14
15
|
3 chunks |
+21 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/handles.cc
|
View
|
10
11
12
13
14
15
|
8 chunks |
+25 lines, -22 lines |
0 comments
|
Download
|
|
M |
src/heap.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
21 chunks |
+289 lines, -165 lines |
0 comments
|
Download
|
|
M |
src/heap.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
80 chunks |
+577 lines, -478 lines |
0 comments
|
Download
|
|
M |
src/heap-inl.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
7 chunks |
+52 lines, -43 lines |
0 comments
|
Download
|
|
M |
src/ia32/assembler-ia32.h
|
View
|
12
13
14
15
|
6 chunks |
+35 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/ia32/assembler-ia32.cc
|
View
|
12
13
14
15
|
8 chunks |
+27 lines, -25 lines |
0 comments
|
Download
|
|
M |
src/ia32/builtins-ia32.cc
|
View
|
14
15
|
5 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/ia32/codegen-ia32.cc
|
View
|
14
15
|
17 chunks |
+17 lines, -17 lines |
0 comments
|
Download
|
|
M |
src/ia32/disasm-ia32.cc
|
View
|
12
13
14
15
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/ia32/ic-ia32.cc
|
View
|
14
15
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/ia32/stub-cache-ia32.cc
|
View
|
14
15
|
21 chunks |
+24 lines, -24 lines |
0 comments
|
Download
|
|
M |
src/jsregexp.cc
|
View
|
8
9
10
11
12
13
14
15
|
6 chunks |
+14 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/jump-target.h
|
View
|
12
13
14
15
|
3 chunks |
+24 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/jump-target.cc
|
View
|
12
13
14
15
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/log.h
|
View
|
15
|
3 chunks |
+50 lines, -29 lines |
0 comments
|
Download
|
|
M |
src/log.cc
|
View
|
14
15
|
31 chunks |
+143 lines, -98 lines |
0 comments
|
Download
|
|
M |
src/log-inl.h
|
View
|
15
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/log-utils.h
|
View
|
15
|
5 chunks |
+57 lines, -42 lines |
0 comments
|
Download
|
|
M |
src/log-utils.cc
|
View
|
15
|
8 chunks |
+57 lines, -51 lines |
0 comments
|
Download
|
|
M |
src/mark-compact.h
|
View
|
12
13
14
15
|
5 chunks |
+95 lines, -67 lines |
0 comments
|
Download
|
|
M |
src/mark-compact.cc
|
View
|
12
13
14
15
|
24 chunks |
+131 lines, -86 lines |
0 comments
|
Download
|
|
M |
src/objects.h
|
View
|
12
13
14
15
|
3 chunks |
+32 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/objects.cc
|
View
|
12
13
14
15
|
13 chunks |
+26 lines, -17 lines |
0 comments
|
Download
|
|
M |
src/parser.cc
|
View
|
14
15
|
4 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/platform-freebsd.cc
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/platform-linux.cc
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/platform-macos.cc
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/platform-openbsd.cc
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/platform-win32.cc
|
View
|
13
14
15
|
4 chunks |
+10 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/regexp-macro-assembler.cc
|
View
|
8
9
10
11
12
13
14
15
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
src/regexp-stack.h
|
View
|
8
9
10
11
12
13
14
15
|
4 chunks |
+52 lines, -23 lines |
0 comments
|
Download
|
|
M |
src/regexp-stack.cc
|
View
|
8
9
10
11
12
13
14
15
|
3 chunks |
+36 lines, -25 lines |
0 comments
|
Download
|
|
M |
src/register-allocator.cc
|
View
|
12
13
14
15
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
src/rewriter.cc
|
View
|
14
15
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/runtime.h
|
View
|
12
13
14
15
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/runtime.cc
|
View
|
12
13
14
15
|
21 chunks |
+79 lines, -35 lines |
0 comments
|
Download
|
|
M |
src/scanner.h
|
View
|
12
13
14
15
|
4 chunks |
+21 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/scanner.cc
|
View
|
12
13
14
15
|
13 chunks |
+36 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/scopeinfo.h
|
View
|
10
11
12
13
14
15
|
3 chunks |
+17 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/scopeinfo.cc
|
View
|
10
11
12
13
14
15
|
5 chunks |
+20 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/serialize.h
|
View
|
10
11
12
13
14
15
|
3 chunks |
+30 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/serialize.cc
|
View
|
10
11
12
13
14
15
|
7 chunks |
+45 lines, -22 lines |
0 comments
|
Download
|
|
M |
src/spaces.h
|
View
|
12
13
14
15
|
6 chunks |
+93 lines, -68 lines |
0 comments
|
Download
|
|
M |
src/spaces.cc
|
View
|
12
13
14
15
|
17 chunks |
+148 lines, -126 lines |
0 comments
|
Download
|
|
M |
src/spaces-inl.h
|
View
|
12
13
14
15
|
3 chunks |
+11 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/stub-cache.h
|
View
|
10
11
12
13
14
15
|
3 chunks |
+23 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/stub-cache.cc
|
View
|
10
11
12
13
14
15
|
9 chunks |
+23 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/top.h
|
View
|
8
9
10
11
12
13
14
15
|
10 chunks |
+84 lines, -40 lines |
0 comments
|
Download
|
|
M |
src/top.cc
|
View
|
8
9
10
11
12
13
14
15
|
25 chunks |
+276 lines, -213 lines |
0 comments
|
Download
|
|
M |
src/usage-analyzer.cc
|
View
|
14
15
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/v8.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
4 chunks |
+44 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/v8.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
3 chunks |
+21 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/v8-counters.h
|
View
|
14
15
|
2 chunks |
+13 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/v8-counters.cc
|
View
|
14
15
|
1 chunk |
+30 lines, -15 lines |
0 comments
|
Download
|
|
A |
src/v8-global-context.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1 chunk |
+183 lines, -0 lines |
0 comments
|
Download
|
|
A |
src/v8-global-context.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1 chunk |
+204 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/v8threads.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
3 chunks |
+54 lines, -38 lines |
0 comments
|
Download
|
|
M |
src/v8threads.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
17 chunks |
+78 lines, -69 lines |
0 comments
|
Download
|
|
M |
src/x64/assembler-x64.h
|
View
|
|
6 chunks |
+29 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/x64/assembler-x64.cc
|
View
|
14
15
|
9 chunks |
+36 lines, -23 lines |
0 comments
|
Download
|
|
M |
src/x64/builtins-x64.cc
|
View
|
14
15
|
5 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/x64/codegen-x64.cc
|
View
|
14
15
|
11 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/x64/disasm-x64.cc
|
View
|
12
13
14
15
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/x64/ic-x64.cc
|
View
|
14
15
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/x64/stub-cache-x64.cc
|
View
|
14
15
|
21 chunks |
+24 lines, -24 lines |
0 comments
|
Download
|
|
M |
src/zone.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
5 chunks |
+43 lines, -22 lines |
0 comments
|
Download
|
|
M |
src/zone.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
8 chunks |
+21 lines, -28 lines |
0 comments
|
Download
|
|
M |
src/zone-inl.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
2 chunks |
+12 lines, -7 lines |
0 comments
|
Download
|
|
M |
test/cctest/cctest.h
|
View
|
14
15
|
3 chunks |
+15 lines, -1 line |
0 comments
|
Download
|
|
M |
test/cctest/cctest.cc
|
View
|
14
15
|
1 chunk |
+13 lines, -1 line |
0 comments
|
Download
|
|
M |
test/cctest/test-debug.cc
|
View
|
12
13
14
15
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
test/cctest/test-serialize.cc
|
View
|
14
15
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
Total messages: 9 (0 generated)
|