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

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
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_out(0, Location::RegisterLocation(RAX));
2301 locs->set_temp(0, Location::RegisterLocation(RCX));
2302 return locs;
2303 }
2304
2305
2306 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2307 Register field = locs()->in(0).reg();
2308 Register result = locs()->out(0).reg();
2309 Register temp = locs()->temp(0).reg();
2310
2311 Label call_runtime, no_call;
2312
2313 __ movq(temp, FieldAddress(field, Field::value_offset()));
2314 __ CompareObject(temp, Object::sentinel(), PP);
2315 __ j(EQUAL, &call_runtime);
2316
2317 __ CompareObject(temp, Object::transition_sentinel(), PP);
2318 __ j(NOT_EQUAL, &no_call);
2319
2320 __ Bind(&call_runtime);
2321 __ PushObject(Object::null_object(), PP); // Make room for (unused) result.
2322 __ pushq(field);
2323 compiler->GenerateRuntimeCall(token_pos(),
2324 deopt_id(),
2325 kInitStaticFieldRuntimeEntry,
2326 1,
2327 locs());
2328 __ popq(result); // Remove argument.
2329 __ popq(result); // Remove result.
2330
2331 __ Bind(&no_call);
2332 }
2333
2334
2293 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, 2335 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
2294 bool opt) const { 2336 bool opt) const {
2295 const intptr_t kNumInputs = 1; 2337 const intptr_t kNumInputs = 1;
2296 const intptr_t kNumTemps = 0; 2338 const intptr_t kNumTemps = 0;
2297 LocationSummary* locs = new(isolate) LocationSummary( 2339 LocationSummary* locs = new(isolate) LocationSummary(
2298 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2340 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
2299 locs->set_in(0, Location::RegisterLocation(RAX)); 2341 locs->set_in(0, Location::RegisterLocation(RAX));
2300 locs->set_out(0, Location::RegisterLocation(RAX)); 2342 locs->set_out(0, Location::RegisterLocation(RAX));
2301 return locs; 2343 return locs;
2302 } 2344 }
(...skipping 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after
5862 __ movq(R10, Immediate(kInvalidObjectPointer)); 5904 __ movq(R10, Immediate(kInvalidObjectPointer));
5863 __ movq(RBX, Immediate(kInvalidObjectPointer)); 5905 __ movq(RBX, Immediate(kInvalidObjectPointer));
5864 #endif 5906 #endif
5865 } 5907 }
5866 5908
5867 } // namespace dart 5909 } // namespace dart
5868 5910
5869 #undef __ 5911 #undef __
5870 5912
5871 #endif // defined TARGET_ARCH_X64 5913 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698