| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" |
| 7 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
| 8 #include "src/compiler/bytecode-branch-analysis.h" | 9 #include "src/compiler/bytecode-branch-analysis.h" |
| 9 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/operator-properties.h" | 11 #include "src/compiler/operator-properties.h" |
| 11 #include "src/interpreter/bytecodes.h" | 12 #include "src/interpreter/bytecodes.h" |
| 12 #include "src/objects-inl.h" | 13 #include "src/objects-inl.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 namespace compiler { | 17 namespace compiler { |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 const Operator* op = javascript()->CreateLiteralRegExp( | 1004 const Operator* op = javascript()->CreateLiteralRegExp( |
| 1004 constant_pattern, literal_flags, literal_index); | 1005 constant_pattern, literal_flags, literal_index); |
| 1005 BuildCreateLiteral(op); | 1006 BuildCreateLiteral(op); |
| 1006 } | 1007 } |
| 1007 | 1008 |
| 1008 void BytecodeGraphBuilder::VisitCreateArrayLiteral() { | 1009 void BytecodeGraphBuilder::VisitCreateArrayLiteral() { |
| 1009 Handle<FixedArray> constant_elements = Handle<FixedArray>::cast( | 1010 Handle<FixedArray> constant_elements = Handle<FixedArray>::cast( |
| 1010 bytecode_iterator().GetConstantForIndexOperand(0)); | 1011 bytecode_iterator().GetConstantForIndexOperand(0)); |
| 1011 int literal_index = bytecode_iterator().GetIndexOperand(1); | 1012 int literal_index = bytecode_iterator().GetIndexOperand(1); |
| 1012 int literal_flags = bytecode_iterator().GetFlagOperand(2); | 1013 int literal_flags = bytecode_iterator().GetFlagOperand(2); |
| 1014 // Disable allocation site mementos. Only unoptimized code will collect |
| 1015 // feedback about allocation site. Once the code is optimized we expect the |
| 1016 // data to converge. So, we disable allocation site mementos in optimized |
| 1017 // code. We can revisit this when we have data to the contrary. |
| 1018 literal_flags |= ArrayLiteral::kDisableMementos; |
| 1013 int number_of_elements = constant_elements->length(); | 1019 int number_of_elements = constant_elements->length(); |
| 1014 const Operator* op = javascript()->CreateLiteralArray( | 1020 const Operator* op = javascript()->CreateLiteralArray( |
| 1015 constant_elements, literal_flags, literal_index, number_of_elements); | 1021 constant_elements, literal_flags, literal_index, number_of_elements); |
| 1016 BuildCreateLiteral(op); | 1022 BuildCreateLiteral(op); |
| 1017 } | 1023 } |
| 1018 | 1024 |
| 1019 void BytecodeGraphBuilder::VisitCreateObjectLiteral() { | 1025 void BytecodeGraphBuilder::VisitCreateObjectLiteral() { |
| 1020 FrameStateBeforeAndAfter states(this); | 1026 FrameStateBeforeAndAfter states(this); |
| 1021 Handle<FixedArray> constant_properties = Handle<FixedArray>::cast( | 1027 Handle<FixedArray> constant_properties = Handle<FixedArray>::cast( |
| 1022 bytecode_iterator().GetConstantForIndexOperand(0)); | 1028 bytecode_iterator().GetConstantForIndexOperand(0)); |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1962 // Phi does not exist yet, introduce one. | 1968 // Phi does not exist yet, introduce one. |
| 1963 value = NewPhi(inputs, value, control); | 1969 value = NewPhi(inputs, value, control); |
| 1964 value->ReplaceInput(inputs - 1, other); | 1970 value->ReplaceInput(inputs - 1, other); |
| 1965 } | 1971 } |
| 1966 return value; | 1972 return value; |
| 1967 } | 1973 } |
| 1968 | 1974 |
| 1969 } // namespace compiler | 1975 } // namespace compiler |
| 1970 } // namespace internal | 1976 } // namespace internal |
| 1971 } // namespace v8 | 1977 } // namespace v8 |
| OLD | NEW |