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

Side by Side Diff: runtime/vm/code_generator_ia32.cc

Issue 10115053: Assign ids to incoming arguments (to be used in checked mode). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 __ addl(ESP, Immediate(5 * kWordSize)); 1788 __ addl(ESP, Immediate(5 * kWordSize));
1789 __ popl(EAX); 1789 __ popl(EAX);
1790 1790
1791 // EAX: value. 1791 // EAX: value.
1792 __ Bind(&done); 1792 __ Bind(&done);
1793 } 1793 }
1794 1794
1795 1795
1796 void CodeGenerator::GenerateArgumentTypeChecks() { 1796 void CodeGenerator::GenerateArgumentTypeChecks() {
1797 const Function& function = parsed_function_.function(); 1797 const Function& function = parsed_function_.function();
1798 LocalScope* scope = parsed_function_.node_sequence()->scope(); 1798 const SequenceNode& sequence_node = *parsed_function_.node_sequence();
1799 LocalScope* scope = sequence_node.scope();
1799 const int num_fixed_params = function.num_fixed_parameters(); 1800 const int num_fixed_params = function.num_fixed_parameters();
1800 const int num_opt_params = function.num_optional_parameters(); 1801 const int num_opt_params = function.num_optional_parameters();
1801 ASSERT(num_fixed_params + num_opt_params <= scope->num_variables()); 1802 ASSERT(num_fixed_params + num_opt_params <= scope->num_variables());
1802 for (int i = 0; i < num_fixed_params + num_opt_params; i++) { 1803 for (intptr_t i = 0; i < num_fixed_params + num_opt_params; i++) {
1803 LocalVariable* parameter = scope->VariableAt(i); 1804 LocalVariable* parameter = scope->VariableAt(i);
1804 GenerateLoadVariable(EAX, *parameter); 1805 GenerateLoadVariable(EAX, *parameter);
1805 GenerateAssertAssignable(AstNode::kNoId, 1806 GenerateAssertAssignable(sequence_node.ParameterIdAt(i),
1806 parameter->token_index(), 1807 parameter->token_index(),
1807 NULL, 1808 NULL,
1808 parameter->type(), 1809 parameter->type(),
1809 parameter->name()); 1810 parameter->name());
1810 } 1811 }
1811 } 1812 }
1812 1813
1813 1814
1814 void CodeGenerator::GenerateConditionTypeCheck(intptr_t node_id, 1815 void CodeGenerator::GenerateConditionTypeCheck(intptr_t node_id,
1815 intptr_t token_index) { 1816 intptr_t token_index) {
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
2891 const Error& error = Error::Handle( 2892 const Error& error = Error::Handle(
2892 Parser::FormatError(script, token_index, "Error", format, args)); 2893 Parser::FormatError(script, token_index, "Error", format, args));
2893 va_end(args); 2894 va_end(args);
2894 Isolate::Current()->long_jump_base()->Jump(1, error); 2895 Isolate::Current()->long_jump_base()->Jump(1, error);
2895 UNREACHABLE(); 2896 UNREACHABLE();
2896 } 2897 }
2897 2898
2898 } // namespace dart 2899 } // namespace dart
2899 2900
2900 #endif // defined TARGET_ARCH_IA32 2901 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698