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

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

Issue 471283002: Runtime support for evaluation of static field initializer expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 2282
2283 __ LoadImmediate(R1, num_context_variables(), PP); 2283 __ LoadImmediate(R1, num_context_variables(), PP);
2284 StubCode* stub_code = compiler->isolate()->stub_code(); 2284 StubCode* stub_code = compiler->isolate()->stub_code();
2285 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); 2285 const ExternalLabel label(stub_code->AllocateContextEntryPoint());
2286 compiler->GenerateCall(token_pos(), 2286 compiler->GenerateCall(token_pos(),
2287 &label, 2287 &label,
2288 RawPcDescriptors::kOther, 2288 RawPcDescriptors::kOther,
2289 locs()); 2289 locs());
2290 } 2290 }
2291 2291
2292 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate,
2293 bool opt) const {
2294 const intptr_t kNumInputs = 1;
2295 const intptr_t kNumTemps = 1;
2296 LocationSummary* locs = new(isolate) LocationSummary(
2297 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2298 locs->set_in(0, Location::RegisterLocation(R0));
2299 locs->set_out(0, Location::RegisterLocation(R0));
2300 locs->set_temp(0, Location::RegisterLocation(R1));
2301 return locs;
2302 }
2303
2304
2305 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2306 Register field = locs()->in(0).reg();
2307 Register temp = locs()->temp(0).reg();
2308 Label call_runtime, no_call;
2309
2310 __ ldr(temp, FieldAddress(field, Field::value_offset()));
2311 __ CompareObject(temp, Object::sentinel(), PP);
2312 __ b(&call_runtime, EQ);
2313
2314 __ CompareObject(temp, Object::transition_sentinel(), PP);
2315 __ b(&no_call, NE);
2316
2317 __ Bind(&call_runtime);
2318 __ PushObject(Object::null_object(), PP); // Make room for (unused) result.
2319 __ Push(field);
2320 compiler->GenerateRuntimeCall(token_pos(),
2321 deopt_id(),
2322 kInitStaticFieldRuntimeEntry,
2323 1,
2324 locs());
2325 __ Drop(2); // Remove argument and result placeholder.
2326 __ Bind(&no_call);
2327 }
2328
2292 2329
2293 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, 2330 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
2294 bool opt) const { 2331 bool opt) const {
2295 const intptr_t kNumInputs = 1; 2332 const intptr_t kNumInputs = 1;
2296 const intptr_t kNumTemps = 0; 2333 const intptr_t kNumTemps = 0;
2297 LocationSummary* locs = new(isolate) LocationSummary( 2334 LocationSummary* locs = new(isolate) LocationSummary(
2298 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2335 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2299 locs->set_in(0, Location::RegisterLocation(R0)); 2336 locs->set_in(0, Location::RegisterLocation(R0));
2300 locs->set_out(0, Location::RegisterLocation(R0)); 2337 locs->set_out(0, Location::RegisterLocation(R0));
2301 return locs; 2338 return locs;
(...skipping 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after
5442 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 5479 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
5443 #if defined(DEBUG) 5480 #if defined(DEBUG)
5444 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); 5481 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP);
5445 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); 5482 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP);
5446 #endif 5483 #endif
5447 } 5484 }
5448 5485
5449 } // namespace dart 5486 } // namespace dart
5450 5487
5451 #endif // defined TARGET_ARCH_ARM64 5488 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698