| Index: src/handles.cc
|
| ===================================================================
|
| --- src/handles.cc (revision 8778)
|
| +++ src/handles.cc (working copy)
|
| @@ -422,43 +422,18 @@
|
|
|
|
|
| Handle<Object> GetHiddenProperties(Handle<JSObject> obj,
|
| - bool create_if_needed) {
|
| - Isolate* isolate = obj->GetIsolate();
|
| - Object* holder = obj->BypassGlobalProxy();
|
| - if (holder->IsUndefined()) return isolate->factory()->undefined_value();
|
| - obj = Handle<JSObject>(JSObject::cast(holder), isolate);
|
| + JSObject::HiddenPropertiesFlag flag) {
|
| + CALL_HEAP_FUNCTION(obj->GetIsolate(),
|
| + obj->GetHiddenProperties(flag),
|
| + Object);
|
| +}
|
|
|
| - if (obj->HasFastProperties()) {
|
| - // If the object has fast properties, check whether the first slot
|
| - // in the descriptor array matches the hidden symbol. Since the
|
| - // hidden symbols hash code is zero (and no other string has hash
|
| - // code zero) it will always occupy the first entry if present.
|
| - DescriptorArray* descriptors = obj->map()->instance_descriptors();
|
| - if ((descriptors->number_of_descriptors() > 0) &&
|
| - (descriptors->GetKey(0) == isolate->heap()->hidden_symbol()) &&
|
| - descriptors->IsProperty(0)) {
|
| - ASSERT(descriptors->GetType(0) == FIELD);
|
| - return Handle<Object>(obj->FastPropertyAt(descriptors->GetFieldIndex(0)),
|
| - isolate);
|
| - }
|
| - }
|
|
|
| - // Only attempt to find the hidden properties in the local object and not
|
| - // in the prototype chain. Note that HasLocalProperty() can cause a GC in
|
| - // the general case in the presence of interceptors.
|
| - if (!obj->HasHiddenPropertiesObject()) {
|
| - // Hidden properties object not found. Allocate a new hidden properties
|
| - // object if requested. Otherwise return the undefined value.
|
| - if (create_if_needed) {
|
| - Handle<Object> hidden_obj =
|
| - isolate->factory()->NewJSObject(isolate->object_function());
|
| - CALL_HEAP_FUNCTION(isolate,
|
| - obj->SetHiddenPropertiesObject(*hidden_obj), Object);
|
| - } else {
|
| - return isolate->factory()->undefined_value();
|
| - }
|
| - }
|
| - return Handle<Object>(obj->GetHiddenPropertiesObject(), isolate);
|
| +int GetIdentityHash(Handle<JSObject> obj) {
|
| + CALL_AND_RETRY(obj->GetIsolate(),
|
| + obj->GetIdentityHash(JSObject::ALLOW_CREATION),
|
| + return Smi::cast(__object__)->value(),
|
| + return 0);
|
| }
|
|
|
|
|
| @@ -543,11 +518,6 @@
|
| // associated with the wrapper and get rid of both the wrapper and the
|
| // handle.
|
| static void ClearWrapperCache(Persistent<v8::Value> handle, void*) {
|
| -#ifdef ENABLE_HEAP_PROTECTION
|
| - // Weak reference callbacks are called as if from outside V8. We
|
| - // need to reeenter to unprotect the heap.
|
| - VMState state(OTHER);
|
| -#endif
|
| Handle<Object> cache = Utils::OpenHandle(*handle);
|
| JSValue* wrapper = JSValue::cast(*cache);
|
| Foreign* foreign = Script::cast(wrapper->value())->wrapper();
|
| @@ -913,6 +883,15 @@
|
| }
|
|
|
|
|
| +Handle<ObjectHashTable> PutIntoObjectHashTable(Handle<ObjectHashTable> table,
|
| + Handle<JSObject> key,
|
| + Handle<Object> value) {
|
| + CALL_HEAP_FUNCTION(table->GetIsolate(),
|
| + table->Put(*key, *value),
|
| + ObjectHashTable);
|
| +}
|
| +
|
| +
|
| bool EnsureCompiled(Handle<SharedFunctionInfo> shared,
|
| ClearExceptionFlag flag) {
|
| return shared->is_compiled() || CompileLazyShared(shared, flag);
|
|
|