From 38f2363df6bf67215be742ec478dd674976f38bb Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Mon, 22 Feb 2010 10:04:22 +0000 Subject: [PATCH] Consistently return failure if the stub cache cannot deliver a code object Some functions of the stub cache returned undefined if a code stub could not be generated. However the clients of these functions only cehcks for failure. Now all these functions return a failire object if no code stub can be made available Review URL: http://codereview.chromium.org/652039 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3923 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/stub-cache.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/stub-cache.cc b/src/stub-cache.cc index 3adaa40c1e..577c2d773f 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -105,7 +105,7 @@ Object* StubCache::ComputeLoadField(String* name, if (code->IsFailure()) return code; LOG(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); } @@ -124,7 +124,7 @@ Object* StubCache::ComputeLoadCallback(String* name, if (code->IsFailure()) return code; LOG(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); } @@ -143,7 +143,7 @@ Object* StubCache::ComputeLoadConstant(String* name, if (code->IsFailure()) return code; LOG(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); } @@ -160,7 +160,7 @@ Object* StubCache::ComputeLoadInterceptor(String* name, if (code->IsFailure()) return code; LOG(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); } @@ -189,7 +189,7 @@ Object* StubCache::ComputeLoadGlobal(String* name, if (code->IsFailure()) return code; LOG(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); } @@ -351,7 +351,7 @@ Object* StubCache::ComputeStoreGlobal(String* name, if (code->IsFailure()) return code; LOG(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); } @@ -566,7 +566,7 @@ Object* StubCache::ComputeCallGlobal(int argc, ASSERT_EQ(flags, Code::cast(code)->flags()); LOG(CodeCreateEvent(Logger::CALL_IC_TAG, Code::cast(code), name)); Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); - if (result->IsFailure()) return code; + if (result->IsFailure()) return result; } return Set(name, receiver->map(), Code::cast(code)); }