Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2380 __ LoadImmediate(T1, num_context_variables()); | 2380 __ LoadImmediate(T1, num_context_variables()); |
| 2381 StubCode* stub_code = compiler->isolate()->stub_code(); | 2381 StubCode* stub_code = compiler->isolate()->stub_code(); |
| 2382 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); | 2382 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); |
| 2383 compiler->GenerateCall(token_pos(), | 2383 compiler->GenerateCall(token_pos(), |
| 2384 &label, | 2384 &label, |
| 2385 RawPcDescriptors::kOther, | 2385 RawPcDescriptors::kOther, |
| 2386 locs()); | 2386 locs()); |
| 2387 } | 2387 } |
| 2388 | 2388 |
| 2389 | 2389 |
| 2390 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | |
| 2391 bool opt) const { | |
| 2392 const intptr_t kNumInputs = 1; | |
| 2393 const intptr_t kNumTemps = 1; | |
| 2394 LocationSummary* locs = new(isolate) LocationSummary( | |
| 2395 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | |
| 2396 locs->set_in(0, Location::RegisterLocation(T0)); | |
| 2397 locs->set_out(0, Location::RegisterLocation(T0)); | |
|
zra
2014/08/18 15:56:09
If this should be the function result register for
hausner
2014/08/19 17:19:14
Done.
| |
| 2398 locs->set_temp(0, Location::RegisterLocation(T1)); | |
| 2399 return locs; | |
| 2400 } | |
| 2401 | |
| 2402 | |
| 2403 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 2404 Register field = locs()->in(0).reg(); | |
| 2405 Register temp = locs()->temp(0).reg(); | |
| 2406 | |
| 2407 Label call_runtime, no_call; | |
| 2408 __ TraceSimMsg("InitStaticFieldInstr"); | |
| 2409 | |
| 2410 __ lw(temp, FieldAddress(field, Field::value_offset())); | |
| 2411 __ BranchEqual(temp, Object::sentinel(), &call_runtime); | |
| 2412 __ BranchNotEqual(temp, Object::transition_sentinel(), &no_call); | |
| 2413 | |
| 2414 __ Bind(&call_runtime); | |
| 2415 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | |
| 2416 __ LoadObject(TMP, Object::null_object()); | |
| 2417 __ sw(TMP, Address(SP, 1 * kWordSize)); // Make room for (unused) result. | |
| 2418 __ sw(field, Address(SP, 0 * kWordSize)); | |
| 2419 | |
| 2420 compiler->GenerateRuntimeCall(token_pos(), | |
| 2421 deopt_id(), | |
| 2422 kInitStaticFieldRuntimeEntry, | |
| 2423 1, | |
| 2424 locs()); | |
| 2425 | |
| 2426 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Purge argument and result. | |
| 2427 | |
| 2428 __ Bind(&no_call); | |
| 2429 } | |
| 2430 | |
| 2431 | |
| 2390 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2432 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2391 bool opt) const { | 2433 bool opt) const { |
| 2392 const intptr_t kNumInputs = 1; | 2434 const intptr_t kNumInputs = 1; |
| 2393 const intptr_t kNumTemps = 0; | 2435 const intptr_t kNumTemps = 0; |
| 2394 LocationSummary* locs = new(isolate) LocationSummary( | 2436 LocationSummary* locs = new(isolate) LocationSummary( |
| 2395 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2437 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2396 locs->set_in(0, Location::RegisterLocation(T0)); | 2438 locs->set_in(0, Location::RegisterLocation(T0)); |
| 2397 locs->set_out(0, Location::RegisterLocation(T0)); | 2439 locs->set_out(0, Location::RegisterLocation(T0)); |
| 2398 return locs; | 2440 return locs; |
| 2399 } | 2441 } |
| (...skipping 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4838 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 4880 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 4839 #if defined(DEBUG) | 4881 #if defined(DEBUG) |
| 4840 __ LoadImmediate(S4, kInvalidObjectPointer); | 4882 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 4841 __ LoadImmediate(S5, kInvalidObjectPointer); | 4883 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 4842 #endif | 4884 #endif |
| 4843 } | 4885 } |
| 4844 | 4886 |
| 4845 } // namespace dart | 4887 } // namespace dart |
| 4846 | 4888 |
| 4847 #endif // defined TARGET_ARCH_MIPS | 4889 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |