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

Side by Side Diff: src/hydrogen.cc

Issue 908883002: new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix x64 arithmetic 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
4284 Scope* scope = current_info()->scope(); 4289 Scope* scope = current_info()->scope();
4285 SetUpScope(scope); 4290 SetUpScope(scope);
4286 4291
4287 // Add an edge to the body entry. This is warty: the graph's start 4292 // Add an edge to the body entry. This is warty: the graph's start
4288 // environment will be used by the Lithium translation as the initial 4293 // environment will be used by the Lithium translation as the initial
4289 // environment on graph entry, but it has now been mutated by the 4294 // environment on graph entry, but it has now been mutated by the
4290 // Hydrogen translation of the instructions in the start block. This 4295 // Hydrogen translation of the instructions in the start block. This
4291 // environment uses values which have not been defined yet. These 4296 // environment uses values which have not been defined yet. These
4292 // Hydrogen instructions will then be replayed by the Lithium 4297 // Hydrogen instructions will then be replayed by the Lithium
4293 // translation, so they cannot have an environment effect. The edge to 4298 // translation, so they cannot have an environment effect. The edge to
(...skipping 3264 matching lines...) Expand 10 before | Expand all | Expand 10 after
7558 adaptor_value, argument_count, descriptor, 7563 adaptor_value, argument_count, descriptor,
7559 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength())); 7564 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
7560 } 7565 }
7561 7566
7562 7567
7563 HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction( 7568 HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction(
7564 Handle<JSFunction> jsfun, int argument_count) { 7569 Handle<JSFunction> jsfun, int argument_count) {
7565 HValue* target = Add<HConstant>(jsfun); 7570 HValue* target = Add<HConstant>(jsfun);
7566 // For constant functions, we try to avoid calling the 7571 // For constant functions, we try to avoid calling the
7567 // argument adaptor and instead call the function directly 7572 // argument adaptor and instead call the function directly
7568 int formal_parameter_count = jsfun->shared()->formal_parameter_count(); 7573 int formal_parameter_count =
7574 jsfun->shared()->internal_formal_parameter_count();
7569 bool dont_adapt_arguments = 7575 bool dont_adapt_arguments =
7570 (formal_parameter_count == 7576 (formal_parameter_count ==
7571 SharedFunctionInfo::kDontAdaptArgumentsSentinel); 7577 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
7572 int arity = argument_count - 1; 7578 int arity = argument_count - 1;
7573 bool can_invoke_directly = 7579 bool can_invoke_directly =
7574 dont_adapt_arguments || formal_parameter_count == arity; 7580 dont_adapt_arguments || formal_parameter_count == arity;
7575 if (can_invoke_directly) { 7581 if (can_invoke_directly) {
7576 if (jsfun.is_identical_to(current_info()->closure())) { 7582 if (jsfun.is_identical_to(current_info()->closure())) {
7577 graph()->MarkRecursive(); 7583 graph()->MarkRecursive();
7578 } 7584 }
(...skipping 5917 matching lines...) Expand 10 before | Expand all | Expand 10 after
13496 if (ShouldProduceTraceOutput()) { 13502 if (ShouldProduceTraceOutput()) {
13497 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13503 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13498 } 13504 }
13499 13505
13500 #ifdef DEBUG 13506 #ifdef DEBUG
13501 graph_->Verify(false); // No full verify. 13507 graph_->Verify(false); // No full verify.
13502 #endif 13508 #endif
13503 } 13509 }
13504 13510
13505 } } // namespace v8::internal 13511 } } // 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