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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 args, | 428 args, |
429 first_added_arg, | 429 first_added_arg, |
430 args_length - first_added_arg); | 430 args_length - first_added_arg); |
431 if (maybe_array->IsFailure()) return maybe_array; | 431 if (maybe_array->IsFailure()) return maybe_array; |
432 return array->elements(); | 432 return array->elements(); |
433 } | 433 } |
434 | 434 |
435 | 435 |
436 static inline bool IsJSArrayFastElementMovingAllowed(Heap* heap, | 436 static inline bool IsJSArrayFastElementMovingAllowed(Heap* heap, |
437 JSArray* receiver) { | 437 JSArray* receiver) { |
| 438 if (!FLAG_clever_optimizations) return false; |
438 Context* global_context = heap->isolate()->context()->global_context(); | 439 Context* global_context = heap->isolate()->context()->global_context(); |
439 JSObject* array_proto = | 440 JSObject* array_proto = |
440 JSObject::cast(global_context->array_function()->prototype()); | 441 JSObject::cast(global_context->array_function()->prototype()); |
441 return receiver->GetPrototype() == array_proto && | 442 return receiver->GetPrototype() == array_proto && |
442 ArrayPrototypeHasNoElements(heap, global_context, array_proto); | 443 ArrayPrototypeHasNoElements(heap, global_context, array_proto); |
443 } | 444 } |
444 | 445 |
445 | 446 |
446 MUST_USE_RESULT static MaybeObject* CallJsBuiltin( | 447 MUST_USE_RESULT static MaybeObject* CallJsBuiltin( |
447 Isolate* isolate, | 448 Isolate* isolate, |
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 return Handle<Code>(code_address); \ | 1764 return Handle<Code>(code_address); \ |
1764 } | 1765 } |
1765 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1766 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1766 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1767 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1767 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1768 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1768 #undef DEFINE_BUILTIN_ACCESSOR_C | 1769 #undef DEFINE_BUILTIN_ACCESSOR_C |
1769 #undef DEFINE_BUILTIN_ACCESSOR_A | 1770 #undef DEFINE_BUILTIN_ACCESSOR_A |
1770 | 1771 |
1771 | 1772 |
1772 } } // namespace v8::internal | 1773 } } // namespace v8::internal |
OLD | NEW |