| Index: src/code-stubs.cc
|
| ===================================================================
|
| --- src/code-stubs.cc (revision 5696)
|
| +++ src/code-stubs.cc (working copy)
|
| @@ -123,7 +123,7 @@
|
| }
|
|
|
|
|
| -Object* CodeStub::TryGetCode() {
|
| +MaybeObject* CodeStub::TryGetCode() {
|
| Code* code;
|
| if (!FindCodeInCache(&code)) {
|
| // Generate the new code.
|
| @@ -139,8 +139,11 @@
|
| 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 @@
|
| 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));
|
| }
|
| }
|
|
|