forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 929236 - Cache asm.js compiled code in Gecko (r=janv)
--HG-- extra : rebase_source : 1c97962da0044858c583fc45e69dd22e519b8066
- Loading branch information
Luke Wagner
committed
Nov 18, 2013
1 parent
1c6f4ab
commit 5ed834b
Showing
21 changed files
with
1,567 additions
and
12 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=2 et sw=2 tw=80: */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef mozilla_dom_asmjscache_asmjscache_h | ||
#define mozilla_dom_asmjscache_asmjscache_h | ||
|
||
#include "ipc/IPCMessageUtils.h" | ||
#include "js/TypeDecls.h" | ||
#include "js/Vector.h" | ||
|
||
class nsIPrincipal; | ||
|
||
namespace mozilla { | ||
namespace dom { | ||
|
||
namespace quota { | ||
class Client; | ||
} | ||
|
||
namespace asmjscache { | ||
|
||
class PAsmJSCacheEntryChild; | ||
class PAsmJSCacheEntryParent; | ||
|
||
enum OpenMode | ||
{ | ||
eOpenForRead, | ||
eOpenForWrite, | ||
NUM_OPEN_MODES | ||
}; | ||
|
||
// Implementation of AsmJSCacheOps, installed by nsJSEnvironment: | ||
|
||
bool | ||
OpenEntryForRead(JS::Handle<JSObject*> aGlobal, size_t* aSize, | ||
const uint8_t** aMemory, intptr_t *aHandle); | ||
void | ||
CloseEntryForRead(JS::Handle<JSObject*> aGlobal, size_t aSize, | ||
const uint8_t* aMemory, intptr_t aHandle); | ||
bool | ||
OpenEntryForWrite(JS::Handle<JSObject*> aGlobal, size_t aSize, | ||
uint8_t** aMemory, intptr_t* aHandle); | ||
void | ||
CloseEntryForWrite(JS::Handle<JSObject*> aGlobal, size_t aSize, | ||
uint8_t* aMemory, intptr_t aHandle); | ||
bool | ||
GetBuildId(js::Vector<char>* aBuildId); | ||
|
||
// Called from QuotaManager.cpp: | ||
|
||
quota::Client* | ||
CreateClient(); | ||
|
||
// Called from ipc/ContentParent.cpp: | ||
|
||
PAsmJSCacheEntryParent* | ||
AllocEntryParent(OpenMode aOpenMode, uint32_t aSizeToWrite, | ||
nsIPrincipal* aPrincipal); | ||
|
||
void | ||
DeallocEntryParent(PAsmJSCacheEntryParent* aActor); | ||
|
||
// Called from ipc/ContentChild.cpp: | ||
|
||
void | ||
DeallocEntryChild(PAsmJSCacheEntryChild* aActor); | ||
|
||
} // namespace asmjscache | ||
} // namespace dom | ||
} // namespace mozilla | ||
|
||
namespace IPC { | ||
|
||
template <> | ||
struct ParamTraits<mozilla::dom::asmjscache::OpenMode> : | ||
public EnumSerializer<mozilla::dom::asmjscache::OpenMode, | ||
mozilla::dom::asmjscache::eOpenForRead, | ||
mozilla::dom::asmjscache::NUM_OPEN_MODES> | ||
{ }; | ||
|
||
} // namespace IPC | ||
|
||
#endif // mozilla_dom_asmjscache_asmjscache_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
include protocol PContent; | ||
|
||
namespace mozilla { | ||
namespace dom { | ||
namespace asmjscache { | ||
|
||
protocol PAsmJSCacheEntry | ||
{ | ||
manager PContent; | ||
|
||
child: | ||
OnOpen(int64_t fileSize, FileDescriptor fileDesc); | ||
|
||
both: | ||
__delete__(); | ||
}; | ||
|
||
} // namespace asmjscache | ||
} // namespace dom | ||
} // namespace mozilla |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- | ||
# vim: set filetype=python: | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
EXPORTS.mozilla.dom.asmjscache += [ | ||
'AsmJSCache.h' | ||
] | ||
|
||
SOURCES += [ | ||
'AsmJSCache.cpp' | ||
] | ||
|
||
IPDL_SOURCES += [ | ||
'PAsmJSCacheEntry.ipdl' | ||
] | ||
|
||
FAIL_ON_WARNINGS = True | ||
|
||
MSVC_ENABLE_PGO = True | ||
|
||
include('/ipc/chromium/chromium-config.mozbuild') | ||
|
||
FINAL_LIBRARY = 'gklayout' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ PARALLEL_DIRS += [ | |
'encoding', | ||
'file', | ||
'fmradio', | ||
'asmjscache', | ||
'media', | ||
'messages', | ||
'power', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.