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

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
« no previous file with comments | « src/objects.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10810 matching lines...) Expand 10 before | Expand all | Expand 10 after
10821 } 10821 }
10822 return value; 10822 return value;
10823 } 10823 }
10824 case CONSTANT: 10824 case CONSTANT:
10825 return result->GetConstant(); 10825 return result->GetConstant();
10826 case CALLBACKS: { 10826 case CALLBACKS: {
10827 Object* structure = result->GetCallbackObject(); 10827 Object* structure = result->GetCallbackObject();
10828 if (structure->IsForeign() || structure->IsAccessorInfo()) { 10828 if (structure->IsForeign() || structure->IsAccessorInfo()) {
10829 Isolate* isolate = heap->isolate(); 10829 Isolate* isolate = heap->isolate();
10830 HandleScope scope(isolate); 10830 HandleScope scope(isolate);
10831 Handle<Object> value = JSObject::GetPropertyWithCallback( 10831 MaybeHandle<Object> maybe_value = JSObject::GetPropertyWithCallback(
10832 handle(result->holder(), isolate), 10832 handle(result->holder(), isolate),
10833 handle(receiver, isolate), 10833 handle(receiver, isolate),
10834 handle(structure, isolate), 10834 handle(structure, isolate),
10835 handle(name, isolate)); 10835 handle(name, isolate));
10836 if (value.is_null()) { 10836 Handle<Object> value;
10837 MaybeObject* exception = heap->isolate()->pending_exception(); 10837 if (maybe_value.ToHandle(&value)) return *value;
10838 heap->isolate()->clear_pending_exception(); 10838 MaybeObject* exception = heap->isolate()->pending_exception();
10839 if (caught_exception != NULL) *caught_exception = true; 10839 heap->isolate()->clear_pending_exception();
10840 return exception; 10840 if (caught_exception != NULL) *caught_exception = true;
10841 } 10841 return exception;
10842 return *value;
10843 } else { 10842 } else {
10844 return heap->undefined_value(); 10843 return heap->undefined_value();
10845 } 10844 }
10846 } 10845 }
10847 case INTERCEPTOR: 10846 case INTERCEPTOR:
10848 return heap->undefined_value(); 10847 return heap->undefined_value();
10849 case HANDLER: 10848 case HANDLER:
10850 case NONEXISTENT: 10849 case NONEXISTENT:
10851 UNREACHABLE(); 10850 UNREACHABLE();
10852 return heap->undefined_value(); 10851 return heap->undefined_value();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
11015 // args[0]: object 11014 // args[0]: object
11016 // args[1]: property name 11015 // args[1]: property name
11017 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugNamedInterceptorPropertyValue) { 11016 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugNamedInterceptorPropertyValue) {
11018 HandleScope scope(isolate); 11017 HandleScope scope(isolate);
11019 ASSERT(args.length() == 2); 11018 ASSERT(args.length() == 2);
11020 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 11019 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
11021 RUNTIME_ASSERT(obj->HasNamedInterceptor()); 11020 RUNTIME_ASSERT(obj->HasNamedInterceptor());
11022 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 11021 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
11023 11022
11024 PropertyAttributes attributes; 11023 PropertyAttributes attributes;
11025 Handle<Object> result = 11024 Handle<Object> result;
11026 JSObject::GetPropertyWithInterceptor(obj, obj, name, &attributes); 11025 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
11027 RETURN_IF_EMPTY_HANDLE(isolate, result); 11026 isolate, result,
11027 JSObject::GetPropertyWithInterceptor(obj, obj, name, &attributes));
11028 return *result; 11028 return *result;
11029 } 11029 }
11030 11030
11031 11031
11032 // Return element value from indexed interceptor. 11032 // Return element value from indexed interceptor.
11033 // args[0]: object 11033 // args[0]: object
11034 // args[1]: index 11034 // args[1]: index
11035 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugIndexedInterceptorElementValue) { 11035 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugIndexedInterceptorElementValue) {
11036 HandleScope scope(isolate); 11036 HandleScope scope(isolate);
11037 ASSERT(args.length() == 2); 11037 ASSERT(args.length() == 2);
(...skipping 4220 matching lines...) Expand 10 before | Expand all | Expand 10 after
15258 } 15258 }
15259 } 15259 }
15260 15260
15261 15261
15262 void Runtime::OutOfMemory() { 15262 void Runtime::OutOfMemory() {
15263 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); 15263 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true);
15264 UNREACHABLE(); 15264 UNREACHABLE();
15265 } 15265 }
15266 15266
15267 } } // namespace v8::internal 15267 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698