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

Side by Side Diff: src/hydrogen-instructions.h

Issue 11299328: Implement basic array prefetching hints in Hydrogen. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years 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 | « src/hydrogen.cc ('k') | src/hydrogen-instructions.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after
4335 virtual HValue* GetKey() = 0; 4335 virtual HValue* GetKey() = 0;
4336 virtual void SetKey(HValue* key) = 0; 4336 virtual void SetKey(HValue* key) = 0;
4337 virtual void SetIndexOffset(uint32_t index_offset) = 0; 4337 virtual void SetIndexOffset(uint32_t index_offset) = 0;
4338 virtual bool IsDehoisted() = 0; 4338 virtual bool IsDehoisted() = 0;
4339 virtual void SetDehoisted(bool is_dehoisted) = 0; 4339 virtual void SetDehoisted(bool is_dehoisted) = 0;
4340 virtual ~ArrayInstructionInterface() { }; 4340 virtual ~ArrayInstructionInterface() { };
4341 }; 4341 };
4342 4342
4343 4343
4344 class HLoadKeyed 4344 class HLoadKeyed
4345 : public HTemplateInstruction<3>, public ArrayInstructionInterface { 4345 : public HTemplateInstruction<4>, public ArrayInstructionInterface {
4346 public: 4346 public:
4347 HLoadKeyed(HValue* obj, 4347 HLoadKeyed(HValue* obj,
4348 HValue* key, 4348 HValue* key,
4349 HValue* dependency, 4349 HValue* dependency,
4350 HValue* prefetch_distance,
4350 ElementsKind elements_kind) 4351 ElementsKind elements_kind)
4351 : bit_field_(0) { 4352 : bit_field_(0) {
4352 bit_field_ = ElementsKindField::encode(elements_kind); 4353 bit_field_ = ElementsKindField::encode(elements_kind);
4353 4354
4354 SetOperandAt(0, obj); 4355 SetOperandAt(0, obj);
4355 SetOperandAt(1, key); 4356 SetOperandAt(1, key);
4356 SetOperandAt(2, dependency); 4357 SetOperandAt(2, dependency);
4358 SetOperandAt(3, prefetch_distance);
4357 4359
4358 if (!is_external()) { 4360 if (!is_external()) {
4359 // I can detect the case between storing double (holey and fast) and 4361 // I can detect the case between storing double (holey and fast) and
4360 // smi/object by looking at elements_kind_. 4362 // smi/object by looking at elements_kind_.
4361 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind) || 4363 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind) ||
4362 IsFastDoubleElementsKind(elements_kind)); 4364 IsFastDoubleElementsKind(elements_kind));
4363 4365
4364 if (IsFastSmiOrObjectElementsKind(elements_kind)) { 4366 if (IsFastSmiOrObjectElementsKind(elements_kind)) {
4365 if (IsFastSmiElementsKind(elements_kind) && 4367 if (IsFastSmiElementsKind(elements_kind) &&
4366 IsFastPackedElementsKind(elements_kind)) { 4368 IsFastPackedElementsKind(elements_kind)) {
(...skipping 21 matching lines...) Expand all
4388 4390
4389 SetFlag(kUseGVN); 4391 SetFlag(kUseGVN);
4390 } 4392 }
4391 4393
4392 bool is_external() const { 4394 bool is_external() const {
4393 return IsExternalArrayElementsKind(elements_kind()); 4395 return IsExternalArrayElementsKind(elements_kind());
4394 } 4396 }
4395 HValue* elements() { return OperandAt(0); } 4397 HValue* elements() { return OperandAt(0); }
4396 HValue* key() { return OperandAt(1); } 4398 HValue* key() { return OperandAt(1); }
4397 HValue* dependency() { return OperandAt(2); } 4399 HValue* dependency() { return OperandAt(2); }
4400 HValue* prefetch_distance() { return OperandAt(3); }
4401 void SetPrefetchDistance(HValue* prefetch_distance) {
4402 SetOperandAt(3, prefetch_distance);
4403 }
4398 uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); } 4404 uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); }
4399 void SetIndexOffset(uint32_t index_offset) { 4405 void SetIndexOffset(uint32_t index_offset) {
4400 bit_field_ = IndexOffsetField::update(bit_field_, index_offset); 4406 bit_field_ = IndexOffsetField::update(bit_field_, index_offset);
4401 } 4407 }
4402 HValue* GetKey() { return key(); } 4408 HValue* GetKey() { return key(); }
4403 void SetKey(HValue* key) { SetOperandAt(1, key); } 4409 void SetKey(HValue* key) { SetOperandAt(1, key); }
4404 bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); } 4410 bool IsDehoisted() { return IsDehoistedField::decode(bit_field_); }
4405 void SetDehoisted(bool is_dehoisted) { 4411 void SetDehoisted(bool is_dehoisted) {
4406 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); 4412 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted);
4407 } 4413 }
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 virtual bool IsDeletable() const { return true; } 5396 virtual bool IsDeletable() const { return true; }
5391 }; 5397 };
5392 5398
5393 5399
5394 #undef DECLARE_INSTRUCTION 5400 #undef DECLARE_INSTRUCTION
5395 #undef DECLARE_CONCRETE_INSTRUCTION 5401 #undef DECLARE_CONCRETE_INSTRUCTION
5396 5402
5397 } } // namespace v8::internal 5403 } } // namespace v8::internal
5398 5404
5399 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5405 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698