OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |