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

Side by Side Diff: runtime/vm/intermediate_language_mips.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
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.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_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
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_temp(0, Location::RegisterLocation(T1));
2398 return locs;
2399 }
2400
2401
2402 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2403 Register field = locs()->in(0).reg();
2404 Register temp = locs()->temp(0).reg();
2405
2406 Label call_runtime, no_call;
2407 __ TraceSimMsg("InitStaticFieldInstr");
2408
2409 __ lw(temp, FieldAddress(field, Field::value_offset()));
2410 __ BranchEqual(temp, Object::sentinel(), &call_runtime);
2411 __ BranchNotEqual(temp, Object::transition_sentinel(), &no_call);
2412
2413 __ Bind(&call_runtime);
2414 __ addiu(SP, SP, Immediate(-2 * kWordSize));
2415 __ LoadObject(TMP, Object::null_object());
2416 __ sw(TMP, Address(SP, 1 * kWordSize)); // Make room for (unused) result.
2417 __ sw(field, Address(SP, 0 * kWordSize));
2418
2419 compiler->GenerateRuntimeCall(token_pos(),
2420 deopt_id(),
2421 kInitStaticFieldRuntimeEntry,
2422 1,
2423 locs());
2424
2425 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Purge argument and result.
2426
2427 __ Bind(&no_call);
2428 }
2429
2430
2390 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, 2431 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
2391 bool opt) const { 2432 bool opt) const {
2392 const intptr_t kNumInputs = 1; 2433 const intptr_t kNumInputs = 1;
2393 const intptr_t kNumTemps = 0; 2434 const intptr_t kNumTemps = 0;
2394 LocationSummary* locs = new(isolate) LocationSummary( 2435 LocationSummary* locs = new(isolate) LocationSummary(
2395 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2436 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2396 locs->set_in(0, Location::RegisterLocation(T0)); 2437 locs->set_in(0, Location::RegisterLocation(T0));
2397 locs->set_out(0, Location::RegisterLocation(T0)); 2438 locs->set_out(0, Location::RegisterLocation(T0));
2398 return locs; 2439 return locs;
2399 } 2440 }
(...skipping 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after
4838 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 4879 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
4839 #if defined(DEBUG) 4880 #if defined(DEBUG)
4840 __ LoadImmediate(S4, kInvalidObjectPointer); 4881 __ LoadImmediate(S4, kInvalidObjectPointer);
4841 __ LoadImmediate(S5, kInvalidObjectPointer); 4882 __ LoadImmediate(S5, kInvalidObjectPointer);
4842 #endif 4883 #endif
4843 } 4884 }
4844 4885
4845 } // namespace dart 4886 } // namespace dart
4846 4887
4847 #endif // defined TARGET_ARCH_MIPS 4888 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698