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

Side by Side Diff: vm/code_generator_ia32.cc

Issue 10262033: Fix stack pointer reset bug in entry to catch blocks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | vm/code_generator_x64.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) 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 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 2814
2815 void CodeGenerator::VisitCatchClauseNode(CatchClauseNode* node) { 2815 void CodeGenerator::VisitCatchClauseNode(CatchClauseNode* node) {
2816 // NOTE: The implicit variables ':saved_context', ':exception_var' 2816 // NOTE: The implicit variables ':saved_context', ':exception_var'
2817 // and ':stacktrace_var' can never be captured variables. 2817 // and ':stacktrace_var' can never be captured variables.
2818 // Restore CTX from local variable ':saved_context'. 2818 // Restore CTX from local variable ':saved_context'.
2819 GenerateLoadVariable(CTX, node->context_var()); 2819 GenerateLoadVariable(CTX, node->context_var());
2820 2820
2821 // Restore ESP from EBP as we are coming from a throw and the code for 2821 // Restore ESP from EBP as we are coming from a throw and the code for
2822 // popping arguments has not been run. 2822 // popping arguments has not been run.
2823 ASSERT(locals_space_size() >= 0); 2823 ASSERT(locals_space_size() >= 0);
2824 __ movl(ESP, EBP); 2824 if (locals_space_size() == 0) {
2825 __ subl(ESP, Immediate(locals_space_size())); 2825 __ movl(ESP, EBP);
2826 } else {
2827 __ leal(ESP, Address(EBP, -locals_space_size()));
2828 }
2826 2829
2827 // The JumpToExceptionHandler trampoline code sets up 2830 // The JumpToExceptionHandler trampoline code sets up
2828 // - the exception object in EAX (kExceptionObjectReg) 2831 // - the exception object in EAX (kExceptionObjectReg)
2829 // - the stacktrace object in register EDX (kStackTraceObjectReg) 2832 // - the stacktrace object in register EDX (kStackTraceObjectReg)
2830 // We now setup the exception object and the trace object 2833 // We now setup the exception object and the trace object
2831 // so that the handler code has access to these objects. 2834 // so that the handler code has access to these objects.
2832 GenerateStoreVariable(node->exception_var(), 2835 GenerateStoreVariable(node->exception_var(),
2833 kExceptionObjectReg, 2836 kExceptionObjectReg,
2834 kNoRegister); 2837 kNoRegister);
2835 GenerateStoreVariable(node->stacktrace_var(), 2838 GenerateStoreVariable(node->stacktrace_var(),
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 const Error& error = Error::Handle( 2970 const Error& error = Error::Handle(
2968 Parser::FormatError(script, token_index, "Error", format, args)); 2971 Parser::FormatError(script, token_index, "Error", format, args));
2969 va_end(args); 2972 va_end(args);
2970 Isolate::Current()->long_jump_base()->Jump(1, error); 2973 Isolate::Current()->long_jump_base()->Jump(1, error);
2971 UNREACHABLE(); 2974 UNREACHABLE();
2972 } 2975 }
2973 2976
2974 } // namespace dart 2977 } // namespace dart
2975 2978
2976 #endif // defined TARGET_ARCH_IA32 2979 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | vm/code_generator_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698