Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: src/hydrogen.cc

Issue 911363002: Revert of new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/globals.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 4263 matching lines...) Expand 10 before | Expand all | Expand 10 after
4274 4274
4275 void HOptimizedGraphBuilder::VisitExpressions(ZoneList<Expression*>* exprs, 4275 void HOptimizedGraphBuilder::VisitExpressions(ZoneList<Expression*>* exprs,
4276 ArgumentsAllowedFlag flag) { 4276 ArgumentsAllowedFlag flag) {
4277 for (int i = 0; i < exprs->length(); ++i) { 4277 for (int i = 0; i < exprs->length(); ++i) {
4278 CHECK_ALIVE(VisitForValue(exprs->at(i), flag)); 4278 CHECK_ALIVE(VisitForValue(exprs->at(i), flag));
4279 } 4279 }
4280 } 4280 }
4281 4281
4282 4282
4283 bool HOptimizedGraphBuilder::BuildGraph() { 4283 bool HOptimizedGraphBuilder::BuildGraph() {
4284 if (IsSubclassConstructor(current_info()->function()->kind())) {
4285 Bailout(kSuperReference);
4286 return false;
4287 }
4288
4289 Scope* scope = current_info()->scope(); 4284 Scope* scope = current_info()->scope();
4290 SetUpScope(scope); 4285 SetUpScope(scope);
4291 4286
4292 // Add an edge to the body entry. This is warty: the graph's start 4287 // Add an edge to the body entry. This is warty: the graph's start
4293 // environment will be used by the Lithium translation as the initial 4288 // environment will be used by the Lithium translation as the initial
4294 // environment on graph entry, but it has now been mutated by the 4289 // environment on graph entry, but it has now been mutated by the
4295 // Hydrogen translation of the instructions in the start block. This 4290 // Hydrogen translation of the instructions in the start block. This
4296 // environment uses values which have not been defined yet. These 4291 // environment uses values which have not been defined yet. These
4297 // Hydrogen instructions will then be replayed by the Lithium 4292 // Hydrogen instructions will then be replayed by the Lithium
4298 // translation, so they cannot have an environment effect. The edge to 4293 // translation, so they cannot have an environment effect. The edge to
(...skipping 3264 matching lines...) Expand 10 before | Expand all | Expand 10 after
7563 adaptor_value, argument_count, descriptor, 7558 adaptor_value, argument_count, descriptor,
7564 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength())); 7559 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
7565 } 7560 }
7566 7561
7567 7562
7568 HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction( 7563 HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction(
7569 Handle<JSFunction> jsfun, int argument_count) { 7564 Handle<JSFunction> jsfun, int argument_count) {
7570 HValue* target = Add<HConstant>(jsfun); 7565 HValue* target = Add<HConstant>(jsfun);
7571 // For constant functions, we try to avoid calling the 7566 // For constant functions, we try to avoid calling the
7572 // argument adaptor and instead call the function directly 7567 // argument adaptor and instead call the function directly
7573 int formal_parameter_count = 7568 int formal_parameter_count = jsfun->shared()->formal_parameter_count();
7574 jsfun->shared()->internal_formal_parameter_count();
7575 bool dont_adapt_arguments = 7569 bool dont_adapt_arguments =
7576 (formal_parameter_count == 7570 (formal_parameter_count ==
7577 SharedFunctionInfo::kDontAdaptArgumentsSentinel); 7571 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
7578 int arity = argument_count - 1; 7572 int arity = argument_count - 1;
7579 bool can_invoke_directly = 7573 bool can_invoke_directly =
7580 dont_adapt_arguments || formal_parameter_count == arity; 7574 dont_adapt_arguments || formal_parameter_count == arity;
7581 if (can_invoke_directly) { 7575 if (can_invoke_directly) {
7582 if (jsfun.is_identical_to(current_info()->closure())) { 7576 if (jsfun.is_identical_to(current_info()->closure())) {
7583 graph()->MarkRecursive(); 7577 graph()->MarkRecursive();
7584 } 7578 }
(...skipping 5917 matching lines...) Expand 10 before | Expand all | Expand 10 after
13502 if (ShouldProduceTraceOutput()) { 13496 if (ShouldProduceTraceOutput()) {
13503 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13497 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13504 } 13498 }
13505 13499
13506 #ifdef DEBUG 13500 #ifdef DEBUG
13507 graph_->Verify(false); // No full verify. 13501 graph_->Verify(false); // No full verify.
13508 #endif 13502 #endif
13509 } 13503 }
13510 13504
13511 } } // namespace v8::internal 13505 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698