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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 NestedStatement* current = nesting_stack_; | 1204 NestedStatement* current = nesting_stack_; |
1205 int stack_depth = 0; | 1205 int stack_depth = 0; |
1206 int context_length = 0; | 1206 int context_length = 0; |
1207 while (current != NULL) { | 1207 while (current != NULL) { |
1208 current = current->Exit(&stack_depth, &context_length); | 1208 current = current->Exit(&stack_depth, &context_length); |
1209 } | 1209 } |
1210 __ Drop(stack_depth); | 1210 __ Drop(stack_depth); |
1211 } | 1211 } |
1212 | 1212 |
1213 | 1213 |
1214 void FullCodeGenerator::EmitPropertyKey(ObjectLiteralProperty* property) { | |
1215 VisitForStackValue(property->key()); | |
1216 __ InvokeBuiltin(Builtins::TO_NAME, CALL_FUNCTION); | |
1217 __ Push(result_register()); | |
1218 } | |
1219 | |
1220 | |
1221 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { | 1214 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { |
1222 Comment cmnt(masm_, "[ ReturnStatement"); | 1215 Comment cmnt(masm_, "[ ReturnStatement"); |
1223 SetStatementPosition(stmt); | 1216 SetStatementPosition(stmt); |
1224 Expression* expr = stmt->expression(); | 1217 Expression* expr = stmt->expression(); |
1225 VisitForAccumulatorValue(expr); | 1218 VisitForAccumulatorValue(expr); |
1226 EmitUnwindBeforeReturn(); | 1219 EmitUnwindBeforeReturn(); |
1227 EmitReturnSequence(); | 1220 EmitReturnSequence(); |
1228 } | 1221 } |
1229 | 1222 |
1230 | 1223 |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 } | 1819 } |
1827 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1820 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1828 codegen_->scope_ = saved_scope_; | 1821 codegen_->scope_ = saved_scope_; |
1829 } | 1822 } |
1830 | 1823 |
1831 | 1824 |
1832 #undef __ | 1825 #undef __ |
1833 | 1826 |
1834 | 1827 |
1835 } } // namespace v8::internal | 1828 } } // namespace v8::internal |
OLD | NEW |