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 10564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10575 } else { | 10575 } else { |
10576 ASSERT(array->HasFastSmiOrObjectElements() || | 10576 ASSERT(array->HasFastSmiOrObjectElements() || |
10577 array->HasFastDoubleElements()); | 10577 array->HasFastDoubleElements()); |
10578 uint32_t actual_length = static_cast<uint32_t>(array->elements()->length()); | 10578 uint32_t actual_length = static_cast<uint32_t>(array->elements()->length()); |
10579 return *isolate->factory()->NewNumberFromUint(Min(actual_length, length)); | 10579 return *isolate->factory()->NewNumberFromUint(Min(actual_length, length)); |
10580 } | 10580 } |
10581 } | 10581 } |
10582 | 10582 |
10583 | 10583 |
10584 RUNTIME_FUNCTION(MaybeObject*, Runtime_LookupAccessor) { | 10584 RUNTIME_FUNCTION(MaybeObject*, Runtime_LookupAccessor) { |
10585 SealHandleScope shs(isolate); | 10585 HandleScope scope(isolate); |
10586 ASSERT(args.length() == 3); | 10586 ASSERT(args.length() == 3); |
10587 CONVERT_ARG_CHECKED(JSReceiver, receiver, 0); | 10587 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0); |
10588 CONVERT_ARG_CHECKED(Name, name, 1); | 10588 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
10589 CONVERT_SMI_ARG_CHECKED(flag, 2); | 10589 CONVERT_SMI_ARG_CHECKED(flag, 2); |
10590 AccessorComponent component = flag == 0 ? ACCESSOR_GETTER : ACCESSOR_SETTER; | 10590 AccessorComponent component = flag == 0 ? ACCESSOR_GETTER : ACCESSOR_SETTER; |
10591 if (!receiver->IsJSObject()) return isolate->heap()->undefined_value(); | 10591 if (!receiver->IsJSObject()) return isolate->heap()->undefined_value(); |
10592 return JSObject::cast(receiver)->LookupAccessor(name, component); | 10592 Handle<Object> result = |
| 10593 JSObject::GetAccessor(Handle<JSObject>::cast(receiver), name, component); |
| 10594 RETURN_IF_EMPTY_HANDLE(isolate, result); |
| 10595 return *result; |
10593 } | 10596 } |
10594 | 10597 |
10595 | 10598 |
10596 #ifdef ENABLE_DEBUGGER_SUPPORT | 10599 #ifdef ENABLE_DEBUGGER_SUPPORT |
10597 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugBreak) { | 10600 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugBreak) { |
10598 SealHandleScope shs(isolate); | 10601 SealHandleScope shs(isolate); |
10599 ASSERT(args.length() == 0); | 10602 ASSERT(args.length() == 0); |
10600 return Execution::DebugBreakHelper(isolate); | 10603 return Execution::DebugBreakHelper(isolate); |
10601 } | 10604 } |
10602 | 10605 |
(...skipping 4194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14797 // Handle last resort GC and make sure to allow future allocations | 14800 // Handle last resort GC and make sure to allow future allocations |
14798 // to grow the heap without causing GCs (if possible). | 14801 // to grow the heap without causing GCs (if possible). |
14799 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14802 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14800 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14803 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14801 "Runtime::PerformGC"); | 14804 "Runtime::PerformGC"); |
14802 } | 14805 } |
14803 } | 14806 } |
14804 | 14807 |
14805 | 14808 |
14806 } } // namespace v8::internal | 14809 } } // namespace v8::internal |
OLD | NEW |