Update V8 to r5675 as required by WebKit r70209
Change-Id: Ib10adb470d41ca8c109ead5fc893b880e18d489f
diff --git a/src/handles.cc b/src/handles.cc
index 78a7fcf..8fe29bb 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -175,7 +175,7 @@
// Inobject slack tracking will reclaim redundant inobject space later,
// so we can afford to adjust the estimate generously.
- return estimate + 6;
+ return estimate + 8;
}
@@ -635,8 +635,19 @@
}
+static bool ContainsOnlyValidKeys(Handle<FixedArray> array) {
+ int len = array->length();
+ for (int i = 0; i < len; i++) {
+ Object* e = array->get(i);
+ if (!(e->IsString() || e->IsNumber())) return false;
+ }
+ return true;
+}
+
+
Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
KeyCollectionType type) {
+ USE(ContainsOnlyValidKeys);
Handle<FixedArray> content = Factory::empty_fixed_array();
Handle<JSObject> arguments_boilerplate =
Handle<JSObject>(
@@ -664,6 +675,7 @@
Factory::NewFixedArray(current->NumberOfEnumElements());
current->GetEnumElementKeys(*element_keys);
content = UnionOfKeys(content, element_keys);
+ ASSERT(ContainsOnlyValidKeys(content));
// Add the element keys from the interceptor.
if (current->HasIndexedInterceptor()) {
@@ -671,6 +683,7 @@
GetKeysForIndexedInterceptor(object, current);
if (!result.IsEmpty())
content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
+ ASSERT(ContainsOnlyValidKeys(content));
}
// We can cache the computed property keys if access checks are
@@ -692,6 +705,7 @@
// Compute the property keys and cache them if possible.
content =
UnionOfKeys(content, GetEnumPropertyKeys(current, cache_enum_keys));
+ ASSERT(ContainsOnlyValidKeys(content));
// Add the property keys from the interceptor.
if (current->HasNamedInterceptor()) {
@@ -699,6 +713,7 @@
GetKeysForNamedInterceptor(object, current);
if (!result.IsEmpty())
content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
+ ASSERT(ContainsOnlyValidKeys(content));
}
// If we only want local properties we bail out after the first
@@ -785,15 +800,16 @@
bool CompileLazy(Handle<JSFunction> function,
- Handle<Object> receiver,
ClearExceptionFlag flag) {
if (function->shared()->is_compiled()) {
function->set_code(function->shared()->code());
+ PROFILE(FunctionCreateEvent(*function));
function->shared()->set_code_age(0);
return true;
} else {
- CompilationInfo info(function, 0, receiver);
+ CompilationInfo info(function);
bool result = CompileLazyHelper(&info, flag);
+ ASSERT(!result || function->is_compiled());
PROFILE(FunctionCreateEvent(*function));
return result;
}
@@ -801,15 +817,17 @@
bool CompileLazyInLoop(Handle<JSFunction> function,
- Handle<Object> receiver,
ClearExceptionFlag flag) {
if (function->shared()->is_compiled()) {
function->set_code(function->shared()->code());
+ PROFILE(FunctionCreateEvent(*function));
function->shared()->set_code_age(0);
return true;
} else {
- CompilationInfo info(function, 1, receiver);
+ CompilationInfo info(function);
+ info.MarkAsInLoop();
bool result = CompileLazyHelper(&info, flag);
+ ASSERT(!result || function->is_compiled());
PROFILE(FunctionCreateEvent(*function));
return result;
}