Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index e0f507e1774bbd7c7d500994f40a07e74ae8f1e6..6f8fa2e548ba69a449c1d7f435a68302c7e6e0ca 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -4568,6 +4568,34 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetProperty) { |
} |
+MaybeObject* TransitionElements(Handle<Object> object, |
+ ElementsKind to_kind, |
+ Isolate* isolate) { |
+ HandleScope scope(isolate); |
+ if (!object->IsJSObject()) return isolate->ThrowIllegalOperation(); |
+ Handle<Object> result = |
+ TransitionElementsKind(Handle<JSObject>::cast(object), to_kind); |
+ if (result.is_null()) return isolate->ThrowIllegalOperation(); |
+ return *result; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) { |
+ NoHandleAllocation ha; |
+ RUNTIME_ASSERT(args.length() == 1); |
+ Handle<Object> object = args.at<Object>(0); |
+ return TransitionElements(object, FAST_DOUBLE_ELEMENTS, isolate); |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsDoubleToObject) { |
+ NoHandleAllocation ha; |
+ RUNTIME_ASSERT(args.length() == 1); |
+ Handle<Object> object = args.at<Object>(0); |
+ return TransitionElements(object, FAST_ELEMENTS, isolate); |
+} |
+ |
+ |
// Set the native flag on the function. |
// This is used to decide if we should transform null and undefined |
// into the global object when doing call and apply. |