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

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

Issue 23788012: Fix an off-by-one error in deoptimization compression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added changes to all platform files. Created 7 years, 3 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 | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 43
44 bool FlowGraphCompiler::SupportsUnboxedMints() { 44 bool FlowGraphCompiler::SupportsUnboxedMints() {
45 // Support unboxed mints when SSE 4.1 is available. 45 // Support unboxed mints when SSE 4.1 is available.
46 return FLAG_unbox_mints && CPUFeatures::sse4_1_supported(); 46 return FLAG_unbox_mints && CPUFeatures::sse4_1_supported();
47 } 47 }
48 48
49 49
50 RawDeoptInfo* CompilerDeoptInfo::CreateDeoptInfo(FlowGraphCompiler* compiler, 50 RawDeoptInfo* CompilerDeoptInfo::CreateDeoptInfo(FlowGraphCompiler* compiler,
51 DeoptInfoBuilder* builder) { 51 DeoptInfoBuilder* builder,
52 const Array& deopt_table) {
52 if (deopt_env_ == NULL) return DeoptInfo::null(); 53 if (deopt_env_ == NULL) return DeoptInfo::null();
53 54
54 intptr_t stack_height = compiler->StackSize(); 55 intptr_t stack_height = compiler->StackSize();
55 AllocateIncomingParametersRecursive(deopt_env_, &stack_height); 56 AllocateIncomingParametersRecursive(deopt_env_, &stack_height);
56 57
57 intptr_t slot_ix = 0; 58 intptr_t slot_ix = 0;
58 Environment* current = deopt_env_; 59 Environment* current = deopt_env_;
59 60
60 // Emit all kMaterializeObject instructions describing objects to be 61 // Emit all kMaterializeObject instructions describing objects to be
61 // materialized on the deoptimization as a prefix to the deoptimization info. 62 // materialized on the deoptimization as a prefix to the deoptimization info.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 ASSERT(previous != NULL); 126 ASSERT(previous != NULL);
126 127
127 // For the outermost environment, set caller PC. 128 // For the outermost environment, set caller PC.
128 builder->AddCallerPc(slot_ix++); 129 builder->AddCallerPc(slot_ix++);
129 130
130 // For the outermost environment, set the incoming arguments. 131 // For the outermost environment, set the incoming arguments.
131 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { 132 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
132 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); 133 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++);
133 } 134 }
134 135
135 const DeoptInfo& deopt_info = DeoptInfo::Handle(builder->CreateDeoptInfo()); 136 const DeoptInfo& deopt_info =
137 DeoptInfo::Handle(builder->CreateDeoptInfo(deopt_table));
136 return deopt_info.raw(); 138 return deopt_info.raw();
137 } 139 }
138 140
139 141
140 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, 142 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
141 intptr_t stub_ix) { 143 intptr_t stub_ix) {
142 // Calls do not need stubs, they share a deoptimization trampoline. 144 // Calls do not need stubs, they share a deoptimization trampoline.
143 ASSERT(reason() != kDeoptAtCall); 145 ASSERT(reason() != kDeoptAtCall);
144 Assembler* assem = compiler->assembler(); 146 Assembler* assem = compiler->assembler();
145 #define __ assem-> 147 #define __ assem->
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 __ movups(reg, Address(ESP, 0)); 1922 __ movups(reg, Address(ESP, 0));
1921 __ addl(ESP, Immediate(kFpuRegisterSize)); 1923 __ addl(ESP, Immediate(kFpuRegisterSize));
1922 } 1924 }
1923 1925
1924 1926
1925 #undef __ 1927 #undef __
1926 1928
1927 } // namespace dart 1929 } // namespace dart
1928 1930
1929 #endif // defined TARGET_ARCH_IA32 1931 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698