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

Side by Side Diff: src/runtime.cc

Issue 27335002: Handlify GetPropertyWithCallback. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: inline and remove schedule exception check Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | no next file » | 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 10685 matching lines...) Expand 10 before | Expand all | Expand 10 after
10696 if (value->IsTheHole()) { 10696 if (value->IsTheHole()) {
10697 return heap->undefined_value(); 10697 return heap->undefined_value();
10698 } 10698 }
10699 return value; 10699 return value;
10700 } 10700 }
10701 case CONSTANT: 10701 case CONSTANT:
10702 return result->GetConstant(); 10702 return result->GetConstant();
10703 case CALLBACKS: { 10703 case CALLBACKS: {
10704 Object* structure = result->GetCallbackObject(); 10704 Object* structure = result->GetCallbackObject();
10705 if (structure->IsForeign() || structure->IsAccessorInfo()) { 10705 if (structure->IsForeign() || structure->IsAccessorInfo()) {
10706 MaybeObject* maybe_value = result->holder()->GetPropertyWithCallback( 10706 Isolate* isolate = heap->isolate();
10707 receiver, structure, name); 10707 HandleScope scope(isolate);
10708 if (!maybe_value->ToObject(&value)) { 10708 Handle<Object> value = JSObject::GetPropertyWithCallback(
10709 if (maybe_value->IsRetryAfterGC()) return maybe_value; 10709 handle(result->holder(), isolate),
10710 ASSERT(maybe_value->IsException()); 10710 handle(receiver, isolate),
10711 maybe_value = heap->isolate()->pending_exception(); 10711 handle(structure, isolate),
10712 handle(name, isolate));
10713 if (value.is_null()) {
10714 MaybeObject* exception = heap->isolate()->pending_exception();
10712 heap->isolate()->clear_pending_exception(); 10715 heap->isolate()->clear_pending_exception();
10713 if (caught_exception != NULL) { 10716 if (caught_exception != NULL) *caught_exception = true;
10714 *caught_exception = true; 10717 return exception;
10715 }
10716 return maybe_value;
10717 } 10718 }
10718 return value; 10719 return *value;
10719 } else { 10720 } else {
10720 return heap->undefined_value(); 10721 return heap->undefined_value();
10721 } 10722 }
10722 } 10723 }
10723 case INTERCEPTOR: 10724 case INTERCEPTOR:
10724 case TRANSITION: 10725 case TRANSITION:
10725 return heap->undefined_value(); 10726 return heap->undefined_value();
10726 case HANDLER: 10727 case HANDLER:
10727 case NONEXISTENT: 10728 case NONEXISTENT:
10728 UNREACHABLE(); 10729 UNREACHABLE();
(...skipping 4105 matching lines...) Expand 10 before | Expand all | Expand 10 after
14834 // Handle last resort GC and make sure to allow future allocations 14835 // Handle last resort GC and make sure to allow future allocations
14835 // to grow the heap without causing GCs (if possible). 14836 // to grow the heap without causing GCs (if possible).
14836 isolate->counters()->gc_last_resort_from_js()->Increment(); 14837 isolate->counters()->gc_last_resort_from_js()->Increment();
14837 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14838 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14838 "Runtime::PerformGC"); 14839 "Runtime::PerformGC");
14839 } 14840 }
14840 } 14841 }
14841 14842
14842 14843
14843 } } // namespace v8::internal 14844 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698