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 5139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5150 RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsKind) { | 5150 RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsKind) { |
5151 HandleScope scope(isolate); | 5151 HandleScope scope(isolate); |
5152 RUNTIME_ASSERT(args.length() == 2); | 5152 RUNTIME_ASSERT(args.length() == 2); |
5153 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); | 5153 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
5154 CONVERT_ARG_HANDLE_CHECKED(Map, map, 1); | 5154 CONVERT_ARG_HANDLE_CHECKED(Map, map, 1); |
5155 JSObject::TransitionElementsKind(array, map->elements_kind()); | 5155 JSObject::TransitionElementsKind(array, map->elements_kind()); |
5156 return *array; | 5156 return *array; |
5157 } | 5157 } |
5158 | 5158 |
5159 | 5159 |
| 5160 RUNTIME_FUNCTION(MaybeObject*, Runtime_ElementsTransitionAndStoreStrict) { |
| 5161 SealHandleScope scope(isolate); |
| 5162 RUNTIME_ASSERT(args.length() == 4); |
| 5163 |
| 5164 Handle<Object> value = args.at<Object>(0); |
| 5165 Handle<Object> key = args.at<Object>(2); |
| 5166 Handle<Object> object = args.at<Object>(3); |
| 5167 |
| 5168 return Runtime::SetObjectProperty(isolate, |
| 5169 object, |
| 5170 key, |
| 5171 value, |
| 5172 NONE, |
| 5173 kStrictMode); |
| 5174 } |
| 5175 |
| 5176 |
| 5177 RUNTIME_FUNCTION(MaybeObject*, Runtime_ElementsTransitionAndStoreNonStrict) { |
| 5178 SealHandleScope scope(isolate); |
| 5179 RUNTIME_ASSERT(args.length() == 4); |
| 5180 |
| 5181 Handle<Object> value = args.at<Object>(0); |
| 5182 Handle<Object> key = args.at<Object>(2); |
| 5183 Handle<Object> object = args.at<Object>(3); |
| 5184 |
| 5185 return Runtime::SetObjectProperty(isolate, |
| 5186 object, |
| 5187 key, |
| 5188 value, |
| 5189 NONE, |
| 5190 kNonStrictMode); |
| 5191 } |
| 5192 |
| 5193 |
5160 RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) { | 5194 RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) { |
5161 SealHandleScope shs(isolate); | 5195 SealHandleScope shs(isolate); |
5162 RUNTIME_ASSERT(args.length() == 1); | 5196 RUNTIME_ASSERT(args.length() == 1); |
5163 Handle<Object> object = args.at<Object>(0); | 5197 Handle<Object> object = args.at<Object>(0); |
5164 if (object->IsJSObject()) { | 5198 if (object->IsJSObject()) { |
5165 Handle<JSObject> js_object(Handle<JSObject>::cast(object)); | 5199 Handle<JSObject> js_object(Handle<JSObject>::cast(object)); |
5166 ASSERT(!js_object->map()->is_observed()); | 5200 ASSERT(!js_object->map()->is_observed()); |
5167 ElementsKind new_kind = js_object->HasFastHoleyElements() | 5201 ElementsKind new_kind = js_object->HasFastHoleyElements() |
5168 ? FAST_HOLEY_DOUBLE_ELEMENTS | 5202 ? FAST_HOLEY_DOUBLE_ELEMENTS |
5169 : FAST_DOUBLE_ELEMENTS; | 5203 : FAST_DOUBLE_ELEMENTS; |
(...skipping 8826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13996 // Handle last resort GC and make sure to allow future allocations | 14030 // Handle last resort GC and make sure to allow future allocations |
13997 // to grow the heap without causing GCs (if possible). | 14031 // to grow the heap without causing GCs (if possible). |
13998 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14032 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13999 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14033 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14000 "Runtime::PerformGC"); | 14034 "Runtime::PerformGC"); |
14001 } | 14035 } |
14002 } | 14036 } |
14003 | 14037 |
14004 | 14038 |
14005 } } // namespace v8::internal | 14039 } } // namespace v8::internal |
OLD | NEW |