OLD | NEW |
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 Loading... |
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_temp(0, Location::RegisterLocation(R1)); |
| 2300 return locs; |
| 2301 } |
| 2302 |
| 2303 |
| 2304 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2305 Register field = locs()->in(0).reg(); |
| 2306 Register temp = locs()->temp(0).reg(); |
| 2307 Label call_runtime, no_call; |
| 2308 |
| 2309 __ ldr(temp, FieldAddress(field, Field::value_offset())); |
| 2310 __ CompareObject(temp, Object::sentinel(), PP); |
| 2311 __ b(&call_runtime, EQ); |
| 2312 |
| 2313 __ CompareObject(temp, Object::transition_sentinel(), PP); |
| 2314 __ b(&no_call, NE); |
| 2315 |
| 2316 __ Bind(&call_runtime); |
| 2317 __ PushObject(Object::null_object(), PP); // Make room for (unused) result. |
| 2318 __ Push(field); |
| 2319 compiler->GenerateRuntimeCall(token_pos(), |
| 2320 deopt_id(), |
| 2321 kInitStaticFieldRuntimeEntry, |
| 2322 1, |
| 2323 locs()); |
| 2324 __ Drop(2); // Remove argument and result placeholder. |
| 2325 __ Bind(&no_call); |
| 2326 } |
| 2327 |
2292 | 2328 |
2293 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2329 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
2294 bool opt) const { | 2330 bool opt) const { |
2295 const intptr_t kNumInputs = 1; | 2331 const intptr_t kNumInputs = 1; |
2296 const intptr_t kNumTemps = 0; | 2332 const intptr_t kNumTemps = 0; |
2297 LocationSummary* locs = new(isolate) LocationSummary( | 2333 LocationSummary* locs = new(isolate) LocationSummary( |
2298 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2334 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
2299 locs->set_in(0, Location::RegisterLocation(R0)); | 2335 locs->set_in(0, Location::RegisterLocation(R0)); |
2300 locs->set_out(0, Location::RegisterLocation(R0)); | 2336 locs->set_out(0, Location::RegisterLocation(R0)); |
2301 return locs; | 2337 return locs; |
(...skipping 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5442 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 5478 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
5443 #if defined(DEBUG) | 5479 #if defined(DEBUG) |
5444 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 5480 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
5445 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 5481 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
5446 #endif | 5482 #endif |
5447 } | 5483 } |
5448 | 5484 |
5449 } // namespace dart | 5485 } // namespace dart |
5450 | 5486 |
5451 #endif // defined TARGET_ARCH_ARM64 | 5487 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |