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 4550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4561 | 4561 |
4562 return Runtime::SetObjectProperty(isolate, | 4562 return Runtime::SetObjectProperty(isolate, |
4563 object, | 4563 object, |
4564 key, | 4564 key, |
4565 value, | 4565 value, |
4566 attributes, | 4566 attributes, |
4567 strict_mode); | 4567 strict_mode); |
4568 } | 4568 } |
4569 | 4569 |
4570 | 4570 |
| 4571 MaybeObject* TransitionElements(Handle<Object> object, |
| 4572 ElementsKind to_kind, |
| 4573 Isolate* isolate) { |
| 4574 HandleScope scope(isolate); |
| 4575 if (!object->IsJSObject()) return isolate->ThrowIllegalOperation(); |
| 4576 Handle<Object> result = |
| 4577 TransitionElementsKind(Handle<JSObject>::cast(object), to_kind); |
| 4578 if (result.is_null()) return isolate->ThrowIllegalOperation(); |
| 4579 return *result; |
| 4580 } |
| 4581 |
| 4582 |
| 4583 RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) { |
| 4584 NoHandleAllocation ha; |
| 4585 RUNTIME_ASSERT(args.length() == 1); |
| 4586 Handle<Object> object = args.at<Object>(0); |
| 4587 return TransitionElements(object, FAST_DOUBLE_ELEMENTS, isolate); |
| 4588 } |
| 4589 |
| 4590 |
| 4591 RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsDoubleToObject) { |
| 4592 NoHandleAllocation ha; |
| 4593 RUNTIME_ASSERT(args.length() == 1); |
| 4594 Handle<Object> object = args.at<Object>(0); |
| 4595 return TransitionElements(object, FAST_ELEMENTS, isolate); |
| 4596 } |
| 4597 |
| 4598 |
4571 // Set the native flag on the function. | 4599 // Set the native flag on the function. |
4572 // This is used to decide if we should transform null and undefined | 4600 // This is used to decide if we should transform null and undefined |
4573 // into the global object when doing call and apply. | 4601 // into the global object when doing call and apply. |
4574 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetNativeFlag) { | 4602 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetNativeFlag) { |
4575 NoHandleAllocation ha; | 4603 NoHandleAllocation ha; |
4576 RUNTIME_ASSERT(args.length() == 1); | 4604 RUNTIME_ASSERT(args.length() == 1); |
4577 | 4605 |
4578 Handle<Object> object = args.at<Object>(0); | 4606 Handle<Object> object = args.at<Object>(0); |
4579 | 4607 |
4580 if (object->IsJSFunction()) { | 4608 if (object->IsJSFunction()) { |
(...skipping 8707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13288 } else { | 13316 } else { |
13289 // Handle last resort GC and make sure to allow future allocations | 13317 // Handle last resort GC and make sure to allow future allocations |
13290 // to grow the heap without causing GCs (if possible). | 13318 // to grow the heap without causing GCs (if possible). |
13291 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13319 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13292 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13320 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
13293 } | 13321 } |
13294 } | 13322 } |
13295 | 13323 |
13296 | 13324 |
13297 } } // namespace v8::internal | 13325 } } // namespace v8::internal |
OLD | NEW |