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

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

Issue 246303004: Fixes bug where we would occasionally materialize a corrupted object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/locations.h » ('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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 UNREACHABLE(); 2033 UNREACHABLE();
2034 return NULL; 2034 return NULL;
2035 } 2035 }
2036 2036
2037 2037
2038 void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2038 void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2039 UNREACHABLE(); 2039 UNREACHABLE();
2040 } 2040 }
2041 2041
2042 2042
2043 // This function should be kept in sync with
2044 // FlowGraphCompiler::SlowPathEnvironmentFor().
2045 void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots,
2046 intptr_t* cpu_reg_slots) {
2047 for (intptr_t i = 0; i < InputCount(); i++) {
2048 Location loc = LocationAt(i);
2049 if (loc.IsRegister()) {
2050 intptr_t index = cpu_reg_slots[loc.reg()];
2051 ASSERT(index >= 0);
2052 locations_[i] = Location::StackSlot(index);
2053 } else if (loc.IsFpuRegister()) {
2054 intptr_t index = fpu_reg_slots[loc.fpu_reg()];
2055 ASSERT(index >= 0);
2056 Value* value = InputAt(i);
2057 switch (value->definition()->representation()) {
2058 case kUnboxedDouble:
2059 case kUnboxedMint:
2060 locations_[i] = Location::DoubleStackSlot(index);
2061 break;
2062 case kUnboxedFloat32x4:
2063 case kUnboxedInt32x4:
2064 case kUnboxedFloat64x2:
2065 locations_[i] = Location::QuadStackSlot(index);
2066 break;
2067 default:
2068 UNREACHABLE();
2069 }
2070 } else if (loc.IsInvalid()) {
2071 // We currently only perform one iteration of allocation
2072 // sinking, so we do not expect to find materialized objects
2073 // here.
2074 ASSERT(!InputAt(i)->definition()->IsMaterializeObject());
2075 }
2076 }
2077 }
2078
2079
2043 LocationSummary* StoreContextInstr::MakeLocationSummary(bool optimizing) const { 2080 LocationSummary* StoreContextInstr::MakeLocationSummary(bool optimizing) const {
2044 const intptr_t kNumInputs = 1; 2081 const intptr_t kNumInputs = 1;
2045 const intptr_t kNumTemps = 0; 2082 const intptr_t kNumTemps = 0;
2046 LocationSummary* summary = 2083 LocationSummary* summary =
2047 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2084 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2048 summary->set_in(0, Location::RegisterLocation(CTX)); 2085 summary->set_in(0, Location::RegisterLocation(CTX));
2049 return summary; 2086 return summary;
2050 } 2087 }
2051 2088
2052 2089
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
3251 case Token::kTRUNCDIV: return 0; 3288 case Token::kTRUNCDIV: return 0;
3252 case Token::kMOD: return 1; 3289 case Token::kMOD: return 1;
3253 default: UNIMPLEMENTED(); return -1; 3290 default: UNIMPLEMENTED(); return -1;
3254 } 3291 }
3255 } 3292 }
3256 3293
3257 3294
3258 #undef __ 3295 #undef __
3259 3296
3260 } // namespace dart 3297 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698