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 "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/control-flow-builders.h" | 9 #include "src/interpreter/control-flow-builders.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 set_scope(nullptr); | 466 set_scope(nullptr); |
467 set_info(nullptr); | 467 set_info(nullptr); |
468 return builder_.ToBytecodeArray(); | 468 return builder_.ToBytecodeArray(); |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 void BytecodeGenerator::MakeBytecodeBody() { | 472 void BytecodeGenerator::MakeBytecodeBody() { |
473 // Build the arguments object if it is used. | 473 // Build the arguments object if it is used. |
474 VisitArgumentsObject(scope()->arguments()); | 474 VisitArgumentsObject(scope()->arguments()); |
475 | 475 |
| 476 // TODO(mythria): Build rest arguments array if it is used. |
| 477 int rest_index; |
| 478 if (scope()->rest_parameter(&rest_index)) { |
| 479 UNIMPLEMENTED(); |
| 480 } |
| 481 |
476 // Build assignment to {.this_function} variable if it is used. | 482 // Build assignment to {.this_function} variable if it is used. |
477 VisitThisFunctionVariable(scope()->this_function_var()); | 483 VisitThisFunctionVariable(scope()->this_function_var()); |
478 | 484 |
479 // Build assignment to {new.target} variable if it is used. | 485 // Build assignment to {new.target} variable if it is used. |
480 VisitNewTargetVariable(scope()->new_target_var()); | 486 VisitNewTargetVariable(scope()->new_target_var()); |
481 | 487 |
482 // TODO(rmcilroy): Emit tracing call if requested to do so. | 488 // TODO(rmcilroy): Emit tracing call if requested to do so. |
483 if (FLAG_trace) { | 489 if (FLAG_trace) { |
484 UNIMPLEMENTED(); | 490 UNIMPLEMENTED(); |
485 } | 491 } |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 } | 2223 } |
2218 | 2224 |
2219 | 2225 |
2220 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2226 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2221 return info()->feedback_vector()->GetIndex(slot); | 2227 return info()->feedback_vector()->GetIndex(slot); |
2222 } | 2228 } |
2223 | 2229 |
2224 } // namespace interpreter | 2230 } // namespace interpreter |
2225 } // namespace internal | 2231 } // namespace internal |
2226 } // namespace v8 | 2232 } // namespace v8 |
OLD | NEW |