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

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

Issue 8893008: Helper ast node sequences must not wrongly grab ownership of the enclosing (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/opt_code_generator_ia32.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 GenerateCallRuntime(node->id(), 881 GenerateCallRuntime(node->id(),
882 node->token_index(), kCloneContextRuntimeEntry); 882 node->token_index(), kCloneContextRuntimeEntry);
883 __ popl(EAX); 883 __ popl(EAX);
884 __ popl(CTX); // result: cloned context. Set as current context. 884 __ popl(CTX); // result: cloned context. Set as current context.
885 } 885 }
886 886
887 887
888 void CodeGenerator::VisitSequenceNode(SequenceNode* node_sequence) { 888 void CodeGenerator::VisitSequenceNode(SequenceNode* node_sequence) {
889 CodeGeneratorState codegen_state(this); 889 CodeGeneratorState codegen_state(this);
890 LocalScope* scope = node_sequence->scope(); 890 LocalScope* scope = node_sequence->scope();
891 ASSERT(scope != NULL); 891 const intptr_t num_context_variables =
892 intptr_t num_context_variables = scope->num_context_variables(); 892 (scope != NULL) ? scope->num_context_variables() : 0;
893 if (num_context_variables > 0) { 893 if (num_context_variables > 0) {
894 // The loop local scope declares variables that are captured. 894 // The loop local scope declares variables that are captured.
895 // Allocate and chain a new context. 895 // Allocate and chain a new context.
896 __ movl(EDX, Immediate(num_context_variables)); 896 __ movl(EDX, Immediate(num_context_variables));
897 const ExternalLabel label("alloc_context", 897 const ExternalLabel label("alloc_context",
898 StubCode::AllocateContextEntryPoint()); 898 StubCode::AllocateContextEntryPoint());
899 GenerateCall(node_sequence->token_index(), &label); 899 GenerateCall(node_sequence->token_index(), &label);
900 900
901 // Chain the new context in EAX to its parent in CTX. 901 // Chain the new context in EAX to its parent in CTX.
902 __ movl(FieldAddress(EAX, Context::parent_offset()), CTX); 902 __ movl(FieldAddress(EAX, Context::parent_offset()), CTX);
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 message_buffer, kMessageBufferSize, 2743 message_buffer, kMessageBufferSize,
2744 format, args); 2744 format, args);
2745 va_end(args); 2745 va_end(args);
2746 Isolate::Current()->long_jump_base()->Jump(1, message_buffer); 2746 Isolate::Current()->long_jump_base()->Jump(1, message_buffer);
2747 UNREACHABLE(); 2747 UNREACHABLE();
2748 } 2748 }
2749 2749
2750 } // namespace dart 2750 } // namespace dart
2751 2751
2752 #endif // defined TARGET_ARCH_IA32 2752 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/opt_code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698