Push version 2.2.8 to trunk.
Performance improvements in the x64 and ARM backends.
git-svn-id: http://v8.googlecode.com/svn/trunk@4588 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/runtime.cc b/src/runtime.cc
index 0ac0641..823889a 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7777,29 +7777,23 @@
ASSERT_EQ(3, args.length());
- Handle<Object> object = args.at<Object>(0);
+ CONVERT_ARG_CHECKED(JSObject, object, 0);
Handle<Object> key1 = args.at<Object>(1);
Handle<Object> key2 = args.at<Object>(2);
uint32_t index1, index2;
- // That must be the most common case.
- if (object->IsJSObject()
- && Array::IndexFromObject(*key1, &index1)
- && Array::IndexFromObject(*key2, &index2)) {
- Handle<JSObject> jsobject = Handle<JSObject>::cast(object);
- Handle<Object> tmp1 = GetElement(jsobject, index1);
- Handle<Object> tmp2 = GetElement(jsobject, index2);
-
- SetElement(jsobject, index1, tmp2);
- SetElement(jsobject, index2, tmp1);
- } else {
- Handle<Object> tmp1 = GetProperty(object, key1);
- Handle<Object> tmp2 = GetProperty(object, key2);
-
- SetProperty(object, key1, tmp2, NONE);
- SetProperty(object, key2, tmp1, NONE);
+ if (!Array::IndexFromObject(*key1, &index1)
+ || !Array::IndexFromObject(*key2, &index2)) {
+ return Top::ThrowIllegalOperation();
}
+ Handle<JSObject> jsobject = Handle<JSObject>::cast(object);
+ Handle<Object> tmp1 = GetElement(jsobject, index1);
+ Handle<Object> tmp2 = GetElement(jsobject, index2);
+
+ SetElement(jsobject, index1, tmp2);
+ SetElement(jsobject, index2, tmp1);
+
return Heap::undefined_value();
}
@@ -9762,9 +9756,7 @@
CONVERT_ARG_CHECKED(JSArray, new_compile_info, 0);
CONVERT_ARG_CHECKED(JSArray, shared_info, 1);
- LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info);
-
- return Heap::undefined_value();
+ return LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info);
}
// Connects SharedFunctionInfo to another script.
@@ -9819,9 +9811,7 @@
CONVERT_ARG_CHECKED(JSArray, shared_array, 0);
CONVERT_ARG_CHECKED(JSArray, position_change_array, 1);
- LiveEdit::PatchFunctionPositions(shared_array, position_change_array);
-
- return Heap::undefined_value();
+ return LiveEdit::PatchFunctionPositions(shared_array, position_change_array);
}