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

Unified Diff: src/factory.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/execution.cc ('k') | src/globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
===================================================================
--- src/factory.cc (revision 5696)
+++ src/factory.cc (working copy)
@@ -431,7 +431,8 @@
const char* type,
Handle<JSArray> args) {
Handle<String> make_str = Factory::LookupAsciiSymbol(maker);
- Handle<Object> fun_obj(Top::builtins()->GetProperty(*make_str));
+ Handle<Object> fun_obj(Top::builtins()->GetPropertyNoExceptionThrown(
+ *make_str));
// If the builtins haven't been properly configured yet this error
// constructor may not have been defined. Bail out.
if (!fun_obj->IsJSFunction())
@@ -464,7 +465,7 @@
Handle<JSFunction> fun =
Handle<JSFunction>(
JSFunction::cast(
- Top::builtins()->GetProperty(*constr)));
+ Top::builtins()->GetPropertyNoExceptionThrown(*constr)));
Object** argv[1] = { Handle<Object>::cast(message).location() };
// Invoke the JavaScript factory method. If an exception is thrown while
@@ -567,12 +568,13 @@
}
-static inline Object* DoCopyInsert(DescriptorArray* array,
- String* key,
- Object* value,
- PropertyAttributes attributes) {
+MUST_USE_RESULT static inline MaybeObject* DoCopyInsert(
+ DescriptorArray* array,
+ String* key,
+ Object* value,
+ PropertyAttributes attributes) {
CallbacksDescriptor desc(key, value, attributes);
- Object* obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
+ MaybeObject* obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
return obj;
}
@@ -921,11 +923,15 @@
}
-static Object* UpdateMapCacheWith(Context* context,
- FixedArray* keys,
- Map* map) {
- Object* result = MapCache::cast(context->map_cache())->Put(keys, map);
- if (!result->IsFailure()) context->set_map_cache(MapCache::cast(result));
+MUST_USE_RESULT static MaybeObject* UpdateMapCacheWith(Context* context,
+ FixedArray* keys,
+ Map* map) {
+ Object* result;
+ { MaybeObject* maybe_result =
+ MapCache::cast(context->map_cache())->Put(keys, map);
+ if (!maybe_result->ToObject(&result)) return maybe_result;
+ }
+ context->set_map_cache(MapCache::cast(result));
return result;
}
« no previous file with comments | « src/execution.cc ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698