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

Unified Diff: src/code-stubs.cc

Issue 4100005: Version 2.5.2 (Closed)
Patch Set: Created 10 years, 2 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/compilation-cache.cc » ('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 78062b4036fa6268d709b9f371d0faaa862a0d62..787ec2a7a1ee2d8d0b37d522d6453c4e2a93803b 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -123,7 +123,7 @@ Handle<Code> CodeStub::GetCode() {
}
-Object* CodeStub::TryGetCode() {
+MaybeObject* CodeStub::TryGetCode() {
Code* code;
if (!FindCodeInCache(&code)) {
// Generate the new code.
@@ -139,8 +139,11 @@ Object* CodeStub::TryGetCode() {
static_cast<Code::Kind>(GetCodeKind()),
InLoop(),
GetICState());
- Object* new_object = Heap::CreateCode(desc, flags, masm.CodeObject());
- if (new_object->IsFailure()) return new_object;
+ Object* new_object;
+ { MaybeObject* maybe_new_object =
+ Heap::CreateCode(desc, flags, masm.CodeObject());
+ if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object;
+ }
code = Code::cast(new_object);
RecordCodeGeneration(code, &masm);
@@ -148,8 +151,9 @@ Object* CodeStub::TryGetCode() {
SetCustomCache(code);
} else {
// Try to update the code cache but do not fail if unable.
- new_object = Heap::code_stubs()->AtNumberPut(GetKey(), code);
- if (!new_object->IsFailure()) {
+ MaybeObject* maybe_new_object =
+ Heap::code_stubs()->AtNumberPut(GetKey(), code);
+ if (maybe_new_object->ToObject(&new_object)) {
Heap::public_set_code_stubs(NumberDictionary::cast(new_object));
}
}
« no previous file with comments | « src/code-stubs.h ('k') | src/compilation-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698