OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 MaybeObject* value = (callback->getter)(receiver, callback->data); | 187 MaybeObject* value = (callback->getter)(receiver, callback->data); |
188 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 188 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
189 return value; | 189 return value; |
190 } | 190 } |
191 | 191 |
192 // api style callbacks. | 192 // api style callbacks. |
193 if (structure->IsAccessorInfo()) { | 193 if (structure->IsAccessorInfo()) { |
194 AccessorInfo* data = AccessorInfo::cast(structure); | 194 AccessorInfo* data = AccessorInfo::cast(structure); |
195 Object* fun_obj = data->getter(); | 195 Object* fun_obj = data->getter(); |
196 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); | 196 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); |
197 HandleScope scope; | 197 HandleScope scope(isolate); |
198 JSObject* self = JSObject::cast(receiver); | 198 JSObject* self = JSObject::cast(receiver); |
199 JSObject* holder_handle = JSObject::cast(holder); | 199 JSObject* holder_handle = JSObject::cast(holder); |
200 Handle<String> key(name); | 200 Handle<String> key(name); |
201 LOG(isolate, ApiNamedPropertyAccess("load", self, name)); | 201 LOG(isolate, ApiNamedPropertyAccess("load", self, name)); |
202 CustomArguments args(isolate, data->data(), self, holder_handle); | 202 CustomArguments args(isolate, data->data(), self, holder_handle); |
203 v8::AccessorInfo info(args.end()); | 203 v8::AccessorInfo info(args.end()); |
204 v8::Handle<v8::Value> result; | 204 v8::Handle<v8::Value> result; |
205 { | 205 { |
206 // Leaving JavaScript. | 206 // Leaving JavaScript. |
207 VMState state(isolate, EXTERNAL); | 207 VMState state(isolate, EXTERNAL); |
(...skipping 19 matching lines...) Expand all Loading... |
227 | 227 |
228 UNREACHABLE(); | 228 UNREACHABLE(); |
229 return NULL; | 229 return NULL; |
230 } | 230 } |
231 | 231 |
232 | 232 |
233 MaybeObject* Object::GetPropertyWithHandler(Object* receiver_raw, | 233 MaybeObject* Object::GetPropertyWithHandler(Object* receiver_raw, |
234 String* name_raw, | 234 String* name_raw, |
235 Object* handler_raw) { | 235 Object* handler_raw) { |
236 Isolate* isolate = name_raw->GetIsolate(); | 236 Isolate* isolate = name_raw->GetIsolate(); |
237 HandleScope scope; | 237 HandleScope scope(isolate); |
238 Handle<Object> receiver(receiver_raw); | 238 Handle<Object> receiver(receiver_raw); |
239 Handle<Object> name(name_raw); | 239 Handle<Object> name(name_raw); |
240 Handle<Object> handler(handler_raw); | 240 Handle<Object> handler(handler_raw); |
241 | 241 |
242 // Extract trap function. | 242 // Extract trap function. |
243 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("get"); | 243 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("get"); |
244 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); | 244 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); |
245 if (trap->IsUndefined()) { | 245 if (trap->IsUndefined()) { |
246 // Get the derived `get' property. | 246 // Get the derived `get' property. |
247 trap = isolate->derived_get_trap(); | 247 trap = isolate->derived_get_trap(); |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2171 } | 2171 } |
2172 break; | 2172 break; |
2173 } | 2173 } |
2174 default: { | 2174 default: { |
2175 break; | 2175 break; |
2176 } | 2176 } |
2177 } | 2177 } |
2178 } | 2178 } |
2179 } | 2179 } |
2180 | 2180 |
2181 HandleScope scope; | 2181 Heap* heap = GetHeap(); |
| 2182 HandleScope scope(heap->isolate()); |
2182 Handle<Object> value_handle(value); | 2183 Handle<Object> value_handle(value); |
2183 Heap* heap = GetHeap(); | |
2184 heap->isolate()->ReportFailedAccessCheck(this, v8::ACCESS_SET); | 2184 heap->isolate()->ReportFailedAccessCheck(this, v8::ACCESS_SET); |
2185 return *value_handle; | 2185 return *value_handle; |
2186 } | 2186 } |
2187 | 2187 |
2188 | 2188 |
2189 MaybeObject* JSReceiver::SetProperty(LookupResult* result, | 2189 MaybeObject* JSReceiver::SetProperty(LookupResult* result, |
2190 String* key, | 2190 String* key, |
2191 Object* value, | 2191 Object* value, |
2192 PropertyAttributes attributes, | 2192 PropertyAttributes attributes, |
2193 StrictModeFlag strict_mode) { | 2193 StrictModeFlag strict_mode) { |
2194 if (result->IsFound() && result->type() == HANDLER) { | 2194 if (result->IsFound() && result->type() == HANDLER) { |
2195 return JSProxy::cast(this)->SetPropertyWithHandler( | 2195 return JSProxy::cast(this)->SetPropertyWithHandler( |
2196 key, value, attributes, strict_mode); | 2196 key, value, attributes, strict_mode); |
2197 } else { | 2197 } else { |
2198 return JSObject::cast(this)->SetPropertyForResult( | 2198 return JSObject::cast(this)->SetPropertyForResult( |
2199 result, key, value, attributes, strict_mode); | 2199 result, key, value, attributes, strict_mode); |
2200 } | 2200 } |
2201 } | 2201 } |
2202 | 2202 |
2203 | 2203 |
2204 MUST_USE_RESULT MaybeObject* JSProxy::SetPropertyWithHandler( | 2204 MUST_USE_RESULT MaybeObject* JSProxy::SetPropertyWithHandler( |
2205 String* name_raw, | 2205 String* name_raw, |
2206 Object* value_raw, | 2206 Object* value_raw, |
2207 PropertyAttributes attributes, | 2207 PropertyAttributes attributes, |
2208 StrictModeFlag strict_mode) { | 2208 StrictModeFlag strict_mode) { |
2209 Isolate* isolate = GetIsolate(); | 2209 Isolate* isolate = GetIsolate(); |
2210 HandleScope scope; | 2210 HandleScope scope(isolate); |
2211 Handle<Object> receiver(this); | 2211 Handle<Object> receiver(this); |
2212 Handle<Object> name(name_raw); | 2212 Handle<Object> name(name_raw); |
2213 Handle<Object> value(value_raw); | 2213 Handle<Object> value(value_raw); |
2214 Handle<Object> handler(this->handler()); | 2214 Handle<Object> handler(this->handler()); |
2215 | 2215 |
2216 // Extract trap function. | 2216 // Extract trap function. |
2217 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("set"); | 2217 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("set"); |
2218 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); | 2218 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); |
2219 if (trap->IsUndefined()) { | 2219 if (trap->IsUndefined()) { |
2220 trap = isolate->derived_set_trap(); | 2220 trap = isolate->derived_set_trap(); |
2221 } | 2221 } |
2222 | 2222 |
2223 // Call trap function. | 2223 // Call trap function. |
2224 Object** args[] = { | 2224 Object** args[] = { |
2225 receiver.location(), name.location(), value.location() | 2225 receiver.location(), name.location(), value.location() |
2226 }; | 2226 }; |
2227 bool has_exception; | 2227 bool has_exception; |
2228 Handle<Object> result = | 2228 Handle<Object> result = |
2229 Execution::Call(trap, handler, ARRAY_SIZE(args), args, &has_exception); | 2229 Execution::Call(trap, handler, ARRAY_SIZE(args), args, &has_exception); |
2230 if (has_exception) return Failure::Exception(); | 2230 if (has_exception) return Failure::Exception(); |
2231 | 2231 |
2232 return *value; | 2232 return *value; |
2233 } | 2233 } |
2234 | 2234 |
2235 | 2235 |
| 2236 MUST_USE_RESULT MaybeObject* JSProxy::DeletePropertyWithHandler( |
| 2237 String* name_raw, DeleteMode mode) { |
| 2238 Isolate* isolate = GetIsolate(); |
| 2239 HandleScope scope(isolate); |
| 2240 Handle<Object> receiver(this); |
| 2241 Handle<Object> name(name_raw); |
| 2242 Handle<Object> handler(this->handler()); |
| 2243 |
| 2244 // Extract trap function. |
| 2245 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("delete"); |
| 2246 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); |
| 2247 if (trap->IsUndefined()) { |
| 2248 Handle<Object> args[] = { handler, trap_name }; |
| 2249 Handle<Object> error = isolate->factory()->NewTypeError( |
| 2250 "handler_trap_missing", HandleVector(args, ARRAY_SIZE(args))); |
| 2251 isolate->Throw(*error); |
| 2252 return Failure::Exception(); |
| 2253 } |
| 2254 |
| 2255 // Call trap function. |
| 2256 Object** args[] = { name.location() }; |
| 2257 bool has_exception; |
| 2258 Handle<Object> result = |
| 2259 Execution::Call(trap, handler, ARRAY_SIZE(args), args, &has_exception); |
| 2260 if (has_exception) return Failure::Exception(); |
| 2261 |
| 2262 Object* bool_result = result->ToBoolean(); |
| 2263 if (mode == STRICT_DELETION && bool_result == GetHeap()->false_value()) { |
| 2264 Handle<Object> args[] = { handler, trap_name }; |
| 2265 Handle<Object> error = isolate->factory()->NewTypeError( |
| 2266 "handler_failed", HandleVector(args, ARRAY_SIZE(args))); |
| 2267 isolate->Throw(*error); |
| 2268 return Failure::Exception(); |
| 2269 } |
| 2270 return bool_result; |
| 2271 } |
| 2272 |
| 2273 |
2236 MUST_USE_RESULT PropertyAttributes JSProxy::GetPropertyAttributeWithHandler( | 2274 MUST_USE_RESULT PropertyAttributes JSProxy::GetPropertyAttributeWithHandler( |
2237 JSReceiver* receiver_raw, | 2275 JSReceiver* receiver_raw, |
2238 String* name_raw, | 2276 String* name_raw, |
2239 bool* has_exception) { | 2277 bool* has_exception) { |
2240 Isolate* isolate = GetIsolate(); | 2278 Isolate* isolate = GetIsolate(); |
2241 HandleScope scope; | 2279 HandleScope scope(isolate); |
2242 Handle<JSReceiver> receiver(receiver_raw); | 2280 Handle<JSReceiver> receiver(receiver_raw); |
2243 Handle<Object> name(name_raw); | 2281 Handle<Object> name(name_raw); |
2244 Handle<Object> handler(this->handler()); | 2282 Handle<Object> handler(this->handler()); |
2245 | 2283 |
2246 // Extract trap function. | 2284 // Extract trap function. |
2247 Handle<String> trap_name = | 2285 Handle<String> trap_name = |
2248 isolate->factory()->LookupAsciiSymbol("getPropertyDescriptor"); | 2286 isolate->factory()->LookupAsciiSymbol("getPropertyDescriptor"); |
2249 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); | 2287 Handle<Object> trap(v8::internal::GetProperty(handler, trap_name)); |
2250 if (trap->IsUndefined()) { | 2288 if (trap->IsUndefined()) { |
2251 Handle<Object> args[] = { handler, trap_name }; | 2289 Handle<Object> args[] = { handler, trap_name }; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 accessor_result.holder(), | 2358 accessor_result.holder(), |
2321 strict_mode); | 2359 strict_mode); |
2322 } | 2360 } |
2323 } | 2361 } |
2324 if (!result->IsFound()) { | 2362 if (!result->IsFound()) { |
2325 // Neither properties nor transitions found. | 2363 // Neither properties nor transitions found. |
2326 return AddProperty(name, value, attributes, strict_mode); | 2364 return AddProperty(name, value, attributes, strict_mode); |
2327 } | 2365 } |
2328 if (result->IsReadOnly() && result->IsProperty()) { | 2366 if (result->IsReadOnly() && result->IsProperty()) { |
2329 if (strict_mode == kStrictMode) { | 2367 if (strict_mode == kStrictMode) { |
2330 HandleScope scope; | 2368 HandleScope scope(heap->isolate()); |
2331 Handle<String> key(name); | 2369 Handle<String> key(name); |
2332 Handle<Object> holder(this); | 2370 Handle<Object> holder(this); |
2333 Handle<Object> args[2] = { key, holder }; | 2371 Handle<Object> args[2] = { key, holder }; |
2334 return heap->isolate()->Throw(*heap->isolate()->factory()->NewTypeError( | 2372 return heap->isolate()->Throw(*heap->isolate()->factory()->NewTypeError( |
2335 "strict_read_only_property", HandleVector(args, 2))); | 2373 "strict_read_only_property", HandleVector(args, 2))); |
2336 } else { | 2374 } else { |
2337 return value; | 2375 return value; |
2338 } | 2376 } |
2339 } | 2377 } |
2340 // This is a real property that is not read-only, or it is a | 2378 // This is a real property that is not read-only, or it is a |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 return DeleteFastElement(index); | 3210 return DeleteFastElement(index); |
3173 } | 3211 } |
3174 } | 3212 } |
3175 break; | 3213 break; |
3176 } | 3214 } |
3177 } | 3215 } |
3178 return isolate->heap()->true_value(); | 3216 return isolate->heap()->true_value(); |
3179 } | 3217 } |
3180 | 3218 |
3181 | 3219 |
| 3220 MaybeObject* JSReceiver::DeleteProperty(String* name, DeleteMode mode) { |
| 3221 if (IsJSProxy()) { |
| 3222 return JSProxy::cast(this)->DeletePropertyWithHandler(name, mode); |
| 3223 } else { |
| 3224 return JSObject::cast(this)->DeleteProperty(name, mode); |
| 3225 } |
| 3226 } |
| 3227 |
| 3228 |
3182 MaybeObject* JSObject::DeleteProperty(String* name, DeleteMode mode) { | 3229 MaybeObject* JSObject::DeleteProperty(String* name, DeleteMode mode) { |
3183 Isolate* isolate = GetIsolate(); | 3230 Isolate* isolate = GetIsolate(); |
3184 // ECMA-262, 3rd, 8.6.2.5 | 3231 // ECMA-262, 3rd, 8.6.2.5 |
3185 ASSERT(name->IsString()); | 3232 ASSERT(name->IsString()); |
3186 | 3233 |
3187 // Check access rights if needed. | 3234 // Check access rights if needed. |
3188 if (IsAccessCheckNeeded() && | 3235 if (IsAccessCheckNeeded() && |
3189 !isolate->MayNamedAccess(this, name, v8::ACCESS_DELETE)) { | 3236 !isolate->MayNamedAccess(this, name, v8::ACCESS_DELETE)) { |
3190 isolate->ReportFailedAccessCheck(this, v8::ACCESS_DELETE); | 3237 isolate->ReportFailedAccessCheck(this, v8::ACCESS_DELETE); |
3191 return isolate->heap()->false_value(); | 3238 return isolate->heap()->false_value(); |
(...skipping 4321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7513 int old_size = old_backing->length(); | 7560 int old_size = old_backing->length(); |
7514 int new_size = required_size > old_size ? required_size : old_size; | 7561 int new_size = required_size > old_size ? required_size : old_size; |
7515 Handle<FixedArray> new_backing = FACTORY->NewFixedArray(new_size); | 7562 Handle<FixedArray> new_backing = FACTORY->NewFixedArray(new_size); |
7516 // Can't use this any more now because we may have had a GC! | 7563 // Can't use this any more now because we may have had a GC! |
7517 for (int i = 0; i < old_size; i++) new_backing->set(i, old_backing->get(i)); | 7564 for (int i = 0; i < old_size; i++) new_backing->set(i, old_backing->get(i)); |
7518 self->SetContent(*new_backing); | 7565 self->SetContent(*new_backing); |
7519 } | 7566 } |
7520 | 7567 |
7521 | 7568 |
7522 static Failure* ArrayLengthRangeError(Heap* heap) { | 7569 static Failure* ArrayLengthRangeError(Heap* heap) { |
7523 HandleScope scope; | 7570 HandleScope scope(heap->isolate()); |
7524 return heap->isolate()->Throw( | 7571 return heap->isolate()->Throw( |
7525 *FACTORY->NewRangeError("invalid_array_length", | 7572 *FACTORY->NewRangeError("invalid_array_length", |
7526 HandleVector<Object>(NULL, 0))); | 7573 HandleVector<Object>(NULL, 0))); |
7527 } | 7574 } |
7528 | 7575 |
7529 | 7576 |
7530 MaybeObject* JSObject::SetElementsLength(Object* len) { | 7577 MaybeObject* JSObject::SetElementsLength(Object* len) { |
7531 // We should never end in here with a pixel or external array. | 7578 // We should never end in here with a pixel or external array. |
7532 ASSERT(AllowsSetElementsLength()); | 7579 ASSERT(AllowsSetElementsLength()); |
7533 | 7580 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7711 | 7758 |
7712 // From 8.6.2 Object Internal Methods | 7759 // From 8.6.2 Object Internal Methods |
7713 // ... | 7760 // ... |
7714 // In addition, if [[Extensible]] is false the value of the [[Class]] and | 7761 // In addition, if [[Extensible]] is false the value of the [[Class]] and |
7715 // [[Prototype]] internal properties of the object may not be modified. | 7762 // [[Prototype]] internal properties of the object may not be modified. |
7716 // ... | 7763 // ... |
7717 // Implementation specific extensions that modify [[Class]], [[Prototype]] | 7764 // Implementation specific extensions that modify [[Class]], [[Prototype]] |
7718 // or [[Extensible]] must not violate the invariants defined in the preceding | 7765 // or [[Extensible]] must not violate the invariants defined in the preceding |
7719 // paragraph. | 7766 // paragraph. |
7720 if (!this->map()->is_extensible()) { | 7767 if (!this->map()->is_extensible()) { |
7721 HandleScope scope; | 7768 HandleScope scope(heap->isolate()); |
7722 Handle<Object> handle(this, heap->isolate()); | 7769 Handle<Object> handle(this, heap->isolate()); |
7723 return heap->isolate()->Throw( | 7770 return heap->isolate()->Throw( |
7724 *FACTORY->NewTypeError("non_extensible_proto", | 7771 *FACTORY->NewTypeError("non_extensible_proto", |
7725 HandleVector<Object>(&handle, 1))); | 7772 HandleVector<Object>(&handle, 1))); |
7726 } | 7773 } |
7727 | 7774 |
7728 // Before we can set the prototype we need to be sure | 7775 // Before we can set the prototype we need to be sure |
7729 // prototype cycles are prevented. | 7776 // prototype cycles are prevented. |
7730 // It is sufficient to validate that the receiver is not in the new prototype | 7777 // It is sufficient to validate that the receiver is not in the new prototype |
7731 // chain. | 7778 // chain. |
7732 for (Object* pt = value; pt != heap->null_value(); pt = pt->GetPrototype()) { | 7779 for (Object* pt = value; pt != heap->null_value(); pt = pt->GetPrototype()) { |
7733 if (JSObject::cast(pt) == this) { | 7780 if (JSObject::cast(pt) == this) { |
7734 // Cycle detected. | 7781 // Cycle detected. |
7735 HandleScope scope; | 7782 HandleScope scope(heap->isolate()); |
7736 return heap->isolate()->Throw( | 7783 return heap->isolate()->Throw( |
7737 *FACTORY->NewError("cyclic_proto", HandleVector<Object>(NULL, 0))); | 7784 *FACTORY->NewError("cyclic_proto", HandleVector<Object>(NULL, 0))); |
7738 } | 7785 } |
7739 } | 7786 } |
7740 | 7787 |
7741 JSReceiver* real_receiver = this; | 7788 JSReceiver* real_receiver = this; |
7742 | 7789 |
7743 if (skip_hidden_prototypes) { | 7790 if (skip_hidden_prototypes) { |
7744 // Find the first object in the chain whose prototype object is not | 7791 // Find the first object in the chain whose prototype object is not |
7745 // hidden and set the new prototype on that object. | 7792 // hidden and set the new prototype on that object. |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8505 | 8552 |
8506 | 8553 |
8507 MaybeObject* JSObject::SetElement(uint32_t index, | 8554 MaybeObject* JSObject::SetElement(uint32_t index, |
8508 Object* value, | 8555 Object* value, |
8509 StrictModeFlag strict_mode, | 8556 StrictModeFlag strict_mode, |
8510 bool check_prototype) { | 8557 bool check_prototype) { |
8511 // Check access rights if needed. | 8558 // Check access rights if needed. |
8512 if (IsAccessCheckNeeded()) { | 8559 if (IsAccessCheckNeeded()) { |
8513 Heap* heap = GetHeap(); | 8560 Heap* heap = GetHeap(); |
8514 if (!heap->isolate()->MayIndexedAccess(this, index, v8::ACCESS_SET)) { | 8561 if (!heap->isolate()->MayIndexedAccess(this, index, v8::ACCESS_SET)) { |
8515 HandleScope scope; | 8562 HandleScope scope(heap->isolate()); |
8516 Handle<Object> value_handle(value); | 8563 Handle<Object> value_handle(value); |
8517 heap->isolate()->ReportFailedAccessCheck(this, v8::ACCESS_SET); | 8564 heap->isolate()->ReportFailedAccessCheck(this, v8::ACCESS_SET); |
8518 return *value_handle; | 8565 return *value_handle; |
8519 } | 8566 } |
8520 } | 8567 } |
8521 | 8568 |
8522 if (IsJSGlobalProxy()) { | 8569 if (IsJSGlobalProxy()) { |
8523 Object* proto = GetPrototype(); | 8570 Object* proto = GetPrototype(); |
8524 if (proto->IsNull()) return value; | 8571 if (proto->IsNull()) return value; |
8525 ASSERT(proto->IsJSGlobalObject()); | 8572 ASSERT(proto->IsJSGlobalObject()); |
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11046 } | 11093 } |
11047 } | 11094 } |
11048 | 11095 |
11049 // Update the number of elements. | 11096 // Update the number of elements. |
11050 ElementsRemoved(removed_entries); | 11097 ElementsRemoved(removed_entries); |
11051 } | 11098 } |
11052 | 11099 |
11053 | 11100 |
11054 template<typename Shape, typename Key> | 11101 template<typename Shape, typename Key> |
11055 Object* Dictionary<Shape, Key>::DeleteProperty(int entry, | 11102 Object* Dictionary<Shape, Key>::DeleteProperty(int entry, |
11056 JSObject::DeleteMode mode) { | 11103 JSReceiver::DeleteMode mode) { |
11057 Heap* heap = Dictionary<Shape, Key>::GetHeap(); | 11104 Heap* heap = Dictionary<Shape, Key>::GetHeap(); |
11058 PropertyDetails details = DetailsAt(entry); | 11105 PropertyDetails details = DetailsAt(entry); |
11059 // Ignore attributes if forcing a deletion. | 11106 // Ignore attributes if forcing a deletion. |
11060 if (details.IsDontDelete() && mode != JSObject::FORCE_DELETION) { | 11107 if (details.IsDontDelete() && mode != JSReceiver::FORCE_DELETION) { |
11061 return heap->false_value(); | 11108 return heap->false_value(); |
11062 } | 11109 } |
11063 SetEntry(entry, heap->null_value(), heap->null_value()); | 11110 SetEntry(entry, heap->null_value(), heap->null_value()); |
11064 HashTable<Shape, Key>::ElementRemoved(); | 11111 HashTable<Shape, Key>::ElementRemoved(); |
11065 return heap->true_value(); | 11112 return heap->true_value(); |
11066 } | 11113 } |
11067 | 11114 |
11068 | 11115 |
11069 template<typename Shape, typename Key> | 11116 template<typename Shape, typename Key> |
11070 MaybeObject* Dictionary<Shape, Key>::Shrink(Key key) { | 11117 MaybeObject* Dictionary<Shape, Key>::Shrink(Key key) { |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11689 if (break_point_objects()->IsUndefined()) return 0; | 11736 if (break_point_objects()->IsUndefined()) return 0; |
11690 // Single beak point. | 11737 // Single beak point. |
11691 if (!break_point_objects()->IsFixedArray()) return 1; | 11738 if (!break_point_objects()->IsFixedArray()) return 1; |
11692 // Multiple break points. | 11739 // Multiple break points. |
11693 return FixedArray::cast(break_point_objects())->length(); | 11740 return FixedArray::cast(break_point_objects())->length(); |
11694 } | 11741 } |
11695 #endif | 11742 #endif |
11696 | 11743 |
11697 | 11744 |
11698 } } // namespace v8::internal | 11745 } } // namespace v8::internal |
OLD | NEW |