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/parser.h" | 5 #include "src/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/ast-literal-reindexer.h" | 9 #include "src/ast-literal-reindexer.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 6029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6040 } | 6040 } |
6041 UNREACHABLE(); | 6041 UNREACHABLE(); |
6042 } | 6042 } |
6043 | 6043 |
6044 | 6044 |
6045 Expression* Parser::SpreadCall(Expression* function, | 6045 Expression* Parser::SpreadCall(Expression* function, |
6046 ZoneList<v8::internal::Expression*>* args, | 6046 ZoneList<v8::internal::Expression*>* args, |
6047 int pos) { | 6047 int pos) { |
6048 if (function->IsSuperCallReference()) { | 6048 if (function->IsSuperCallReference()) { |
6049 // Super calls | 6049 // Super calls |
6050 // %ReflectConstruct(%GetPrototype(<this-function>), args, new.target)) | 6050 // %reflect_construct(%GetPrototype(<this-function>), args, new.target)) |
6051 ZoneList<Expression*>* tmp = new (zone()) ZoneList<Expression*>(1, zone()); | 6051 ZoneList<Expression*>* tmp = new (zone()) ZoneList<Expression*>(1, zone()); |
6052 tmp->Add(function->AsSuperCallReference()->this_function_var(), zone()); | 6052 tmp->Add(function->AsSuperCallReference()->this_function_var(), zone()); |
6053 Expression* get_prototype = | 6053 Expression* get_prototype = |
6054 factory()->NewCallRuntime(Runtime::kGetPrototype, tmp, pos); | 6054 factory()->NewCallRuntime(Runtime::kGetPrototype, tmp, pos); |
6055 args->InsertAt(0, get_prototype, zone()); | 6055 args->InsertAt(0, get_prototype, zone()); |
6056 args->Add(function->AsSuperCallReference()->new_target_var(), zone()); | 6056 args->Add(function->AsSuperCallReference()->new_target_var(), zone()); |
6057 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, | 6057 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, |
6058 pos); | 6058 pos); |
6059 } else { | 6059 } else { |
6060 if (function->IsProperty()) { | 6060 if (function->IsProperty()) { |
(...skipping 29 matching lines...) Expand all Loading... |
6090 | 6090 |
6091 Expression* Parser::SpreadCallNew(Expression* function, | 6091 Expression* Parser::SpreadCallNew(Expression* function, |
6092 ZoneList<v8::internal::Expression*>* args, | 6092 ZoneList<v8::internal::Expression*>* args, |
6093 int pos) { | 6093 int pos) { |
6094 args->InsertAt(0, function, zone()); | 6094 args->InsertAt(0, function, zone()); |
6095 | 6095 |
6096 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6096 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
6097 } | 6097 } |
6098 } // namespace internal | 6098 } // namespace internal |
6099 } // namespace v8 | 6099 } // namespace v8 |
OLD | NEW |