| 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 14614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14625 | 14625 |
| 14626 static MaybeObject* ArrayConstructorCommon(Isolate* isolate, | 14626 static MaybeObject* ArrayConstructorCommon(Isolate* isolate, |
| 14627 Handle<JSFunction> constructor, | 14627 Handle<JSFunction> constructor, |
| 14628 Handle<Object> type_info, | 14628 Handle<Object> type_info, |
| 14629 Arguments* caller_args) { | 14629 Arguments* caller_args) { |
| 14630 bool holey = false; | 14630 bool holey = false; |
| 14631 bool can_use_type_feedback = true; | 14631 bool can_use_type_feedback = true; |
| 14632 if (caller_args->length() == 1) { | 14632 if (caller_args->length() == 1) { |
| 14633 Object* argument_one = (*caller_args)[0]; | 14633 Object* argument_one = (*caller_args)[0]; |
| 14634 if (argument_one->IsSmi()) { | 14634 if (argument_one->IsSmi()) { |
| 14635 int value = Smi::cast(argument_one)->value(); | 14635 int len = Smi::cast(argument_one)->value(); |
| 14636 if (value < 0 || value >= JSObject::kInitialMaxFastElementArray) { | 14636 if (len < 0 || len > JSObject::kInitialMaxFastElementArray) { |
| 14637 // the array is a dictionary in this case. | 14637 // the array is a dictionary in this case. |
| 14638 can_use_type_feedback = false; | 14638 can_use_type_feedback = false; |
| 14639 } else if (value != 0) { | 14639 } else if (len != 0) { |
| 14640 holey = true; | 14640 holey = true; |
| 14641 } | 14641 } |
| 14642 } else { | 14642 } else { |
| 14643 // Non-smi length argument produces a dictionary | 14643 // Non-smi length argument produces a dictionary |
| 14644 can_use_type_feedback = false; | 14644 can_use_type_feedback = false; |
| 14645 } | 14645 } |
| 14646 } | 14646 } |
| 14647 | 14647 |
| 14648 JSArray* array; | 14648 JSArray* array; |
| 14649 MaybeObject* maybe_array; | 14649 MaybeObject* maybe_array; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14803 // Handle last resort GC and make sure to allow future allocations | 14803 // Handle last resort GC and make sure to allow future allocations |
| 14804 // to grow the heap without causing GCs (if possible). | 14804 // to grow the heap without causing GCs (if possible). |
| 14805 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14805 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14806 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14806 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14807 "Runtime::PerformGC"); | 14807 "Runtime::PerformGC"); |
| 14808 } | 14808 } |
| 14809 } | 14809 } |
| 14810 | 14810 |
| 14811 | 14811 |
| 14812 } } // namespace v8::internal | 14812 } } // namespace v8::internal |
| OLD | NEW |