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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 | 8 |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 } | 496 } |
497 | 497 |
498 | 498 |
499 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 499 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
500 UNIMPLEMENTED(); | 500 UNIMPLEMENTED(); |
501 } | 501 } |
502 | 502 |
503 | 503 |
504 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 504 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
505 // Deep-copy the literal boilerplate. | 505 // Deep-copy the literal boilerplate. |
506 expr->BuildConstantElements(isolate()); | |
507 builder() | 506 builder() |
508 ->LoadLiteral(expr->constant_elements()) | 507 ->LoadLiteral(expr->constant_elements()) |
509 .CreateArrayLiteral(expr->literal_index(), expr->ComputeFlags(true)); | 508 .CreateArrayLiteral(expr->literal_index(), expr->ComputeFlags(true)); |
510 | 509 |
511 TemporaryRegisterScope temporary_register_scope(builder()); | 510 TemporaryRegisterScope temporary_register_scope(builder()); |
512 Register index, literal_array; | 511 Register index, literal_array; |
513 | 512 |
514 // Create nodes to evaluate all the non-constant subexpressions and to store | 513 // Create nodes to evaluate all the non-constant subexpressions and to store |
515 // them into the newly cloned array. | 514 // them into the newly cloned array. |
516 bool literal_array_in_accumulator = true; | 515 bool literal_array_in_accumulator = true; |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 } | 988 } |
990 | 989 |
991 | 990 |
992 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 991 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
993 return info()->feedback_vector()->GetIndex(slot); | 992 return info()->feedback_vector()->GetIndex(slot); |
994 } | 993 } |
995 | 994 |
996 } // namespace interpreter | 995 } // namespace interpreter |
997 } // namespace internal | 996 } // namespace internal |
998 } // namespace v8 | 997 } // namespace v8 |
OLD | NEW |