| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 if (array_proto->elements() != heap->empty_fixed_array()) return false; | 304 if (array_proto->elements() != heap->empty_fixed_array()) return false; |
| 305 return array_proto->GetPrototype()->IsNull(); | 305 return array_proto->GetPrototype()->IsNull(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 | 308 |
| 309 MUST_USE_RESULT | 309 MUST_USE_RESULT |
| 310 static inline MaybeObject* EnsureJSArrayWithWritableFastElements( | 310 static inline MaybeObject* EnsureJSArrayWithWritableFastElements( |
| 311 Heap* heap, Object* receiver, Arguments* args, int first_added_arg) { | 311 Heap* heap, Object* receiver, Arguments* args, int first_added_arg) { |
| 312 if (!receiver->IsJSArray()) return NULL; | 312 if (!receiver->IsJSArray()) return NULL; |
| 313 JSArray* array = JSArray::cast(receiver); | 313 JSArray* array = JSArray::cast(receiver); |
| 314 if (array->map()->is_observed()) return NULL; |
| 314 HeapObject* elms = array->elements(); | 315 HeapObject* elms = array->elements(); |
| 315 Map* map = elms->map(); | 316 Map* map = elms->map(); |
| 316 if (map == heap->fixed_array_map()) { | 317 if (map == heap->fixed_array_map()) { |
| 317 if (args == NULL || array->HasFastObjectElements()) return elms; | 318 if (args == NULL || array->HasFastObjectElements()) return elms; |
| 318 } else if (map == heap->fixed_cow_array_map()) { | 319 } else if (map == heap->fixed_cow_array_map()) { |
| 319 MaybeObject* maybe_writable_result = array->EnsureWritableFastElements(); | 320 MaybeObject* maybe_writable_result = array->EnsureWritableFastElements(); |
| 320 if (args == NULL || array->HasFastObjectElements() || | 321 if (args == NULL || array->HasFastObjectElements() || |
| 321 !maybe_writable_result->To(&elms)) { | 322 !maybe_writable_result->To(&elms)) { |
| 322 return maybe_writable_result; | 323 return maybe_writable_result; |
| 323 } | 324 } |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 // ----------------------------------------------------------------------------- | 1097 // ----------------------------------------------------------------------------- |
| 1097 // | 1098 // |
| 1098 | 1099 |
| 1099 | 1100 |
| 1100 // Searches the hidden prototype chain of the given object for the first | 1101 // Searches the hidden prototype chain of the given object for the first |
| 1101 // object that is an instance of the given type. If no such object can | 1102 // object that is an instance of the given type. If no such object can |
| 1102 // be found then Heap::null_value() is returned. | 1103 // be found then Heap::null_value() is returned. |
| 1103 static inline Object* FindHidden(Heap* heap, | 1104 static inline Object* FindHidden(Heap* heap, |
| 1104 Object* object, | 1105 Object* object, |
| 1105 FunctionTemplateInfo* type) { | 1106 FunctionTemplateInfo* type) { |
| 1106 if (object->IsInstanceOf(type)) return object; | 1107 if (type->IsTemplateFor(object)) return object; |
| 1107 Object* proto = object->GetPrototype(heap->isolate()); | 1108 Object* proto = object->GetPrototype(heap->isolate()); |
| 1108 if (proto->IsJSObject() && | 1109 if (proto->IsJSObject() && |
| 1109 JSObject::cast(proto)->map()->is_hidden_prototype()) { | 1110 JSObject::cast(proto)->map()->is_hidden_prototype()) { |
| 1110 return FindHidden(heap, proto, type); | 1111 return FindHidden(heap, proto, type); |
| 1111 } | 1112 } |
| 1112 return heap->null_value(); | 1113 return heap->null_value(); |
| 1113 } | 1114 } |
| 1114 | 1115 |
| 1115 | 1116 |
| 1116 // Returns the holder JSObject if the function can legally be called | 1117 // Returns the holder JSObject if the function can legally be called |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 KeyedLoadIC::GenerateInitialize(masm); | 1344 KeyedLoadIC::GenerateInitialize(masm); |
| 1344 } | 1345 } |
| 1345 | 1346 |
| 1346 | 1347 |
| 1347 static void Generate_KeyedLoadIC_Slow(MacroAssembler* masm) { | 1348 static void Generate_KeyedLoadIC_Slow(MacroAssembler* masm) { |
| 1348 KeyedLoadIC::GenerateRuntimeGetProperty(masm); | 1349 KeyedLoadIC::GenerateRuntimeGetProperty(masm); |
| 1349 } | 1350 } |
| 1350 | 1351 |
| 1351 | 1352 |
| 1352 static void Generate_KeyedLoadIC_Miss(MacroAssembler* masm) { | 1353 static void Generate_KeyedLoadIC_Miss(MacroAssembler* masm) { |
| 1353 KeyedLoadIC::GenerateMiss(masm, MISS); | 1354 KeyedLoadIC::GenerateMiss(masm); |
| 1354 } | 1355 } |
| 1355 | 1356 |
| 1356 | 1357 |
| 1357 static void Generate_KeyedLoadIC_MissForceGeneric(MacroAssembler* masm) { | |
| 1358 KeyedLoadIC::GenerateMiss(masm, MISS_FORCE_GENERIC); | |
| 1359 } | |
| 1360 | |
| 1361 | |
| 1362 static void Generate_KeyedLoadIC_Generic(MacroAssembler* masm) { | 1358 static void Generate_KeyedLoadIC_Generic(MacroAssembler* masm) { |
| 1363 KeyedLoadIC::GenerateGeneric(masm); | 1359 KeyedLoadIC::GenerateGeneric(masm); |
| 1364 } | 1360 } |
| 1365 | 1361 |
| 1366 | 1362 |
| 1367 static void Generate_KeyedLoadIC_String(MacroAssembler* masm) { | 1363 static void Generate_KeyedLoadIC_String(MacroAssembler* masm) { |
| 1368 KeyedLoadIC::GenerateString(masm); | 1364 KeyedLoadIC::GenerateString(masm); |
| 1369 } | 1365 } |
| 1370 | 1366 |
| 1371 | 1367 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 KeyedStoreIC::GenerateGeneric(masm, kNonStrictMode); | 1464 KeyedStoreIC::GenerateGeneric(masm, kNonStrictMode); |
| 1469 } | 1465 } |
| 1470 | 1466 |
| 1471 | 1467 |
| 1472 static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) { | 1468 static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) { |
| 1473 KeyedStoreIC::GenerateGeneric(masm, kStrictMode); | 1469 KeyedStoreIC::GenerateGeneric(masm, kStrictMode); |
| 1474 } | 1470 } |
| 1475 | 1471 |
| 1476 | 1472 |
| 1477 static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { | 1473 static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { |
| 1478 KeyedStoreIC::GenerateMiss(masm, MISS); | 1474 KeyedStoreIC::GenerateMiss(masm); |
| 1479 } | 1475 } |
| 1480 | 1476 |
| 1481 | 1477 |
| 1482 static void Generate_KeyedStoreIC_MissForceGeneric(MacroAssembler* masm) { | |
| 1483 KeyedStoreIC::GenerateMiss(masm, MISS_FORCE_GENERIC); | |
| 1484 } | |
| 1485 | |
| 1486 | |
| 1487 static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { | 1478 static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { |
| 1488 KeyedStoreIC::GenerateSlow(masm); | 1479 KeyedStoreIC::GenerateSlow(masm); |
| 1489 } | 1480 } |
| 1490 | 1481 |
| 1491 | 1482 |
| 1492 static void Generate_KeyedStoreIC_Slow_Strict(MacroAssembler* masm) { | 1483 static void Generate_KeyedStoreIC_Slow_Strict(MacroAssembler* masm) { |
| 1493 KeyedStoreIC::GenerateSlow(masm); | 1484 KeyedStoreIC::GenerateSlow(masm); |
| 1494 } | 1485 } |
| 1495 | 1486 |
| 1496 | 1487 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 } | 1813 } |
| 1823 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1814 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1824 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1815 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1825 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1816 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1826 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1817 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1827 #undef DEFINE_BUILTIN_ACCESSOR_C | 1818 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1828 #undef DEFINE_BUILTIN_ACCESSOR_A | 1819 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1829 | 1820 |
| 1830 | 1821 |
| 1831 } } // namespace v8::internal | 1822 } } // namespace v8::internal |
| OLD | NEW |