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

Side by Side Diff: src/runtime.cc

Issue 225673003: Return MaybeHandle from GetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 10792 matching lines...) Expand 10 before | Expand all | Expand 10 after
10803 } 10803 }
10804 return value; 10804 return value;
10805 } 10805 }
10806 case CONSTANT: 10806 case CONSTANT:
10807 return result->GetConstant(); 10807 return result->GetConstant();
10808 case CALLBACKS: { 10808 case CALLBACKS: {
10809 Object* structure = result->GetCallbackObject(); 10809 Object* structure = result->GetCallbackObject();
10810 if (structure->IsForeign() || structure->IsAccessorInfo()) { 10810 if (structure->IsForeign() || structure->IsAccessorInfo()) {
10811 Isolate* isolate = heap->isolate(); 10811 Isolate* isolate = heap->isolate();
10812 HandleScope scope(isolate); 10812 HandleScope scope(isolate);
10813 Handle<Object> value = JSObject::GetPropertyWithCallback( 10813 MaybeHandle<Object> maybe_value = JSObject::GetPropertyWithCallback(
10814 handle(result->holder(), isolate), 10814 handle(result->holder(), isolate),
10815 handle(receiver, isolate), 10815 handle(receiver, isolate),
10816 handle(structure, isolate), 10816 handle(structure, isolate),
10817 handle(name, isolate)); 10817 handle(name, isolate));
10818 if (value.is_null()) { 10818 Handle<Object> value;
10819 MaybeObject* exception = heap->isolate()->pending_exception(); 10819 if (maybe_value.ToHandle(&value)) return *value;
10820 heap->isolate()->clear_pending_exception(); 10820 MaybeObject* exception = heap->isolate()->pending_exception();
10821 if (caught_exception != NULL) *caught_exception = true; 10821 heap->isolate()->clear_pending_exception();
10822 return exception; 10822 if (caught_exception != NULL) *caught_exception = true;
10823 } 10823 return exception;
10824 return *value;
10825 } else { 10824 } else {
10826 return heap->undefined_value(); 10825 return heap->undefined_value();
10827 } 10826 }
10828 } 10827 }
10829 case INTERCEPTOR: 10828 case INTERCEPTOR:
10830 return heap->undefined_value(); 10829 return heap->undefined_value();
10831 case HANDLER: 10830 case HANDLER:
10832 case NONEXISTENT: 10831 case NONEXISTENT:
10833 UNREACHABLE(); 10832 UNREACHABLE();
10834 return heap->undefined_value(); 10833 return heap->undefined_value();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
10997 // args[0]: object 10996 // args[0]: object
10998 // args[1]: property name 10997 // args[1]: property name
10999 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugNamedInterceptorPropertyValue) { 10998 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugNamedInterceptorPropertyValue) {
11000 HandleScope scope(isolate); 10999 HandleScope scope(isolate);
11001 ASSERT(args.length() == 2); 11000 ASSERT(args.length() == 2);
11002 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 11001 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
11003 RUNTIME_ASSERT(obj->HasNamedInterceptor()); 11002 RUNTIME_ASSERT(obj->HasNamedInterceptor());
11004 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 11003 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
11005 11004
11006 PropertyAttributes attributes; 11005 PropertyAttributes attributes;
11007 Handle<Object> result = 11006 Handle<Object> result;
11008 JSObject::GetPropertyWithInterceptor(obj, obj, name, &attributes); 11007 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
11009 RETURN_IF_EMPTY_HANDLE(isolate, result); 11008 isolate, result,
11009 JSObject::GetPropertyWithInterceptor(obj, obj, name, &attributes));
11010 return *result; 11010 return *result;
11011 } 11011 }
11012 11012
11013 11013
11014 // Return element value from indexed interceptor. 11014 // Return element value from indexed interceptor.
11015 // args[0]: object 11015 // args[0]: object
11016 // args[1]: index 11016 // args[1]: index
11017 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugIndexedInterceptorElementValue) { 11017 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugIndexedInterceptorElementValue) {
11018 HandleScope scope(isolate); 11018 HandleScope scope(isolate);
11019 ASSERT(args.length() == 2); 11019 ASSERT(args.length() == 2);
(...skipping 4205 matching lines...) Expand 10 before | Expand all | Expand 10 after
15225 } 15225 }
15226 } 15226 }
15227 15227
15228 15228
15229 void Runtime::OutOfMemory() { 15229 void Runtime::OutOfMemory() {
15230 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); 15230 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true);
15231 UNREACHABLE(); 15231 UNREACHABLE();
15232 } 15232 }
15233 15233
15234 } } // namespace v8::internal 15234 } } // namespace v8::internal
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698