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

Unified Diff: src/code-stubs.cc

Issue 3970005: Make Failure inherit from MaybeObject instead of Object. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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
===================================================================
--- 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));
}
}
« 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