Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/runtime.cc

Issue 23441080: Correct large packed array length limitation (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: make consistent change Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/elements.cc ('k') | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698