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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 9395016: First part of new ICData infrastructure: use a wrapper object instead of an array. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 4401)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -7,7 +7,6 @@
#include "vm/code_generator.h"
#include "vm/compiler.h"
-#include "vm/ic_data.h"
#include "vm/object_store.h"
#include "vm/pages.h"
#include "vm/resolver.h"
@@ -371,8 +370,7 @@
__ cmpq(R13, raw_null);
__ j(EQUAL, &not_found, Assembler::kNearJump);
- ASSERT(ICData::kNameIndex == 0);
- __ cmpq(R13, FieldAddress(RBX, Array::data_offset()));
+ __ cmpq(R13, FieldAddress(RBX, ICData::target_name_offset()));
__ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
// Name found, check total argument count and named argument count.
@@ -1537,7 +1535,7 @@
// Generate inline cache check for 'num_args'.
-// RBX: Inline cache data array.
+// RBX: Inline cache data object.
// R10: Arguments array.
// TOS(0): return address
// Control flow:
@@ -1552,7 +1550,7 @@
ASSERT(num_args > 0);
// Get receiver.
__ movq(RAX, FieldAddress(R10, Array::data_offset()));
- __ movq(RAX, Address(RSP, RAX, TIMES_4, 0)); // RAX is Smi.
+ __ movq(RAX, Address(RSP, RAX, TIMES_4, 0)); // RAX (argument count) is Smi.
Label get_class, ic_miss;
__ call(&get_class);
@@ -1562,11 +1560,9 @@
#if defined(DEBUG)
{ Label ok;
// Check that the IC data array has NumberOfArgumentsChecked() == num_args.
- __ movq(RCX, FieldAddress(RBX,
- Array::data_offset() + ICData::kNumArgsCheckedIndex * kWordSize));
- const Immediate value =
- Immediate(reinterpret_cast<int64_t>(Smi::New(num_args)));
- __ cmpq(RCX, value);
+ // 'num_args_tested' is stored as an untagged int.
+ __ movq(RCX, FieldAddress(RBX, ICData::num_args_tested_offset()));
+ __ cmpq(RCX, Immediate(num_args));
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Incorrect stub for IC data");
__ Bind(&ok);
@@ -1575,10 +1571,11 @@
// Loop that checks if there is an IC data match.
// RAX: receiver's class.
- // RBX: IC data array (preserved).
- __ leaq(R12, FieldAddress(RBX,
- Array::data_offset() + ICData::kChecksStartIndex * kWordSize));
- // R12: pointing to a class to check against (into IC data array).
+ // RBX: IC data object (preserved).
+ __ movq(R12, FieldAddress(RBX, ICData::ic_data_offset()));
+ // R12: ic_data_array with check entries: classes and target functions.
+ __ leaq(R12, FieldAddress(R12, Array::data_offset()));
+ // R12: points directly to the first ic data array element.
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
Label loop, found;

Powered by Google App Engine
This is Rietveld 408576698