| 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 3705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3716 Execution::ToString(key, &has_pending_exception); | 3716 Execution::ToString(key, &has_pending_exception); |
| 3717 if (has_pending_exception) return Failure::Exception(); | 3717 if (has_pending_exception) return Failure::Exception(); |
| 3718 name = Handle<String>::cast(converted); | 3718 name = Handle<String>::cast(converted); |
| 3719 } | 3719 } |
| 3720 | 3720 |
| 3721 // Check if the name is trivially convertible to an index and get | 3721 // Check if the name is trivially convertible to an index and get |
| 3722 // the element if so. | 3722 // the element if so. |
| 3723 if (name->AsArrayIndex(&index)) { | 3723 if (name->AsArrayIndex(&index)) { |
| 3724 return GetElementOrCharAt(isolate, object, index); | 3724 return GetElementOrCharAt(isolate, object, index); |
| 3725 } else { | 3725 } else { |
| 3726 PropertyAttributes attr; | 3726 return object->GetProperty(*name); |
| 3727 return object->GetProperty(*name, &attr); | |
| 3728 } | 3727 } |
| 3729 } | 3728 } |
| 3730 | 3729 |
| 3731 | 3730 |
| 3732 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetProperty) { | 3731 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetProperty) { |
| 3733 NoHandleAllocation ha; | 3732 NoHandleAllocation ha; |
| 3734 ASSERT(args.length() == 2); | 3733 ASSERT(args.length() == 2); |
| 3735 | 3734 |
| 3736 Handle<Object> object = args.at<Object>(0); | 3735 Handle<Object> object = args.at<Object>(0); |
| 3737 Handle<Object> key = args.at<Object>(1); | 3736 Handle<Object> key = args.at<Object>(1); |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4629 switch (instance_type) { | 4628 switch (instance_type) { |
| 4630 case ODDBALL_TYPE: | 4629 case ODDBALL_TYPE: |
| 4631 if (heap_obj->IsTrue() || heap_obj->IsFalse()) { | 4630 if (heap_obj->IsTrue() || heap_obj->IsFalse()) { |
| 4632 return isolate->heap()->boolean_symbol(); | 4631 return isolate->heap()->boolean_symbol(); |
| 4633 } | 4632 } |
| 4634 if (heap_obj->IsNull()) { | 4633 if (heap_obj->IsNull()) { |
| 4635 return isolate->heap()->object_symbol(); | 4634 return isolate->heap()->object_symbol(); |
| 4636 } | 4635 } |
| 4637 ASSERT(heap_obj->IsUndefined()); | 4636 ASSERT(heap_obj->IsUndefined()); |
| 4638 return isolate->heap()->undefined_symbol(); | 4637 return isolate->heap()->undefined_symbol(); |
| 4639 case JS_FUNCTION_TYPE: case JS_REGEXP_TYPE: | 4638 case JS_FUNCTION_TYPE: |
| 4640 return isolate->heap()->function_symbol(); | 4639 return isolate->heap()->function_symbol(); |
| 4641 default: | 4640 default: |
| 4642 // For any kind of object not handled above, the spec rule for | 4641 // For any kind of object not handled above, the spec rule for |
| 4643 // host objects gives that it is okay to return "object" | 4642 // host objects gives that it is okay to return "object" |
| 4644 return isolate->heap()->object_symbol(); | 4643 return isolate->heap()->object_symbol(); |
| 4645 } | 4644 } |
| 4646 } | 4645 } |
| 4647 | 4646 |
| 4648 | 4647 |
| 4649 static bool AreDigits(const char*s, int from, int to) { | 4648 static bool AreDigits(const char*s, int from, int to) { |
| (...skipping 7566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12216 } else { | 12215 } else { |
| 12217 // Handle last resort GC and make sure to allow future allocations | 12216 // Handle last resort GC and make sure to allow future allocations |
| 12218 // to grow the heap without causing GCs (if possible). | 12217 // to grow the heap without causing GCs (if possible). |
| 12219 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12218 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 12220 isolate->heap()->CollectAllGarbage(false); | 12219 isolate->heap()->CollectAllGarbage(false); |
| 12221 } | 12220 } |
| 12222 } | 12221 } |
| 12223 | 12222 |
| 12224 | 12223 |
| 12225 } } // namespace v8::internal | 12224 } } // namespace v8::internal |
| OLD | NEW |