| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 ASSERT(args.length() == 1); | 627 ASSERT(args.length() == 1); |
| 628 Object* obj = args[0]; | 628 Object* obj = args[0]; |
| 629 if (!obj->IsJSObject()) return isolate->heap()->null_value(); | 629 if (!obj->IsJSObject()) return isolate->heap()->null_value(); |
| 630 return JSObject::cast(obj)->class_name(); | 630 return JSObject::cast(obj)->class_name(); |
| 631 } | 631 } |
| 632 | 632 |
| 633 | 633 |
| 634 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) { | 634 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) { |
| 635 NoHandleAllocation ha; | 635 NoHandleAllocation ha; |
| 636 ASSERT(args.length() == 1); | 636 ASSERT(args.length() == 1); |
| 637 Object* obj = args[0]; | 637 CONVERT_CHECKED(JSReceiver, input_obj, args[0]); |
| 638 Object* obj = input_obj; |
| 639 // We don't expect access checks to be needed on JSProxy objects. |
| 640 ASSERT(!obj->IsAccessCheckNeeded() || obj->IsJSObject()); |
| 638 do { | 641 do { |
| 642 if (obj->IsAccessCheckNeeded() && |
| 643 !isolate->MayNamedAccess(JSObject::cast(obj), |
| 644 isolate->heap()->Proto_symbol(), |
| 645 v8::ACCESS_GET)) { |
| 646 isolate->ReportFailedAccessCheck(JSObject::cast(obj), v8::ACCESS_GET); |
| 647 return isolate->heap()->undefined_value(); |
| 648 } |
| 639 obj = obj->GetPrototype(); | 649 obj = obj->GetPrototype(); |
| 640 } while (obj->IsJSObject() && | 650 } while (obj->IsJSObject() && |
| 641 JSObject::cast(obj)->map()->is_hidden_prototype()); | 651 JSObject::cast(obj)->map()->is_hidden_prototype()); |
| 642 return obj; | 652 return obj; |
| 643 } | 653 } |
| 644 | 654 |
| 645 | 655 |
| 646 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInPrototypeChain) { | 656 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInPrototypeChain) { |
| 647 NoHandleAllocation ha; | 657 NoHandleAllocation ha; |
| 648 ASSERT(args.length() == 2); | 658 ASSERT(args.length() == 2); |
| (...skipping 12056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12705 } else { | 12715 } else { |
| 12706 // Handle last resort GC and make sure to allow future allocations | 12716 // Handle last resort GC and make sure to allow future allocations |
| 12707 // to grow the heap without causing GCs (if possible). | 12717 // to grow the heap without causing GCs (if possible). |
| 12708 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12718 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 12709 isolate->heap()->CollectAllGarbage(false); | 12719 isolate->heap()->CollectAllGarbage(false); |
| 12710 } | 12720 } |
| 12711 } | 12721 } |
| 12712 | 12722 |
| 12713 | 12723 |
| 12714 } } // namespace v8::internal | 12724 } } // namespace v8::internal |
| OLD | NEW |