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

Side by Side Diff: runtime/vm/simulator_dbc.cc

Issue 2399333003: DBC: Support large offsets in optimized field access. (Closed)
Patch Set: addressed comments Created 4 years, 2 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
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | tests/language/language.status » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 <setjmp.h> // NOLINT 5 #include <setjmp.h> // NOLINT
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #if defined(TARGET_ARCH_DBC) 9 #if defined(TARGET_ARCH_DBC)
10 10
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 *SP = field->ptr()->value_.static_value_; 2360 *SP = field->ptr()->value_.static_value_;
2361 DISPATCH(); 2361 DISPATCH();
2362 } 2362 }
2363 2363
2364 { 2364 {
2365 BYTECODE(StoreField, A_B_C); 2365 BYTECODE(StoreField, A_B_C);
2366 const uint16_t offset_in_words = rB; 2366 const uint16_t offset_in_words = rB;
2367 const uint16_t value_reg = rC; 2367 const uint16_t value_reg = rC;
2368 2368
2369 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]); 2369 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]);
2370 RawObject* value = reinterpret_cast<RawObject*>(FP[value_reg]); 2370 RawObject* value = FP[value_reg];
2371 2371
2372 instance->StorePointer( 2372 instance->StorePointer(
2373 reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words, 2373 reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
2374 value);
2375 DISPATCH();
2376 }
2377
2378 {
2379 BYTECODE(StoreFieldExt, A_D);
2380 // The offset is stored in the following nop-instruction which is skipped.
2381 const uint16_t offset_in_words = Bytecode::DecodeD(*pc++);
2382 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]);
2383 RawObject* value = FP[rD];
2384
2385 instance->StorePointer(
2386 reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
2374 value); 2387 value);
2375 DISPATCH(); 2388 DISPATCH();
2376 } 2389 }
2377 2390
2378 { 2391 {
2379 BYTECODE(StoreFieldTOS, A_D); 2392 BYTECODE(StoreFieldTOS, A_D);
2380 const uint16_t offset_in_words = rD; 2393 const uint16_t offset_in_words = rD;
2381 RawInstance* instance = reinterpret_cast<RawInstance*>(SP[-1]); 2394 RawInstance* instance = reinterpret_cast<RawInstance*>(SP[-1]);
2382 RawObject* value = reinterpret_cast<RawObject*>(SP[0]); 2395 RawObject* value = reinterpret_cast<RawObject*>(SP[0]);
2383 SP -= 2; // Drop instance and value. 2396 SP -= 2; // Drop instance and value.
2384 instance->StorePointer( 2397 instance->StorePointer(
2385 reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words, 2398 reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
2386 value); 2399 value);
2387 2400
2388 DISPATCH(); 2401 DISPATCH();
2389 } 2402 }
2390 2403
2391 { 2404 {
2392 BYTECODE(LoadField, A_B_C); 2405 BYTECODE(LoadField, A_B_C);
2393 const uint16_t instance_reg = rB; 2406 const uint16_t instance_reg = rB;
2394 const uint16_t offset_in_words = rC; 2407 const uint16_t offset_in_words = rC;
2395 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]); 2408 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]);
2396 FP[rA] = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words]; 2409 FP[rA] = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
2397 DISPATCH(); 2410 DISPATCH();
2398 } 2411 }
2399 2412
2400 { 2413 {
2414 BYTECODE(LoadFieldExt, A_D);
2415 // The offset is stored in the following nop-instruction which is skipped.
2416 const uint16_t offset_in_words = Bytecode::DecodeD(*pc++);
2417 const uint16_t instance_reg = rD;
2418 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]);
2419 FP[rA] = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
2420 DISPATCH();
2421 }
2422
2423 {
2401 BYTECODE(LoadUntagged, A_B_C); 2424 BYTECODE(LoadUntagged, A_B_C);
2402 const uint16_t instance_reg = rB; 2425 const uint16_t instance_reg = rB;
2403 const uint16_t offset_in_words = rC; 2426 const uint16_t offset_in_words = rC;
2404 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]); 2427 RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]);
2405 FP[rA] = reinterpret_cast<RawObject**>(instance)[offset_in_words]; 2428 FP[rA] = reinterpret_cast<RawObject**>(instance)[offset_in_words];
2406 DISPATCH(); 2429 DISPATCH();
2407 } 2430 }
2408 2431
2409 { 2432 {
2410 BYTECODE(LoadFieldTOS, A_D); 2433 BYTECODE(LoadFieldTOS, A_D);
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
3462 pc_ = pc; 3485 pc_ = pc;
3463 special_[kExceptionSpecialIndex] = raw_exception; 3486 special_[kExceptionSpecialIndex] = raw_exception;
3464 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3487 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3465 buf->Longjmp(); 3488 buf->Longjmp();
3466 UNREACHABLE(); 3489 UNREACHABLE();
3467 } 3490 }
3468 3491
3469 } // namespace dart 3492 } // namespace dart
3470 3493
3471 #endif // defined TARGET_ARCH_DBC 3494 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698