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

Side by Side Diff: src/runtime.cc

Issue 27070002: Handlify JSObject::SetObserved (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cr changes 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 14548 matching lines...) Expand 10 before | Expand all | Expand 10 after
14559 Object* proto = obj->GetPrototype(); 14559 Object* proto = obj->GetPrototype();
14560 if (proto->IsNull()) return isolate->heap()->false_value(); 14560 if (proto->IsNull()) return isolate->heap()->false_value();
14561 ASSERT(proto->IsJSGlobalObject()); 14561 ASSERT(proto->IsJSGlobalObject());
14562 obj = JSReceiver::cast(proto); 14562 obj = JSReceiver::cast(proto);
14563 } 14563 }
14564 return isolate->heap()->ToBoolean(obj->map()->is_observed()); 14564 return isolate->heap()->ToBoolean(obj->map()->is_observed());
14565 } 14565 }
14566 14566
14567 14567
14568 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) { 14568 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) {
14569 SealHandleScope shs(isolate); 14569 HandleScope scope(isolate);
14570 ASSERT(args.length() == 1); 14570 ASSERT(args.length() == 1);
14571 CONVERT_ARG_CHECKED(JSReceiver, obj, 0); 14571 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
14572 if (obj->IsJSGlobalProxy()) { 14572 if (obj->IsJSGlobalProxy()) {
14573 Object* proto = obj->GetPrototype(); 14573 Object* proto = obj->GetPrototype();
14574 if (proto->IsNull()) return isolate->heap()->undefined_value(); 14574 if (proto->IsNull()) return isolate->heap()->undefined_value();
14575 ASSERT(proto->IsJSGlobalObject()); 14575 ASSERT(proto->IsJSGlobalObject());
14576 obj = JSReceiver::cast(proto); 14576 obj = handle(JSReceiver::cast(proto));
14577 } 14577 }
14578 if (obj->IsJSProxy()) 14578 if (obj->IsJSProxy())
14579 return isolate->heap()->undefined_value(); 14579 return isolate->heap()->undefined_value();
14580 14580
14581 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() && 14581 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() &&
14582 JSObject::cast(obj)->HasFastElements())); 14582 Handle<JSObject>::cast(obj)->HasFastElements()));
14583 ASSERT(obj->IsJSObject()); 14583 ASSERT(obj->IsJSObject());
14584 return JSObject::cast(obj)->SetObserved(isolate); 14584 JSObject::SetObserved(Handle<JSObject>::cast(obj));
14585 return isolate->heap()->undefined_value();
14585 } 14586 }
14586 14587
14587 14588
14588 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) { 14589 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) {
14589 SealHandleScope shs(isolate); 14590 SealHandleScope shs(isolate);
14590 ASSERT(args.length() == 0); 14591 ASSERT(args.length() == 0);
14591 isolate->set_observer_delivery_pending(true); 14592 isolate->set_observer_delivery_pending(true);
14592 return isolate->heap()->undefined_value(); 14593 return isolate->heap()->undefined_value();
14593 } 14594 }
14594 14595
(...skipping 239 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