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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_mips.cc ('k') | runtime/vm/mirrors_api_impl.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 2283
2284 __ LoadImmediate(R10, Immediate(num_context_variables()), PP); 2284 __ LoadImmediate(R10, Immediate(num_context_variables()), PP);
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 2292
2293 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate,
2294 bool opt) const {
2295 const intptr_t kNumInputs = 1;
2296 const intptr_t kNumTemps = 1;
2297 LocationSummary* locs = new(isolate) LocationSummary(
2298 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2299 locs->set_in(0, Location::RegisterLocation(RAX));
2300 locs->set_temp(0, Location::RegisterLocation(RCX));
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
2309 Label call_runtime, no_call;
2310
2311 __ movq(temp, FieldAddress(field, Field::value_offset()));
2312 __ CompareObject(temp, Object::sentinel(), PP);
2313 __ j(EQUAL, &call_runtime);
2314
2315 __ CompareObject(temp, Object::transition_sentinel(), PP);
2316 __ j(NOT_EQUAL, &no_call);
2317
2318 __ Bind(&call_runtime);
2319 __ PushObject(Object::null_object(), PP); // Make room for (unused) result.
2320 __ pushq(field);
2321 compiler->GenerateRuntimeCall(token_pos(),
2322 deopt_id(),
2323 kInitStaticFieldRuntimeEntry,
2324 1,
2325 locs());
2326 __ Drop(2); // Remove argument and unused result.
2327 __ Bind(&no_call);
2328 }
2329
2330
2293 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, 2331 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
2294 bool opt) const { 2332 bool opt) const {
2295 const intptr_t kNumInputs = 1; 2333 const intptr_t kNumInputs = 1;
2296 const intptr_t kNumTemps = 0; 2334 const intptr_t kNumTemps = 0;
2297 LocationSummary* locs = new(isolate) LocationSummary( 2335 LocationSummary* locs = new(isolate) LocationSummary(
2298 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2336 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2299 locs->set_in(0, Location::RegisterLocation(RAX)); 2337 locs->set_in(0, Location::RegisterLocation(RAX));
2300 locs->set_out(0, Location::RegisterLocation(RAX)); 2338 locs->set_out(0, Location::RegisterLocation(RAX));
2301 return locs; 2339 return locs;
2302 } 2340 }
(...skipping 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after
5862 __ movq(R10, Immediate(kInvalidObjectPointer)); 5900 __ movq(R10, Immediate(kInvalidObjectPointer));
5863 __ movq(RBX, Immediate(kInvalidObjectPointer)); 5901 __ movq(RBX, Immediate(kInvalidObjectPointer));
5864 #endif 5902 #endif
5865 } 5903 }
5866 5904
5867 } // namespace dart 5905 } // namespace dart
5868 5906
5869 #undef __ 5907 #undef __
5870 5908
5871 #endif // defined TARGET_ARCH_X64 5909 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/mirrors_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698