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

Side by Side Diff: src/compiler/js-operator.cc

Issue 2677163003: WIP: type profiling. (Closed)
Patch Set: Rebaseline. Created 3 years, 10 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-operator.h ('k') | src/compiler/opcodes.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/js-operator.h" 5 #include "src/compiler/js-operator.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/lazy-instance.h" 9 #include "src/base/lazy-instance.h"
10 #include "src/compiler/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 size_t hash_value(DataPropertyParameters const& p) { 287 size_t hash_value(DataPropertyParameters const& p) {
288 return base::hash_combine(p.feedback()); 288 return base::hash_combine(p.feedback());
289 } 289 }
290 290
291 std::ostream& operator<<(std::ostream& os, DataPropertyParameters const& p) { 291 std::ostream& operator<<(std::ostream& os, DataPropertyParameters const& p) {
292 return os; 292 return os;
293 } 293 }
294 294
295 DataPropertyParameters const& DataPropertyParametersOf(const Operator* op) { 295 DataPropertyParameters const& DataPropertyParametersOf(const Operator* op) {
296 DCHECK(op->opcode() == IrOpcode::kJSStoreDataPropertyInLiteral); 296 DCHECK(op->opcode() == IrOpcode::kJSStoreDataPropertyInLiteral ||
297 op->opcode() == IrOpcode::kJSCollectTypeProfile);
297 return OpParameter<DataPropertyParameters>(op); 298 return OpParameter<DataPropertyParameters>(op);
298 } 299 }
299 300
300 bool operator==(NamedAccess const& lhs, NamedAccess const& rhs) { 301 bool operator==(NamedAccess const& lhs, NamedAccess const& rhs) {
301 return lhs.name().location() == rhs.name().location() && 302 return lhs.name().location() == rhs.name().location() &&
302 lhs.language_mode() == rhs.language_mode() && 303 lhs.language_mode() == rhs.language_mode() &&
303 lhs.feedback() == rhs.feedback(); 304 lhs.feedback() == rhs.feedback();
304 } 305 }
305 306
306 307
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 const VectorSlotPair& feedback) { 702 const VectorSlotPair& feedback) {
702 DataPropertyParameters parameters(feedback); 703 DataPropertyParameters parameters(feedback);
703 return new (zone()) Operator1<DataPropertyParameters>( // -- 704 return new (zone()) Operator1<DataPropertyParameters>( // --
704 IrOpcode::kJSStoreDataPropertyInLiteral, 705 IrOpcode::kJSStoreDataPropertyInLiteral,
705 Operator::kNoThrow, // opcode 706 Operator::kNoThrow, // opcode
706 "JSStoreDataPropertyInLiteral", // name 707 "JSStoreDataPropertyInLiteral", // name
707 4, 1, 1, 0, 1, 0, // counts 708 4, 1, 1, 0, 1, 0, // counts
708 parameters); // parameter 709 parameters); // parameter
709 } 710 }
710 711
712 const Operator* JSOperatorBuilder::CollectTypeProfile(
713 const VectorSlotPair& feedback) {
714 DataPropertyParameters parameters(feedback);
715 return new (zone()) Operator1<DataPropertyParameters>( // --
716 IrOpcode::kJSCollectTypeProfile,
717 Operator::kNoThrow, // opcode
718 "JSCollectTypeProfile", // name
719 2, 1, 1, 0, 1, 0, // counts
720 parameters); // parameter
721 }
722
711 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { 723 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) {
712 // TODO(turbofan): Cache most important versions of this operator. 724 // TODO(turbofan): Cache most important versions of this operator.
713 return new (zone()) Operator1<ToBooleanHints>( //-- 725 return new (zone()) Operator1<ToBooleanHints>( //--
714 IrOpcode::kJSToBoolean, Operator::kPure, // opcode 726 IrOpcode::kJSToBoolean, Operator::kPure, // opcode
715 "JSToBoolean", // name 727 "JSToBoolean", // name
716 1, 0, 0, 1, 0, 0, // inputs/outputs 728 1, 0, 0, 1, 0, 0, // inputs/outputs
717 hints); // parameter 729 hints); // parameter
718 } 730 }
719 731
720 const Operator* JSOperatorBuilder::CallForwardVarargs( 732 const Operator* JSOperatorBuilder::CallForwardVarargs(
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- 1056 return new (zone()) Operator1<Handle<ScopeInfo>>( // --
1045 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode 1057 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode
1046 "JSCreateScriptContext", // name 1058 "JSCreateScriptContext", // name
1047 1, 1, 1, 1, 1, 2, // counts 1059 1, 1, 1, 1, 1, 2, // counts
1048 scope_info); // parameter 1060 scope_info); // parameter
1049 } 1061 }
1050 1062
1051 } // namespace compiler 1063 } // namespace compiler
1052 } // namespace internal 1064 } // namespace internal
1053 } // namespace v8 1065 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698