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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 2874453002: [turbofan] Boost performance of Array.prototype.shift by 4x. (Closed)
Patch Set: Cosmetic fixes. Created 3 years, 7 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/compiler/js-builtin-reducer.cc ('k') | src/objects.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/hydrogen.h" 5 #include "src/crankshaft/hydrogen.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 8563 matching lines...) Expand 10 before | Expand all | Expand 10 after
8574 // If there currently can be no elements accessors on the prototype chain, 8574 // If there currently can be no elements accessors on the prototype chain,
8575 // it doesn't mean that there won't be any later. Install a full prototype 8575 // it doesn't mean that there won't be any later. Install a full prototype
8576 // chain check to trap element accessors being installed on the prototype 8576 // chain check to trap element accessors being installed on the prototype
8577 // chain, which would cause elements to go to dictionary mode and result 8577 // chain, which would cause elements to go to dictionary mode and result
8578 // in a map change. 8578 // in a map change.
8579 BuildCheckPrototypeMaps( 8579 BuildCheckPrototypeMaps(
8580 handle(JSObject::cast(receiver_map->prototype()), isolate()), 8580 handle(JSObject::cast(receiver_map->prototype()), isolate()),
8581 Handle<JSObject>::null(), true); 8581 Handle<JSObject>::null(), true);
8582 8582
8583 // Threshold for fast inlined Array.shift(). 8583 // Threshold for fast inlined Array.shift().
8584 HConstant* inline_threshold = Add<HConstant>(static_cast<int32_t>(16)); 8584 HConstant* inline_threshold = Add<HConstant>(JSArray::kMaxCopyElements);
8585 8585
8586 Drop(args_count_no_receiver); 8586 Drop(args_count_no_receiver);
8587 HValue* result; 8587 HValue* result;
8588 HValue* receiver = Pop(); 8588 HValue* receiver = Pop();
8589 HValue* checked_object = AddCheckMap(receiver, receiver_map); 8589 HValue* checked_object = AddCheckMap(receiver, receiver_map);
8590 HValue* length = Add<HLoadNamedField>( 8590 HValue* length = Add<HLoadNamedField>(
8591 receiver, checked_object, HObjectAccess::ForArrayLength(kind)); 8591 receiver, checked_object, HObjectAccess::ForArrayLength(kind));
8592 8592
8593 Drop(1); // Function. 8593 Drop(1); // Function.
8594 { 8594 {
(...skipping 3926 matching lines...) Expand 10 before | Expand all | Expand 10 after
12521 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12521 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12522 } 12522 }
12523 12523
12524 #ifdef DEBUG 12524 #ifdef DEBUG
12525 graph_->Verify(false); // No full verify. 12525 graph_->Verify(false); // No full verify.
12526 #endif 12526 #endif
12527 } 12527 }
12528 12528
12529 } // namespace internal 12529 } // namespace internal
12530 } // namespace v8 12530 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698