Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 856 } | 856 } |
| 857 } | 857 } |
| 858 } | 858 } |
| 859 | 859 |
| 860 | 860 |
| 861 void FullCodeGenerator::VisitSuperReference(SuperReference* super) { | 861 void FullCodeGenerator::VisitSuperReference(SuperReference* super) { |
| 862 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 862 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
| 863 } | 863 } |
| 864 | 864 |
| 865 | 865 |
| 866 bool FullCodeGenerator::ValidateSuperCall(Call* expr) { | |
| 867 Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); | |
| 868 if (new_target_var == nullptr) { | |
| 869 // TODO(dslomov): this is not exactly correct, the spec requires us | |
| 870 // to execute the constructor and only fail when an assigment to 'this' | |
| 871 // is attempted. Will implement once we have general new.target support, | |
| 872 // but also filed spec bug 3843 to make it an early error. | |
| 873 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | |
| 874 RecordJSReturnSite(expr); | |
| 875 context()->Plug(result_register()); | |
| 876 return false; | |
| 877 } else { | |
|
arv (Not doing code reviews)
2015/02/12 16:49:50
skip else after return?
Dmitry Lomov (no reviews)
2015/02/12 17:34:40
Done.
| |
| 878 return true; | |
| 879 } | |
| 880 } | |
| 881 | |
| 882 | |
| 866 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { | 883 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { |
| 867 if (!info_->is_debug()) { | 884 if (!info_->is_debug()) { |
| 868 CodeGenerator::RecordPositions(masm_, expr->position()); | 885 CodeGenerator::RecordPositions(masm_, expr->position()); |
| 869 } else { | 886 } else { |
| 870 // Check if the expression will be breakable without adding a debug break | 887 // Check if the expression will be breakable without adding a debug break |
| 871 // slot. | 888 // slot. |
| 872 BreakableStatementChecker checker(info_->isolate(), zone()); | 889 BreakableStatementChecker checker(info_->isolate(), zone()); |
| 873 checker.Check(expr); | 890 checker.Check(expr); |
| 874 // Record a statement position right here if the expression is not | 891 // Record a statement position right here if the expression is not |
| 875 // breakable. For breakable expressions the actual recording of the | 892 // breakable. For breakable expressions the actual recording of the |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1829 } | 1846 } |
| 1830 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1847 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
| 1831 codegen_->scope_ = saved_scope_; | 1848 codegen_->scope_ = saved_scope_; |
| 1832 } | 1849 } |
| 1833 | 1850 |
| 1834 | 1851 |
| 1835 #undef __ | 1852 #undef __ |
| 1836 | 1853 |
| 1837 | 1854 |
| 1838 } } // namespace v8::internal | 1855 } } // namespace v8::internal |
| OLD | NEW |