OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 Handle<Object> value(constant_properties->get(index+1), isolate); | 282 Handle<Object> value(constant_properties->get(index+1), isolate); |
283 if (value->IsFixedArray()) { | 283 if (value->IsFixedArray()) { |
284 // The value contains the constant_properties of a | 284 // The value contains the constant_properties of a |
285 // simple object or array literal. | 285 // simple object or array literal. |
286 Handle<FixedArray> array = Handle<FixedArray>::cast(value); | 286 Handle<FixedArray> array = Handle<FixedArray>::cast(value); |
287 value = CreateLiteralBoilerplate(isolate, literals, array); | 287 value = CreateLiteralBoilerplate(isolate, literals, array); |
288 if (value.is_null()) return value; | 288 if (value.is_null()) return value; |
289 } | 289 } |
290 Handle<Object> result; | 290 Handle<Object> result; |
291 uint32_t element_index = 0; | 291 uint32_t element_index = 0; |
292 JSReceiver::StoreMode mode = value->IsJSObject() | 292 StoreMode mode = value->IsJSObject() ? FORCE_FIELD : ALLOW_AS_CONSTANT; |
293 ? JSReceiver::FORCE_FIELD | |
294 : JSReceiver::ALLOW_AS_CONSTANT; | |
295 if (key->IsInternalizedString()) { | 293 if (key->IsInternalizedString()) { |
296 if (Handle<String>::cast(key)->AsArrayIndex(&element_index)) { | 294 if (Handle<String>::cast(key)->AsArrayIndex(&element_index)) { |
297 // Array index as string (uint32). | 295 // Array index as string (uint32). |
298 result = JSObject::SetOwnElement( | 296 result = JSObject::SetOwnElement( |
299 boilerplate, element_index, value, kNonStrictMode); | 297 boilerplate, element_index, value, kNonStrictMode); |
300 } else { | 298 } else { |
301 Handle<String> name(String::cast(*key)); | 299 Handle<String> name(String::cast(*key)); |
302 ASSERT(!name->AsArrayIndex(&element_index)); | 300 ASSERT(!name->AsArrayIndex(&element_index)); |
303 result = JSObject::SetLocalPropertyIgnoreAttributes( | 301 result = JSObject::SetLocalPropertyIgnoreAttributes( |
304 boilerplate, name, value, NONE, | 302 boilerplate, name, value, NONE, |
(...skipping 14186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14491 // Handle last resort GC and make sure to allow future allocations | 14489 // Handle last resort GC and make sure to allow future allocations |
14492 // to grow the heap without causing GCs (if possible). | 14490 // to grow the heap without causing GCs (if possible). |
14493 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14491 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14494 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14492 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14495 "Runtime::PerformGC"); | 14493 "Runtime::PerformGC"); |
14496 } | 14494 } |
14497 } | 14495 } |
14498 | 14496 |
14499 | 14497 |
14500 } } // namespace v8::internal | 14498 } } // namespace v8::internal |
OLD | NEW |