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

Unified Diff: src/code-stubs.cc

Issue 556243005: Serialize code stubs using stub key. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index fac530eb4c2e7e8425fa16c458b91e8e910a713e..389a9dffc4b30e1fad1e309bd67d9590f6b1008f 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -245,6 +245,22 @@ void CodeStub::InitializeDescriptor(Isolate* isolate, uint32_t key,
}
+void CodeStub::GetCodeDispatchCall(CodeStub* stub, void** value_out) {
+ Handle<Code>* code_out = reinterpret_cast<Handle<Code>*>(value_out);
+ // Code stubs with special cache cannot be recreated from stub key.
+ *code_out = stub->UseSpecialCache() ? Handle<Code>() : stub->GetCode();
+}
+
+
+MaybeHandle<Code> CodeStub::GetCode(Isolate* isolate, uint32_t key) {
+ HandleScope scope(isolate);
+ Handle<Code> code;
+ void** value_out = reinterpret_cast<void**>(&code);
+ Dispatch(isolate, key, value_out, &GetCodeDispatchCall);
+ return scope.CloseAndEscape(code);
+}
+
+
// static
void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) {
// Generate the uninitialized versions of the stub.
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698