HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kTransitionInfoOffset);
- HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access);
+ HInstruction* boilerplate = Add<HLoadNamedField>(
+ allocation_site, static_cast<HValue*>(NULL), access);
HValue* push_value;
if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) {
HValue* elements = AddLoadElements(boilerplate);
HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kTransitionInfoOffset);
- HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access);
+ HInstruction* boilerplate = Add<HLoadNamedField>(
+ allocation_site, static_cast<HValue*>(NULL), access);
int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
int object_size = size;
}
HValue* boilerplate_map = Add<HLoadNamedField>(
- boilerplate, HObjectAccess::ForMap());
+ boilerplate, static_cast<HValue*>(NULL),
+ HObjectAccess::ForMap());
HValue* boilerplate_size = Add<HLoadNamedField>(
- boilerplate_map, HObjectAccess::ForMapInstanceSize());
+ boilerplate_map, static_cast<HValue*>(NULL),
+ HObjectAccess::ForMapInstanceSize());
HValue* size_in_words = Add<HConstant>(object_size >> kPointerSizeLog2);
checker.If<HCompareNumericAndBranch>(boilerplate_size,
size_in_words, Token::EQ);
for (int i = 0; i < object_size; i += kPointerSize) {
HObjectAccess access = HObjectAccess::ForJSObjectOffset(i);
- Add<HStoreNamedField>(object, access,
- Add<HLoadNamedField>(boilerplate, access),
- INITIALIZING_STORE);
+ Add<HStoreNamedField>(
+ object, access, Add<HLoadNamedField>(
+ boilerplate, static_cast<HValue*>(NULL), access),
+ INITIALIZING_STORE);
}
ASSERT(FLAG_allocation_site_pretenuring || (size == object_size));
// Link the object to the allocation site list
HValue* site_list = Add<HConstant>(
ExternalReference::allocation_sites_list_address(isolate()));
- HValue* site = Add<HLoadNamedField>(site_list,
- HObjectAccess::ForAllocationSiteList());
+ HValue* site = Add<HLoadNamedField>(
+ site_list, static_cast<HValue*>(NULL),
+ HObjectAccess::ForAllocationSiteList());
store = Add<HStoreNamedField>(object,
HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset),
site, INITIALIZING_STORE);
HValue* cell = Add<HConstant>(placeholder_cell);
HObjectAccess access(HObjectAccess::ForCellPayload(isolate()));
- HValue* cell_contents = Add<HLoadNamedField>(cell, access);
+ HValue* cell_contents = Add<HLoadNamedField>(
+ cell, static_cast<HValue*>(NULL), access);
if (stub->is_constant()) {
IfBuilder builder(this);
Add<HStoreCodeEntry>(js_function, code_object);
// Now link a function into a list of optimized functions.
- HValue* optimized_functions_list = Add<HLoadNamedField>(native_context,
+ HValue* optimized_functions_list = Add<HLoadNamedField>(
+ native_context, static_cast<HValue*>(NULL),
HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST));
Add<HStoreNamedField>(js_function,
HObjectAccess::ForNextFunctionLinkPointer(),
HObjectAccess::ForNextFunctionLinkPointer(),
graph()->GetConstantUndefined(),
INITIALIZING_STORE);
- HValue* code_object = Add<HLoadNamedField>(shared_info,
- HObjectAccess::ForCodeOffset());
+ HValue* code_object = Add<HLoadNamedField>(
+ shared_info, static_cast<HValue*>(NULL), HObjectAccess::ForCodeOffset());
Add<HStoreCodeEntry>(js_function, code_object);
}
HValue* native_context) {
Counters* counters = isolate()->counters();
IfBuilder is_optimized(this);
- HInstruction* optimized_map = Add<HLoadNamedField>(shared_info,
+ HInstruction* optimized_map = Add<HLoadNamedField>(
+ shared_info, static_cast<HValue*>(NULL),
HObjectAccess::ForOptimizedCodeMap());
HValue* null_constant = Add<HConstant>(0);
is_optimized.If<HCompareObjectEqAndBranch>(optimized_map, null_constant);
// (native context, optimized code, literals).
// Map must never be empty, so check the first elements.
Label install_optimized;
- HValue* first_context_slot = Add<HLoadNamedField>(optimized_map,
+ HValue* first_context_slot = Add<HLoadNamedField>(
+ optimized_map, static_cast<HValue*>(NULL),
HObjectAccess::ForFirstContextSlot());
- HValue* first_osr_ast_slot = Add<HLoadNamedField>(optimized_map,
+ HValue* first_osr_ast_slot = Add<HLoadNamedField>(
+ optimized_map, static_cast<HValue*>(NULL),
HObjectAccess::ForFirstOsrAstIdSlot());
HValue* osr_ast_id_none = Add<HConstant>(BailoutId::None().ToInt());
IfBuilder already_in(this);
osr_ast_id_none);
already_in.Then();
{
- HValue* code_object = Add<HLoadNamedField>(optimized_map,
- HObjectAccess::ForFirstCodeSlot());
+ HValue* code_object = Add<HLoadNamedField>(
+ optimized_map, static_cast<HValue*>(NULL),
+ HObjectAccess::ForFirstCodeSlot());
BuildInstallOptimizedCode(js_function, native_context, code_object);
}
already_in.Else();
context(),
LoopBuilder::kPostDecrement,
shared_function_entry_length);
- HValue* array_length = Add<HLoadNamedField>(optimized_map,
+ HValue* array_length = Add<HLoadNamedField>(
+ optimized_map, static_cast<HValue*>(NULL),
HObjectAccess::ForFixedArrayLength());
HValue* slot_iterator = loop_builder.BeginBody(array_length,
graph()->GetConstant0(),
// Compute the function map in the current native context and set that
// as the map of the allocated object.
HInstruction* native_context = BuildGetNativeContext();
- HInstruction* map_slot_value = Add<HLoadNamedField>(native_context,
+ HInstruction* map_slot_value = Add<HLoadNamedField>(
+ native_context, static_cast<HValue*>(NULL),
HObjectAccess::ForContextSlot(map_index));
Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value,
INITIALIZING_STORE);
// Copy the global object from the previous context.
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
Add<HStoreNamedField>(function_context,
HObjectAccess::ForContextSlot(
Context::GLOBAL_OBJECT_INDEX),
void HGraphBuilder::AddIncrementCounter(StatsCounter* counter) {
if (FLAG_native_code_counters && counter->Enabled()) {
HValue* reference = Add<HConstant>(ExternalReference(counter));
- HValue* old_value = Add<HLoadNamedField>(reference,
- HObjectAccess::ForCounter());
+ HValue* old_value = Add<HLoadNamedField>(
+ reference, static_cast<HValue*>(NULL), HObjectAccess::ForCounter());
HValue* new_value = AddUncasted<HAdd>(old_value, graph()->GetConstant1());
new_value->ClearFlag(HValue::kCanOverflow); // Ignore counter overflow
Add<HStoreNamedField>(reference, HObjectAccess::ForCounter(),
HInstruction* elements_length = AddLoadFixedArrayLength(elements);
HInstruction* array_length = is_jsarray
- ? Add<HLoadNamedField>(object, HObjectAccess::ForArrayLength(from_kind))
+ ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
+ HObjectAccess::ForArrayLength(from_kind))
: elements_length;
BuildGrowElementsCapacity(object, elements, from_kind, to_kind,
} else {
// Check if the object is a heap number.
IfBuilder if_objectisnumber(this);
- if_objectisnumber.If<HCompareMap>(
+ HValue* objectisnumber = if_objectisnumber.If<HCompareMap>(
object, isolate()->factory()->heap_number_map());
if_objectisnumber.Then();
{
// Compute hash for heap number similar to double_get_hash().
HValue* low = Add<HLoadNamedField>(
- object, HObjectAccess::ForHeapNumberValueLowestBits());
+ object, objectisnumber,
+ HObjectAccess::ForHeapNumberValueLowestBits());
HValue* high = Add<HLoadNamedField>(
- object, HObjectAccess::ForHeapNumberValueHighestBits());
+ object, objectisnumber,
+ HObjectAccess::ForHeapNumberValueHighestBits());
HValue* hash = AddUncasted<HBitwise>(Token::BIT_XOR, low, high);
hash = AddUncasted<HBitwise>(Token::BIT_AND, hash, mask);
// Check if key is a heap number (the number string cache contains only
// SMIs and heap number, so it is sufficient to do a SMI check here).
IfBuilder if_keyisnotsmi(this);
- if_keyisnotsmi.IfNot<HIsSmiAndBranch>(key);
+ HValue* keyisnotsmi = if_keyisnotsmi.IfNot<HIsSmiAndBranch>(key);
if_keyisnotsmi.Then();
{
// Check if values of key and object match.
IfBuilder if_keyeqobject(this);
if_keyeqobject.If<HCompareNumericAndBranch>(
- Add<HLoadNamedField>(key, HObjectAccess::ForHeapNumberValue()),
- Add<HLoadNamedField>(object, HObjectAccess::ForHeapNumberValue()),
+ Add<HLoadNamedField>(key, keyisnotsmi,
+ HObjectAccess::ForHeapNumberValue()),
+ Add<HLoadNamedField>(object, objectisnumber,
+ HObjectAccess::ForHeapNumberValue()),
Token::EQ);
if_keyeqobject.Then();
{
HInstruction* length = NULL;
if (is_js_array) {
length = Add<HLoadNamedField>(
- checked_object, HObjectAccess::ForArrayLength(elements_kind));
+ checked_object, static_cast<HValue*>(NULL),
+ HObjectAccess::ForArrayLength(elements_kind));
} else {
length = AddLoadFixedArrayLength(elements);
}
HValue* backing_store;
if (IsExternalArrayElementsKind(elements_kind)) {
backing_store = Add<HLoadNamedField>(
- elements, HObjectAccess::ForExternalArrayExternalPointer());
+ elements, static_cast<HValue*>(NULL),
+ HObjectAccess::ForExternalArrayExternalPointer());
} else {
backing_store = elements;
}
HLoadNamedField* HGraphBuilder::AddLoadElements(HValue* object) {
- return Add<HLoadNamedField>(object, HObjectAccess::ForElementsPointer());
+ return Add<HLoadNamedField>(
+ object, static_cast<HValue*>(NULL), HObjectAccess::ForElementsPointer());
}
HLoadNamedField* HGraphBuilder::AddLoadFixedArrayLength(HValue* object) {
- return Add<HLoadNamedField>(object,
- HObjectAccess::ForFixedArrayLength());
+ return Add<HLoadNamedField>(
+ object, static_cast<HValue*>(NULL), HObjectAccess::ForFixedArrayLength());
}
for (int i = 0; i < JSArray::kSize; i += kPointerSize) {
if ((i != JSArray::kElementsOffset) || (length == 0)) {
HObjectAccess access = HObjectAccess::ForJSArrayOffset(i);
- Add<HStoreNamedField>(object, access,
- Add<HLoadNamedField>(boilerplate, access),
- INITIALIZING_STORE);
+ Add<HStoreNamedField>(
+ object, access, Add<HLoadNamedField>(
+ boilerplate, static_cast<HValue*>(NULL), access),
+ INITIALIZING_STORE);
}
}
// Copy the elements array header.
for (int i = 0; i < FixedArrayBase::kHeaderSize; i += kPointerSize) {
HObjectAccess access = HObjectAccess::ForFixedArrayHeader(i);
- Add<HStoreNamedField>(object_elements, access,
- Add<HLoadNamedField>(boilerplate_elements, access),
- INITIALIZING_STORE);
+ Add<HStoreNamedField>(
+ object_elements, access, Add<HLoadNamedField>(
+ boilerplate_elements, static_cast<HValue*>(NULL), access),
+ INITIALIZING_STORE);
}
// Copy the elements array contents.
allocation_site, INITIALIZING_STORE);
if (FLAG_allocation_site_pretenuring) {
HValue* memento_create_count = Add<HLoadNamedField>(
- allocation_site, HObjectAccess::ForAllocationSiteOffset(
+ allocation_site, static_cast<HValue*>(NULL),
+ HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kPretenureCreateCountOffset));
memento_create_count = AddUncasted<HAdd>(
memento_create_count, graph()->GetConstant1());
HInstruction* HGraphBuilder::BuildGetNativeContext(HValue* closure) {
// Get the global context, then the native context
HInstruction* context =
- Add<HLoadNamedField>(closure, HObjectAccess::ForFunctionContextPointer());
- HInstruction* global_object = Add<HLoadNamedField>(context,
+ Add<HLoadNamedField>(closure, static_cast<HValue*>(NULL),
+ HObjectAccess::ForFunctionContextPointer());
+ HInstruction* global_object = Add<HLoadNamedField>(
+ context, static_cast<HValue*>(NULL),
HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HObjectAccess access = HObjectAccess::ForJSObjectOffset(
GlobalObject::kNativeContextOffset);
- return Add<HLoadNamedField>(global_object, access);
+ return Add<HLoadNamedField>(
+ global_object, static_cast<HValue*>(NULL), access);
}
HInstruction* HGraphBuilder::BuildGetNativeContext() {
// Get the global context, then the native context
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
return Add<HLoadNamedField>(
- global_object, HObjectAccess::ForJSObjectOffset(
- GlobalObject::kNativeContextOffset));
+ global_object, static_cast<HValue*>(NULL),
+ HObjectAccess::ForJSObjectOffset(GlobalObject::kNativeContextOffset));
}
HValue* HGraphBuilder::AddLoadJSBuiltin(Builtins::JavaScript builtin) {
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HObjectAccess access = HObjectAccess::ForJSObjectOffset(
GlobalObject::kBuiltinsOffset);
- HValue* builtins = Add<HLoadNamedField>(global_object, access);
+ HValue* builtins = Add<HLoadNamedField>(
+ global_object, static_cast<HValue*>(NULL), access);
HObjectAccess function_access = HObjectAccess::ForJSObjectOffset(
JSBuiltinsObject::OffsetOfFunctionWithId(builtin));
- return Add<HLoadNamedField>(builtins, function_access);
+ return Add<HLoadNamedField>(
+ builtins, static_cast<HValue*>(NULL), function_access);
}
}
} else {
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(
- Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HLoadGlobalGeneric* instr =
New<HLoadGlobalGeneric>(global_object,
variable->name(),
heap_number, INITIALIZING_STORE);
} else {
// Already holds a HeapNumber; load the box and write its value field.
- HInstruction* heap_number = Add<HLoadNamedField>(checked_object,
- heap_number_access);
+ HInstruction* heap_number = Add<HLoadNamedField>(
+ checked_object, static_cast<HValue*>(NULL), heap_number_access);
heap_number->set_type(HType::HeapNumber());
instr = New<HStoreNamedField>(heap_number,
HObjectAccess::ForHeapNumberValue(),
HObjectAccess access = HObjectAccess::ForMap(); // bogus default
if (info->GetJSObjectFieldAccess(&access)) {
- return New<HLoadNamedField>(checked_object, access);
+ return New<HLoadNamedField>(
+ checked_object, static_cast<HValue*>(NULL), access);
}
HValue* checked_holder = checked_object;
}
} else {
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HStoreNamedGeneric* instr =
Add<HStoreNamedGeneric>(global_object, var->name(),
value, function_strict_mode_flag());
if (FLAG_track_double_fields && access.representation().IsDouble()) {
// load the heap number
HLoadNamedField* heap_number = Add<HLoadNamedField>(
- object, access.WithRepresentation(Representation::Tagged()));
+ object, static_cast<HValue*>(NULL),
+ access.WithRepresentation(Representation::Tagged()));
heap_number->set_type(HType::HeapNumber());
// load the double value from it
return New<HLoadNamedField>(
- heap_number, HObjectAccess::ForHeapNumberValue());
+ heap_number, static_cast<HValue*>(NULL),
+ HObjectAccess::ForHeapNumberValue());
}
- return New<HLoadNamedField>(object, access);
+ return New<HLoadNamedField>(object, static_cast<HValue*>(NULL), access);
}
return NewPlainFunctionCall(target, argument_count, dont_adapt_arguments);
} else {
HValue* param_count_value = Add<HConstant>(formal_parameter_count);
- HValue* context = Add<HLoadNamedField>(target,
+ HValue* context = Add<HLoadNamedField>(
+ target, static_cast<HValue*>(NULL),
HObjectAccess::ForFunctionContextPointer());
return NewArgumentAdaptorCall(target, context,
argument_count, param_count_value);
elements, isolate()->factory()->fixed_array_map(), top_info());
}
HValue* length = Add<HLoadNamedField>(
- checked_object, HObjectAccess::ForArrayLength(elements_kind));
+ checked_object, static_cast<HValue*>(NULL),
+ HObjectAccess::ForArrayLength(elements_kind));
reduced_length = AddUncasted<HSub>(length, graph()->GetConstant1());
HValue* bounds_check = Add<HBoundsCheck>(
graph()->GetConstant0(), length);
SharedFunctionInfo* shared = target->shared();
if (shared->is_classic_mode() && !shared->native()) {
HValue* context = Add<HLoadNamedField>(
- function,
+ function, static_cast<HValue*>(NULL),
HObjectAccess::ForJSObjectOffset(JSFunction::kContextOffset));
HValue* global_object = Add<HLoadNamedField>(
- context,
+ context, static_cast<HValue*>(NULL),
HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
return Add<HLoadNamedField>(
- global_object,
+ global_object, static_cast<HValue*>(NULL),
HObjectAccess::ForJSObjectOffset(
GlobalObject::kGlobalReceiverOffset));
}
// Push the global object instead of the global receiver because
// code generated by the full code generator expects it.
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(
- Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
Push(global_object);
CHECK_ALIVE(VisitExpressions(expr->arguments()));
// We're about to install a contextual IC, which expects the global
// object as receiver rather than the global proxy.
HValue* global_object = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(
- Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
const int receiver_index = argument_count - 1;
environment()->SetExpressionStackAt(receiver_index, global_object);
// When the target has a custom call IC generator, use the IC,
}
} else {
HValue* receiver = Add<HLoadNamedField>(
- context(), HObjectAccess::ForContextSlot(
- Context::GLOBAL_OBJECT_INDEX));
+ context(), static_cast<HValue*>(NULL),
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
Push(Add<HPushArgument>(receiver));
CHECK_ALIVE(VisitArgumentList(expr->arguments()));
// Load the initial map from the constructor.
HValue* constructor_value = Add<HConstant>(constructor);
HValue* initial_map_value =
- Add<HLoadNamedField>(constructor_value, HObjectAccess::ForJSObjectOffset(
- JSFunction::kPrototypeOrInitialMapOffset));
+ Add<HLoadNamedField>(constructor_value, static_cast<HValue*>(NULL),
+ HObjectAccess::ForJSObjectOffset(
+ JSFunction::kPrototypeOrInitialMapOffset));
// Initialize map and fields of the newly allocated object.
{ NoObservableSideEffectsScope no_effects(this);
HObjectAccess::ForJSArrayBufferWeakFirstView();
Add<HStoreNamedField>(obj,
HObjectAccess::ForJSArrayBufferViewWeakNext(),
- Add<HLoadNamedField>(buffer, weak_first_view_access),
+ Add<HLoadNamedField>(buffer, static_cast<HValue*>(NULL),
+ weak_first_view_access),
INITIALIZING_STORE);
Add<HStoreNamedField>(
buffer, weak_first_view_access, obj, INITIALIZING_STORE);
AddStoreMapConstant(elements, external_array_map);
HValue* backing_store = Add<HLoadNamedField>(
- buffer, HObjectAccess::ForJSArrayBufferBackingStore());
+ buffer, static_cast<HValue*>(NULL),
+ HObjectAccess::ForJSArrayBufferBackingStore());
HValue* typed_array_start;
if (is_zero_byte_offset) {