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. |