Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index ed3527fa9202cb9977101725598cec30b3af1bba..37eaf29c73986a289f400cb046ec8f7d72067b93 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -5230,6 +5230,40 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsKind) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) { |
+ SealHandleScope shs(isolate); |
+ RUNTIME_ASSERT(args.length() == 1); |
+ Handle<Object> object = args.at<Object>(0); |
+ if (object->IsJSObject()) { |
+ Handle<JSObject> js_object(Handle<JSObject>::cast(object)); |
+ ASSERT(!js_object->map()->is_observed()); |
+ ElementsKind new_kind = js_object->HasFastHoleyElements() |
+ ? FAST_HOLEY_DOUBLE_ELEMENTS |
+ : FAST_DOUBLE_ELEMENTS; |
+ return TransitionElements(object, new_kind, isolate); |
+ } else { |
+ return *object; |
+ } |
+} |
+ |
+ |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsDoubleToObject) { |
+ SealHandleScope shs(isolate); |
+ RUNTIME_ASSERT(args.length() == 1); |
+ Handle<Object> object = args.at<Object>(0); |
+ if (object->IsJSObject()) { |
+ Handle<JSObject> js_object(Handle<JSObject>::cast(object)); |
+ ASSERT(!js_object->map()->is_observed()); |
+ ElementsKind new_kind = js_object->HasFastHoleyElements() |
+ ? FAST_HOLEY_ELEMENTS |
+ : FAST_ELEMENTS; |
+ return TransitionElements(object, new_kind, isolate); |
+ } else { |
+ return *object; |
+ } |
+} |
+ |
+ |
// 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. |
@@ -12887,7 +12921,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) { |
RUNTIME_ASSERT(script_wrapper->value()->IsScript()); |
Handle<Script> script(Script::cast(script_wrapper->value())); |
- int compilation_state = script->compilation_state(); |
+ int compilation_state = Smi::cast(script->compilation_state())->value(); |
RUNTIME_ASSERT(compilation_state == Script::COMPILATION_STATE_INITIAL); |
script->set_source(*source); |