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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 elms->address() + to_trim * kPointerSize)); | 378 elms->address() + to_trim * kPointerSize)); |
379 } | 379 } |
380 | 380 |
381 | 381 |
382 static bool ArrayPrototypeHasNoElements(Heap* heap, | 382 static bool ArrayPrototypeHasNoElements(Heap* heap, |
383 Context* global_context, | 383 Context* global_context, |
384 JSObject* array_proto) { | 384 JSObject* array_proto) { |
385 // This method depends on non writability of Object and Array prototype | 385 // This method depends on non writability of Object and Array prototype |
386 // fields. | 386 // fields. |
387 if (array_proto->elements() != heap->empty_fixed_array()) return false; | 387 if (array_proto->elements() != heap->empty_fixed_array()) return false; |
388 // Hidden prototype | |
389 array_proto = JSObject::cast(array_proto->GetPrototype()); | |
390 ASSERT(array_proto->elements() == heap->empty_fixed_array()); | |
391 // Object.prototype | 388 // Object.prototype |
392 Object* proto = array_proto->GetPrototype(); | 389 Object* proto = array_proto->GetPrototype(); |
393 if (proto == heap->null_value()) return false; | 390 if (proto == heap->null_value()) return false; |
394 array_proto = JSObject::cast(proto); | 391 array_proto = JSObject::cast(proto); |
395 if (array_proto != global_context->initial_object_prototype()) return false; | 392 if (array_proto != global_context->initial_object_prototype()) return false; |
396 if (array_proto->elements() != heap->empty_fixed_array()) return false; | 393 if (array_proto->elements() != heap->empty_fixed_array()) return false; |
397 return array_proto->GetPrototype()->IsNull(); | 394 return array_proto->GetPrototype()->IsNull(); |
398 } | 395 } |
399 | 396 |
400 | 397 |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 return Handle<Code>(code_address); \ | 1785 return Handle<Code>(code_address); \ |
1789 } | 1786 } |
1790 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1787 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1791 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1788 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1792 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1789 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1793 #undef DEFINE_BUILTIN_ACCESSOR_C | 1790 #undef DEFINE_BUILTIN_ACCESSOR_C |
1794 #undef DEFINE_BUILTIN_ACCESSOR_A | 1791 #undef DEFINE_BUILTIN_ACCESSOR_A |
1795 | 1792 |
1796 | 1793 |
1797 } } // namespace v8::internal | 1794 } } // namespace v8::internal |
OLD | NEW |