| 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));
|
| }
|
| }
|
|
|