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

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

Issue 1388233007: [turbofan] Base JSCreateClosure comparison on location. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 const CreateArgumentsParameters& CreateArgumentsParametersOf( 416 const CreateArgumentsParameters& CreateArgumentsParametersOf(
417 const Operator* op) { 417 const Operator* op) {
418 DCHECK_EQ(IrOpcode::kJSCreateArguments, op->opcode()); 418 DCHECK_EQ(IrOpcode::kJSCreateArguments, op->opcode());
419 return OpParameter<CreateArgumentsParameters>(op); 419 return OpParameter<CreateArgumentsParameters>(op);
420 } 420 }
421 421
422 422
423 bool operator==(CreateClosureParameters const& lhs, 423 bool operator==(CreateClosureParameters const& lhs,
424 CreateClosureParameters const& rhs) { 424 CreateClosureParameters const& rhs) {
425 return lhs.pretenure() == rhs.pretenure() && 425 return lhs.pretenure() == rhs.pretenure() &&
426 lhs.shared_info().is_identical_to(rhs.shared_info()); 426 lhs.shared_info().location() == rhs.shared_info().location();
427 } 427 }
428 428
429 429
430 bool operator!=(CreateClosureParameters const& lhs, 430 bool operator!=(CreateClosureParameters const& lhs,
431 CreateClosureParameters const& rhs) { 431 CreateClosureParameters const& rhs) {
432 return !(lhs == rhs); 432 return !(lhs == rhs);
433 } 433 }
434 434
435 435
436 size_t hash_value(CreateClosureParameters const& p) { 436 size_t hash_value(CreateClosureParameters const& p) {
437 // TODO(mstarzinger): Include hash of the SharedFunctionInfo here. 437 return base::hash_combine(p.pretenure(), p.shared_info().location());
438 base::hash<PretenureFlag> h;
439 return h(p.pretenure());
440 } 438 }
441 439
442 440
443 std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) { 441 std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) {
444 return os << p.pretenure() << ", " << Brief(*p.shared_info()); 442 return os << p.pretenure() << ", " << Brief(*p.shared_info());
445 } 443 }
446 444
447 445
448 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) { 446 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) {
449 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode()); 447 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode());
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 Handle<ScopeInfo>::hash>( // -- 807 Handle<ScopeInfo>::hash>( // --
810 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode 808 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode
811 "JSCreateScriptContext", // name 809 "JSCreateScriptContext", // name
812 1, 1, 1, 1, 1, 2, // counts 810 1, 1, 1, 1, 1, 2, // counts
813 scpope_info); // parameter 811 scpope_info); // parameter
814 } 812 }
815 813
816 } // namespace compiler 814 } // namespace compiler
817 } // namespace internal 815 } // namespace internal
818 } // namespace v8 816 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698