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 4473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4484 | 4484 |
4485 | 4485 |
4486 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) { | 4486 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) { |
4487 NoHandleAllocation na; | 4487 NoHandleAllocation na; |
4488 ASSERT(args.length() == 2); | 4488 ASSERT(args.length() == 2); |
4489 | 4489 |
4490 // Only JS receivers can have properties. | 4490 // Only JS receivers can have properties. |
4491 if (args[0]->IsJSReceiver()) { | 4491 if (args[0]->IsJSReceiver()) { |
4492 JSReceiver* receiver = JSReceiver::cast(args[0]); | 4492 JSReceiver* receiver = JSReceiver::cast(args[0]); |
4493 CONVERT_CHECKED(String, key, args[1]); | 4493 CONVERT_CHECKED(String, key, args[1]); |
4494 if (receiver->HasProperty(key)) return isolate->heap()->true_value(); | 4494 bool result = receiver->HasProperty(key); |
| 4495 if (isolate->has_pending_exception()) return Failure::Exception(); |
| 4496 return isolate->heap()->ToBoolean(result); |
4495 } | 4497 } |
4496 return isolate->heap()->false_value(); | 4498 return isolate->heap()->false_value(); |
4497 } | 4499 } |
4498 | 4500 |
4499 | 4501 |
4500 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) { | 4502 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) { |
4501 NoHandleAllocation na; | 4503 NoHandleAllocation na; |
4502 ASSERT(args.length() == 2); | 4504 ASSERT(args.length() == 2); |
4503 | 4505 |
4504 // Only JS objects can have elements. | 4506 // Only JS objects can have elements. |
(...skipping 8370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12875 } else { | 12877 } else { |
12876 // Handle last resort GC and make sure to allow future allocations | 12878 // Handle last resort GC and make sure to allow future allocations |
12877 // to grow the heap without causing GCs (if possible). | 12879 // to grow the heap without causing GCs (if possible). |
12878 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12880 isolate->counters()->gc_last_resort_from_js()->Increment(); |
12879 isolate->heap()->CollectAllGarbage(false); | 12881 isolate->heap()->CollectAllGarbage(false); |
12880 } | 12882 } |
12881 } | 12883 } |
12882 | 12884 |
12883 | 12885 |
12884 } } // namespace v8::internal | 12886 } } // namespace v8::internal |
OLD | NEW |