| 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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 | 1571 |
| 1572 if (lit->extends() != NULL) { | 1572 if (lit->extends() != NULL) { |
| 1573 VisitForStackValue(lit->extends()); | 1573 VisitForStackValue(lit->extends()); |
| 1574 } else { | 1574 } else { |
| 1575 __ Push(isolate()->factory()->the_hole_value()); | 1575 __ Push(isolate()->factory()->the_hole_value()); |
| 1576 } | 1576 } |
| 1577 | 1577 |
| 1578 if (lit->constructor() != NULL) { | 1578 if (lit->constructor() != NULL) { |
| 1579 VisitForStackValue(lit->constructor()); | 1579 VisitForStackValue(lit->constructor()); |
| 1580 } else { | 1580 } else { |
| 1581 __ Push(isolate()->factory()->undefined_value()); | 1581 Handle<JSFunction> default_constructor = |
| 1582 lit->extends() == NULL ? isolate()->default_constructor_no_super() |
| 1583 : isolate()->default_constructor(); |
| 1584 Handle<SharedFunctionInfo> shared(default_constructor->shared()); |
| 1585 EmitNewClosure(shared, false); |
| 1586 __ Push(result_register()); |
| 1582 } | 1587 } |
| 1583 | 1588 |
| 1584 __ Push(script()); | 1589 __ Push(script()); |
| 1585 __ Push(Smi::FromInt(lit->start_position())); | 1590 __ Push(Smi::FromInt(lit->start_position())); |
| 1586 __ Push(Smi::FromInt(lit->end_position())); | 1591 __ Push(Smi::FromInt(lit->end_position())); |
| 1587 | 1592 |
| 1588 __ CallRuntime(Runtime::kDefineClass, 6); | 1593 __ CallRuntime(Runtime::kDefineClass, 6); |
| 1589 EmitClassDefineProperties(lit); | 1594 EmitClassDefineProperties(lit); |
| 1590 | 1595 |
| 1591 context()->Plug(result_register()); | 1596 context()->Plug(result_register()); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 } | 1756 } |
| 1752 return true; | 1757 return true; |
| 1753 } | 1758 } |
| 1754 #endif // DEBUG | 1759 #endif // DEBUG |
| 1755 | 1760 |
| 1756 | 1761 |
| 1757 #undef __ | 1762 #undef __ |
| 1758 | 1763 |
| 1759 | 1764 |
| 1760 } } // namespace v8::internal | 1765 } } // namespace v8::internal |
| OLD | NEW |