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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1235883002: [strong] Strong classes can't extend null (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 5 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 | « no previous file | src/full-codegen.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 VisitForValueOrTheHole(expr->extends()); 1555 VisitForValueOrTheHole(expr->extends());
1556 VisitForValue(expr->constructor()); 1556 VisitForValue(expr->constructor());
1557 1557
1558 // Create node to instantiate a new class. 1558 // Create node to instantiate a new class.
1559 Node* constructor = environment()->Pop(); 1559 Node* constructor = environment()->Pop();
1560 Node* extends = environment()->Pop(); 1560 Node* extends = environment()->Pop();
1561 Node* name = environment()->Pop(); 1561 Node* name = environment()->Pop();
1562 Node* script = jsgraph()->Constant(info()->script()); 1562 Node* script = jsgraph()->Constant(info()->script());
1563 Node* start = jsgraph()->Constant(expr->start_position()); 1563 Node* start = jsgraph()->Constant(expr->start_position());
1564 Node* end = jsgraph()->Constant(expr->end_position()); 1564 Node* end = jsgraph()->Constant(expr->end_position());
1565 const Operator* opc = javascript()->CallRuntime(Runtime::kDefineClass, 6); 1565 const Operator* opc = javascript()->CallRuntime(
1566 is_strong(language_mode()) ? Runtime::kDefineClassStrong
1567 : Runtime::kDefineClass,
1568 6);
1566 Node* literal = NewNode(opc, name, extends, constructor, script, start, end); 1569 Node* literal = NewNode(opc, name, extends, constructor, script, start, end);
1567 PrepareFrameState(literal, expr->CreateLiteralId(), 1570 PrepareFrameState(literal, expr->CreateLiteralId(),
1568 OutputFrameStateCombine::Push()); 1571 OutputFrameStateCombine::Push());
1569 1572
1570 // The prototype is ensured to exist by Runtime_DefineClass. No access check 1573 // The prototype is ensured to exist by Runtime_DefineClass. No access check
1571 // is needed here since the constructor is created by the class literal. 1574 // is needed here since the constructor is created by the class literal.
1572 Node* proto = 1575 Node* proto =
1573 BuildLoadObjectField(literal, JSFunction::kPrototypeOrInitialMapOffset); 1576 BuildLoadObjectField(literal, JSFunction::kPrototypeOrInitialMapOffset);
1574 1577
1575 // The class literal and the prototype are both expected on the operand stack 1578 // The class literal and the prototype are both expected on the operand stack
(...skipping 2659 matching lines...) Expand 10 before | Expand all | Expand 10 after
4235 // Phi does not exist yet, introduce one. 4238 // Phi does not exist yet, introduce one.
4236 value = NewPhi(inputs, value, control); 4239 value = NewPhi(inputs, value, control);
4237 value->ReplaceInput(inputs - 1, other); 4240 value->ReplaceInput(inputs - 1, other);
4238 } 4241 }
4239 return value; 4242 return value;
4240 } 4243 }
4241 4244
4242 } // namespace compiler 4245 } // namespace compiler
4243 } // namespace internal 4246 } // namespace internal
4244 } // namespace v8 4247 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698