Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 14541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14552 Object* proto = obj->GetPrototype(); | 14552 Object* proto = obj->GetPrototype(); |
| 14553 if (proto->IsNull()) return isolate->heap()->false_value(); | 14553 if (proto->IsNull()) return isolate->heap()->false_value(); |
| 14554 ASSERT(proto->IsJSGlobalObject()); | 14554 ASSERT(proto->IsJSGlobalObject()); |
| 14555 obj = JSReceiver::cast(proto); | 14555 obj = JSReceiver::cast(proto); |
| 14556 } | 14556 } |
| 14557 return isolate->heap()->ToBoolean(obj->map()->is_observed()); | 14557 return isolate->heap()->ToBoolean(obj->map()->is_observed()); |
| 14558 } | 14558 } |
| 14559 | 14559 |
| 14560 | 14560 |
| 14561 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) { | 14561 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) { |
| 14562 SealHandleScope shs(isolate); | 14562 HandleScope scope(isolate); |
| 14563 ASSERT(args.length() == 1); | 14563 ASSERT(args.length() == 1); |
| 14564 CONVERT_ARG_CHECKED(JSReceiver, obj, 0); | 14564 CONVERT_ARG_CHECKED(JSReceiver, obj, 0); |
|
Michael Starzinger
2013/10/14 16:47:43
Using CONVERT_ARG_HANDLE_CHECKED here will give an
rafaelw
2013/10/15 18:32:17
Done.
| |
| 14565 if (obj->IsJSGlobalProxy()) { | 14565 if (obj->IsJSGlobalProxy()) { |
| 14566 Object* proto = obj->GetPrototype(); | 14566 Object* proto = obj->GetPrototype(); |
| 14567 if (proto->IsNull()) return isolate->heap()->undefined_value(); | 14567 if (proto->IsNull()) return isolate->heap()->undefined_value(); |
| 14568 ASSERT(proto->IsJSGlobalObject()); | 14568 ASSERT(proto->IsJSGlobalObject()); |
| 14569 obj = JSReceiver::cast(proto); | 14569 obj = JSReceiver::cast(proto); |
| 14570 } | 14570 } |
| 14571 if (obj->IsJSProxy()) | 14571 if (obj->IsJSProxy()) |
| 14572 return isolate->heap()->undefined_value(); | 14572 return isolate->heap()->undefined_value(); |
| 14573 | 14573 |
| 14574 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() && | 14574 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() && |
| 14575 JSObject::cast(obj)->HasFastElements())); | 14575 JSObject::cast(obj)->HasFastElements())); |
| 14576 ASSERT(obj->IsJSObject()); | 14576 ASSERT(obj->IsJSObject()); |
| 14577 return JSObject::cast(obj)->SetObserved(isolate); | 14577 Handle<JSObject> js_object(JSObject::cast(obj)); |
| 14578 JSObject::SetObserved(js_object); | |
|
Michael Starzinger
2013/10/14 16:47:43
You can use Handle<JSObject>::cast() here to do th
rafaelw
2013/10/15 18:32:17
Done.
| |
| 14579 return isolate->heap()->undefined_value(); | |
| 14578 } | 14580 } |
| 14579 | 14581 |
| 14580 | 14582 |
| 14581 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) { | 14583 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) { |
| 14582 SealHandleScope shs(isolate); | 14584 SealHandleScope shs(isolate); |
| 14583 ASSERT(args.length() == 0); | 14585 ASSERT(args.length() == 0); |
| 14584 isolate->set_observer_delivery_pending(true); | 14586 isolate->set_observer_delivery_pending(true); |
| 14585 return isolate->heap()->undefined_value(); | 14587 return isolate->heap()->undefined_value(); |
| 14586 } | 14588 } |
| 14587 | 14589 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14827 // Handle last resort GC and make sure to allow future allocations | 14829 // Handle last resort GC and make sure to allow future allocations |
| 14828 // to grow the heap without causing GCs (if possible). | 14830 // to grow the heap without causing GCs (if possible). |
| 14829 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14831 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14830 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14832 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14831 "Runtime::PerformGC"); | 14833 "Runtime::PerformGC"); |
| 14832 } | 14834 } |
| 14833 } | 14835 } |
| 14834 | 14836 |
| 14835 | 14837 |
| 14836 } } // namespace v8::internal | 14838 } } // namespace v8::internal |
| OLD | NEW |