| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index 20d67100552a370305bf73d49e8fa6ca0f51a2b9..26188a2aea7ae8ad943dfdb89728b9e7db3d22ef 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -942,17 +942,15 @@ std::ostream& HCallJSFunction::PrintDataTo(std::ostream& os) const { // NOLINT
|
| }
|
|
|
|
|
| -HCallJSFunction* HCallJSFunction::New(
|
| - Zone* zone,
|
| - HValue* context,
|
| - HValue* function,
|
| - int argument_count,
|
| - bool pass_argument_count) {
|
| +HCallJSFunction* HCallJSFunction::New(Isolate* isolate, Zone* zone,
|
| + HValue* context, HValue* function,
|
| + int argument_count,
|
| + bool pass_argument_count) {
|
| bool has_stack_check = false;
|
| if (function->IsConstant()) {
|
| HConstant* fun_const = HConstant::cast(function);
|
| Handle<JSFunction> jsfun =
|
| - Handle<JSFunction>::cast(fun_const->handle(zone->isolate()));
|
| + Handle<JSFunction>::cast(fun_const->handle(isolate));
|
| has_stack_check = !jsfun.is_null() &&
|
| (jsfun->code()->kind() == Code::FUNCTION ||
|
| jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION);
|
| @@ -989,13 +987,16 @@ void HBoundsCheck::ApplyIndexChange() {
|
| int actual_offset = decomposition.offset() + offset();
|
| int actual_scale = decomposition.scale() + scale();
|
|
|
| - Zone* zone = block()->graph()->zone();
|
| - HValue* context = block()->graph()->GetInvalidContext();
|
| + HGraph* graph = block()->graph();
|
| + Isolate* isolate = graph->isolate();
|
| + Zone* zone = graph->zone();
|
| + HValue* context = graph->GetInvalidContext();
|
| if (actual_offset != 0) {
|
| - HConstant* add_offset = HConstant::New(zone, context, actual_offset);
|
| + HConstant* add_offset =
|
| + HConstant::New(isolate, zone, context, actual_offset);
|
| add_offset->InsertBefore(this);
|
| - HInstruction* add = HAdd::New(zone, context,
|
| - current_index, add_offset);
|
| + HInstruction* add =
|
| + HAdd::New(isolate, zone, context, current_index, add_offset);
|
| add->InsertBefore(this);
|
| add->AssumeRepresentation(index()->representation());
|
| add->ClearFlag(kCanOverflow);
|
| @@ -1003,10 +1004,10 @@ void HBoundsCheck::ApplyIndexChange() {
|
| }
|
|
|
| if (actual_scale != 0) {
|
| - HConstant* sar_scale = HConstant::New(zone, context, actual_scale);
|
| + HConstant* sar_scale = HConstant::New(isolate, zone, context, actual_scale);
|
| sar_scale->InsertBefore(this);
|
| - HInstruction* sar = HSar::New(zone, context,
|
| - current_index, sar_scale);
|
| + HInstruction* sar =
|
| + HSar::New(isolate, zone, context, current_index, sar_scale);
|
| sar->InsertBefore(this);
|
| sar->AssumeRepresentation(index()->representation());
|
| current_index = sar;
|
| @@ -1522,8 +1523,9 @@ std::ostream& HTypeof::PrintDataTo(std::ostream& os) const { // NOLINT
|
| }
|
|
|
|
|
| -HInstruction* HForceRepresentation::New(Zone* zone, HValue* context,
|
| - HValue* value, Representation representation) {
|
| +HInstruction* HForceRepresentation::New(Isolate* isolate, Zone* zone,
|
| + HValue* context, HValue* value,
|
| + Representation representation) {
|
| if (FLAG_fold_constants && value->IsConstant()) {
|
| HConstant* c = HConstant::cast(value);
|
| c = c->CopyToRepresentation(representation, zone);
|
| @@ -1595,7 +1597,7 @@ HValue* HUnaryMathOperation::Canonicalize() {
|
| }
|
|
|
| return Prepend(HMathFloorOfDiv::New(
|
| - block()->zone(), context(), left, right));
|
| + block()->graph()->isolate(), block()->zone(), context(), left, right));
|
| }
|
| return this;
|
| }
|
| @@ -2122,7 +2124,8 @@ void InductionVariableData::ChecksRelatedToLength::UseNewIndexInCurrentBlock(
|
| DCHECK(context != NULL);
|
|
|
| Zone* zone = index_base->block()->graph()->zone();
|
| - set_added_constant(HConstant::New(zone, context, mask));
|
| + Isolate* isolate = index_base->block()->graph()->isolate();
|
| + set_added_constant(HConstant::New(isolate, zone, context, mask));
|
| if (added_index() != NULL) {
|
| added_constant()->InsertBefore(added_index());
|
| } else {
|
| @@ -2131,8 +2134,8 @@ void InductionVariableData::ChecksRelatedToLength::UseNewIndexInCurrentBlock(
|
|
|
| if (added_index() == NULL) {
|
| first_check_in_block()->ReplaceAllUsesWith(first_check_in_block()->index());
|
| - HInstruction* new_index = HBitwise::New(zone, context, token, index_base,
|
| - added_constant());
|
| + HInstruction* new_index = HBitwise::New(isolate, zone, context, token,
|
| + index_base, added_constant());
|
| DCHECK(new_index->IsBitwise());
|
| new_index->ClearAllSideEffects();
|
| new_index->AssumeRepresentation(Representation::Integer32());
|
| @@ -2951,9 +2954,10 @@ Maybe<HConstant*> HConstant::CopyToTruncatedInt32(Zone* zone) {
|
| }
|
|
|
|
|
| -Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Zone* zone) {
|
| +Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate,
|
| + Zone* zone) {
|
| HConstant* res = NULL;
|
| - Handle<Object> handle = this->handle(zone->isolate());
|
| + Handle<Object> handle = this->handle(isolate);
|
| if (handle->IsBoolean()) {
|
| res = handle->BooleanValue() ?
|
| new(zone) HConstant(1) : new(zone) HConstant(0);
|
| @@ -3552,18 +3556,14 @@ HValue* HLoadKeyedGeneric::Canonicalize() {
|
| if (names_cache->enumerable() == object()) {
|
| HForInCacheArray* index_cache =
|
| names_cache->index_cache();
|
| - HCheckMapValue* map_check =
|
| - HCheckMapValue::New(block()->graph()->zone(),
|
| - block()->graph()->GetInvalidContext(),
|
| - object(),
|
| - names_cache->map());
|
| + HCheckMapValue* map_check = HCheckMapValue::New(
|
| + block()->graph()->isolate(), block()->graph()->zone(),
|
| + block()->graph()->GetInvalidContext(), object(),
|
| + names_cache->map());
|
| HInstruction* index = HLoadKeyed::New(
|
| - block()->graph()->zone(),
|
| - block()->graph()->GetInvalidContext(),
|
| - index_cache,
|
| - key_load->key(),
|
| - key_load->key(),
|
| - key_load->elements_kind());
|
| + block()->graph()->isolate(), block()->graph()->zone(),
|
| + block()->graph()->GetInvalidContext(), index_cache, key_load->key(),
|
| + key_load->key(), key_load->elements_kind());
|
| map_check->InsertBefore(this);
|
| index->InsertBefore(this);
|
| return Prepend(new(block()->zone()) HLoadFieldByIndex(
|
| @@ -3726,6 +3726,7 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
|
| HValue* dominator) {
|
| DCHECK(side_effect == kNewSpacePromotion);
|
| Zone* zone = block()->zone();
|
| + Isolate* isolate = block()->isolate();
|
| if (!FLAG_use_allocation_folding) return false;
|
|
|
| // Try to fold allocations together with their dominating allocations.
|
| @@ -3827,25 +3828,19 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
|
| HInstruction* new_dominator_size_value;
|
|
|
| if (current_size->IsInteger32Constant()) {
|
| - new_dominator_size_value =
|
| - HConstant::CreateAndInsertBefore(zone,
|
| - context(),
|
| - new_dominator_size,
|
| - Representation::None(),
|
| - dominator_allocate);
|
| + new_dominator_size_value = HConstant::CreateAndInsertBefore(
|
| + isolate, zone, context(), new_dominator_size, Representation::None(),
|
| + dominator_allocate);
|
| } else {
|
| - HValue* new_dominator_size_constant =
|
| - HConstant::CreateAndInsertBefore(zone,
|
| - context(),
|
| - dominator_size_constant,
|
| - Representation::Integer32(),
|
| - dominator_allocate);
|
| + HValue* new_dominator_size_constant = HConstant::CreateAndInsertBefore(
|
| + isolate, zone, context(), dominator_size_constant,
|
| + Representation::Integer32(), dominator_allocate);
|
|
|
| // Add old and new size together and insert.
|
| current_size->ChangeRepresentation(Representation::Integer32());
|
|
|
| - new_dominator_size_value = HAdd::New(zone, context(),
|
| - new_dominator_size_constant, current_size);
|
| + new_dominator_size_value = HAdd::New(
|
| + isolate, zone, context(), new_dominator_size_constant, current_size);
|
| new_dominator_size_value->ClearFlag(HValue::kCanOverflow);
|
| new_dominator_size_value->ChangeRepresentation(Representation::Integer32());
|
|
|
| @@ -3877,18 +3872,11 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
|
|
|
| // After that replace the dominated allocate instruction.
|
| HInstruction* inner_offset = HConstant::CreateAndInsertBefore(
|
| - zone,
|
| - context(),
|
| - dominator_size_constant,
|
| - Representation::None(),
|
| + isolate, zone, context(), dominator_size_constant, Representation::None(),
|
| this);
|
|
|
| - HInstruction* dominated_allocate_instr =
|
| - HInnerAllocatedObject::New(zone,
|
| - context(),
|
| - dominator_allocate,
|
| - inner_offset,
|
| - type());
|
| + HInstruction* dominated_allocate_instr = HInnerAllocatedObject::New(
|
| + isolate, zone, context(), dominator_allocate, inner_offset, type());
|
| dominated_allocate_instr->InsertBefore(this);
|
| DeleteAndReplaceWith(dominated_allocate_instr);
|
| if (FLAG_trace_allocation_folding) {
|
| @@ -3971,43 +3959,43 @@ void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) {
|
| // would otherwise automatically choose int32, but the actual store
|
| // requires a Smi-tagged value.
|
| HConstant* new_free_space_size = HConstant::CreateAndInsertBefore(
|
| - zone,
|
| - context(),
|
| + block()->isolate(), zone, context(),
|
| filler_free_space_size_->value()->GetInteger32Constant() +
|
| free_space_size,
|
| - Representation::Smi(),
|
| - filler_free_space_size_);
|
| + Representation::Smi(), filler_free_space_size_);
|
| filler_free_space_size_->UpdateValue(new_free_space_size);
|
| }
|
|
|
|
|
| void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) {
|
| DCHECK(filler_free_space_size_ == NULL);
|
| + Isolate* isolate = block()->isolate();
|
| Zone* zone = block()->zone();
|
| HInstruction* free_space_instr =
|
| - HInnerAllocatedObject::New(zone, context(), dominating_allocate_,
|
| - dominating_allocate_->size(), type());
|
| + HInnerAllocatedObject::New(isolate, zone, context(), dominating_allocate_,
|
| + dominating_allocate_->size(), type());
|
| free_space_instr->InsertBefore(this);
|
| HConstant* filler_map = HConstant::CreateAndInsertAfter(
|
| - zone, Unique<Map>::CreateImmovable(
|
| - isolate()->factory()->free_space_map()), true, free_space_instr);
|
| - HInstruction* store_map = HStoreNamedField::New(zone, context(),
|
| - free_space_instr, HObjectAccess::ForMap(), filler_map);
|
| + zone, Unique<Map>::CreateImmovable(isolate->factory()->free_space_map()),
|
| + true, free_space_instr);
|
| + HInstruction* store_map =
|
| + HStoreNamedField::New(isolate, zone, context(), free_space_instr,
|
| + HObjectAccess::ForMap(), filler_map);
|
| store_map->SetFlag(HValue::kHasNoObservableSideEffects);
|
| store_map->InsertAfter(filler_map);
|
|
|
| // We must explicitly force Smi representation here because on x64 we
|
| // would otherwise automatically choose int32, but the actual store
|
| // requires a Smi-tagged value.
|
| - HConstant* filler_size = HConstant::CreateAndInsertAfter(
|
| - zone, context(), free_space_size, Representation::Smi(), store_map);
|
| + HConstant* filler_size =
|
| + HConstant::CreateAndInsertAfter(isolate, zone, context(), free_space_size,
|
| + Representation::Smi(), store_map);
|
| // Must force Smi representation for x64 (see comment above).
|
| - HObjectAccess access =
|
| - HObjectAccess::ForMapAndOffset(isolate()->factory()->free_space_map(),
|
| - FreeSpace::kSizeOffset,
|
| - Representation::Smi());
|
| - HStoreNamedField* store_size = HStoreNamedField::New(zone, context(),
|
| - free_space_instr, access, filler_size);
|
| + HObjectAccess access = HObjectAccess::ForMapAndOffset(
|
| + isolate->factory()->free_space_map(), FreeSpace::kSizeOffset,
|
| + Representation::Smi());
|
| + HStoreNamedField* store_size = HStoreNamedField::New(
|
| + isolate, zone, context(), free_space_instr, access, filler_size);
|
| store_size->SetFlag(HValue::kHasNoObservableSideEffects);
|
| store_size->InsertAfter(filler_size);
|
| filler_free_space_size_ = store_size;
|
| @@ -4020,8 +4008,8 @@ void HAllocate::ClearNextMapWord(int offset) {
|
| HObjectAccess access =
|
| HObjectAccess::ForObservableJSObjectOffset(offset);
|
| HStoreNamedField* clear_next_map =
|
| - HStoreNamedField::New(zone, context(), this, access,
|
| - block()->graph()->GetConstant0());
|
| + HStoreNamedField::New(block()->isolate(), zone, context(), this, access,
|
| + block()->graph()->GetConstant0());
|
| clear_next_map->ClearAllSideEffects();
|
| clear_next_map->InsertAfter(this);
|
| }
|
| @@ -4074,27 +4062,27 @@ bool HStoreKeyed::NeedsCanonicalization() {
|
| }
|
|
|
|
|
| -#define H_CONSTANT_INT(val) \
|
| -HConstant::New(zone, context, static_cast<int32_t>(val))
|
| -#define H_CONSTANT_DOUBLE(val) \
|
| -HConstant::New(zone, context, static_cast<double>(val))
|
| +#define H_CONSTANT_INT(val) \
|
| + HConstant::New(isolate, zone, context, static_cast<int32_t>(val))
|
| +#define H_CONSTANT_DOUBLE(val) \
|
| + HConstant::New(isolate, zone, context, static_cast<double>(val))
|
|
|
| -#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \
|
| -HInstruction* HInstr::New( \
|
| - Zone* zone, HValue* context, HValue* left, HValue* right) { \
|
| - if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
|
| - HConstant* c_left = HConstant::cast(left); \
|
| - HConstant* c_right = HConstant::cast(right); \
|
| - if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
|
| - double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \
|
| - if (IsInt32Double(double_res)) { \
|
| - return H_CONSTANT_INT(double_res); \
|
| - } \
|
| - return H_CONSTANT_DOUBLE(double_res); \
|
| - } \
|
| - } \
|
| - return new(zone) HInstr(context, left, right); \
|
| -}
|
| +#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \
|
| + HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context, \
|
| + HValue* left, HValue* right) { \
|
| + if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
|
| + HConstant* c_left = HConstant::cast(left); \
|
| + HConstant* c_right = HConstant::cast(right); \
|
| + if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
|
| + double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \
|
| + if (IsInt32Double(double_res)) { \
|
| + return H_CONSTANT_INT(double_res); \
|
| + } \
|
| + return H_CONSTANT_DOUBLE(double_res); \
|
| + } \
|
| + } \
|
| + return new (zone) HInstr(context, left, right); \
|
| + }
|
|
|
|
|
| DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HAdd, +)
|
| @@ -4104,10 +4092,8 @@ DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HSub, -)
|
| #undef DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR
|
|
|
|
|
| -HInstruction* HStringAdd::New(Zone* zone,
|
| - HValue* context,
|
| - HValue* left,
|
| - HValue* right,
|
| +HInstruction* HStringAdd::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + HValue* left, HValue* right,
|
| PretenureFlag pretenure_flag,
|
| StringAddFlags flags,
|
| Handle<AllocationSite> allocation_site) {
|
| @@ -4119,9 +4105,9 @@ HInstruction* HStringAdd::New(Zone* zone,
|
| Handle<String> right_string = c_right->StringValue();
|
| // Prevent possible exception by invalid string length.
|
| if (left_string->length() + right_string->length() < String::kMaxLength) {
|
| - MaybeHandle<String> concat = zone->isolate()->factory()->NewConsString(
|
| + MaybeHandle<String> concat = isolate->factory()->NewConsString(
|
| c_left->StringValue(), c_right->StringValue());
|
| - return HConstant::New(zone, context, concat.ToHandleChecked());
|
| + return HConstant::New(isolate, zone, context, concat.ToHandleChecked());
|
| }
|
| }
|
| }
|
| @@ -4148,26 +4134,28 @@ std::ostream& HStringAdd::PrintDataTo(std::ostream& os) const { // NOLINT
|
| }
|
|
|
|
|
| -HInstruction* HStringCharFromCode::New(
|
| - Zone* zone, HValue* context, HValue* char_code) {
|
| +HInstruction* HStringCharFromCode::New(Isolate* isolate, Zone* zone,
|
| + HValue* context, HValue* char_code) {
|
| if (FLAG_fold_constants && char_code->IsConstant()) {
|
| HConstant* c_code = HConstant::cast(char_code);
|
| - Isolate* isolate = zone->isolate();
|
| if (c_code->HasNumberValue()) {
|
| if (std::isfinite(c_code->DoubleValue())) {
|
| uint32_t code = c_code->NumberValueAsInteger32() & 0xffff;
|
| - return HConstant::New(zone, context,
|
| + return HConstant::New(
|
| + isolate, zone, context,
|
| isolate->factory()->LookupSingleCharacterStringFromCode(code));
|
| }
|
| - return HConstant::New(zone, context, isolate->factory()->empty_string());
|
| + return HConstant::New(isolate, zone, context,
|
| + isolate->factory()->empty_string());
|
| }
|
| }
|
| return new(zone) HStringCharFromCode(context, char_code);
|
| }
|
|
|
|
|
| -HInstruction* HUnaryMathOperation::New(
|
| - Zone* zone, HValue* context, HValue* value, BuiltinFunctionId op) {
|
| +HInstruction* HUnaryMathOperation::New(Isolate* isolate, Zone* zone,
|
| + HValue* context, HValue* value,
|
| + BuiltinFunctionId op) {
|
| do {
|
| if (!FLAG_fold_constants) break;
|
| if (!value->IsConstant()) break;
|
| @@ -4271,10 +4259,8 @@ Representation HUnaryMathOperation::RepresentationFromUses() {
|
| }
|
|
|
|
|
| -HInstruction* HPower::New(Zone* zone,
|
| - HValue* context,
|
| - HValue* left,
|
| - HValue* right) {
|
| +HInstruction* HPower::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + HValue* left, HValue* right) {
|
| if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
|
| HConstant* c_left = HConstant::cast(left);
|
| HConstant* c_right = HConstant::cast(right);
|
| @@ -4290,8 +4276,8 @@ HInstruction* HPower::New(Zone* zone,
|
| }
|
|
|
|
|
| -HInstruction* HMathMinMax::New(
|
| - Zone* zone, HValue* context, HValue* left, HValue* right, Operation op) {
|
| +HInstruction* HMathMinMax::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + HValue* left, HValue* right, Operation op) {
|
| if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
|
| HConstant* c_left = HConstant::cast(left);
|
| HConstant* c_right = HConstant::cast(right);
|
| @@ -4323,10 +4309,8 @@ HInstruction* HMathMinMax::New(
|
| }
|
|
|
|
|
| -HInstruction* HMod::New(Zone* zone,
|
| - HValue* context,
|
| - HValue* left,
|
| - HValue* right) {
|
| +HInstruction* HMod::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + HValue* left, HValue* right) {
|
| if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
|
| HConstant* c_left = HConstant::cast(left);
|
| HConstant* c_right = HConstant::cast(right);
|
| @@ -4349,8 +4333,8 @@ HInstruction* HMod::New(Zone* zone,
|
| }
|
|
|
|
|
| -HInstruction* HDiv::New(
|
| - Zone* zone, HValue* context, HValue* left, HValue* right) {
|
| +HInstruction* HDiv::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + HValue* left, HValue* right) {
|
| // If left and right are constant values, try to return a constant value.
|
| if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
|
| HConstant* c_left = HConstant::cast(left);
|
| @@ -4373,8 +4357,8 @@ HInstruction* HDiv::New(
|
| }
|
|
|
|
|
| -HInstruction* HBitwise::New(
|
| - Zone* zone, HValue* context, Token::Value op, HValue* left, HValue* right) {
|
| +HInstruction* HBitwise::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + Token::Value op, HValue* left, HValue* right) {
|
| if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
|
| HConstant* c_left = HConstant::cast(left);
|
| HConstant* c_right = HConstant::cast(right);
|
| @@ -4403,18 +4387,18 @@ HInstruction* HBitwise::New(
|
| }
|
|
|
|
|
| -#define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result) \
|
| -HInstruction* HInstr::New( \
|
| - Zone* zone, HValue* context, HValue* left, HValue* right) { \
|
| - if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
|
| - HConstant* c_left = HConstant::cast(left); \
|
| - HConstant* c_right = HConstant::cast(right); \
|
| - if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
|
| - return H_CONSTANT_INT(result); \
|
| - } \
|
| - } \
|
| - return new(zone) HInstr(context, left, right); \
|
| -}
|
| +#define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result) \
|
| + HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context, \
|
| + HValue* left, HValue* right) { \
|
| + if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
|
| + HConstant* c_left = HConstant::cast(left); \
|
| + HConstant* c_right = HConstant::cast(right); \
|
| + if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \
|
| + return H_CONSTANT_INT(result); \
|
| + } \
|
| + } \
|
| + return new (zone) HInstr(context, left, right); \
|
| + }
|
|
|
|
|
| DEFINE_NEW_H_BITWISE_INSTR(HSar,
|
| @@ -4425,8 +4409,8 @@ c_left->NumberValueAsInteger32() << (c_right->NumberValueAsInteger32() & 0x1f))
|
| #undef DEFINE_NEW_H_BITWISE_INSTR
|
|
|
|
|
| -HInstruction* HShr::New(
|
| - Zone* zone, HValue* context, HValue* left, HValue* right) {
|
| +HInstruction* HShr::New(Isolate* isolate, Zone* zone, HValue* context,
|
| + HValue* left, HValue* right) {
|
| if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
|
| HConstant* c_left = HConstant::cast(left);
|
| HConstant* c_right = HConstant::cast(right);
|
| @@ -4443,11 +4427,9 @@ HInstruction* HShr::New(
|
| }
|
|
|
|
|
| -HInstruction* HSeqStringGetChar::New(Zone* zone,
|
| - HValue* context,
|
| - String::Encoding encoding,
|
| - HValue* string,
|
| - HValue* index) {
|
| +HInstruction* HSeqStringGetChar::New(Isolate* isolate, Zone* zone,
|
| + HValue* context, String::Encoding encoding,
|
| + HValue* string, HValue* index) {
|
| if (FLAG_fold_constants && string->IsConstant() && index->IsConstant()) {
|
| HConstant* c_string = HConstant::cast(string);
|
| HConstant* c_index = HConstant::cast(index);
|
| @@ -4486,9 +4468,9 @@ void HPhi::SimplifyConstantInputs() {
|
| if (operand->HasInteger32Value()) {
|
| continue;
|
| } else if (operand->HasDoubleValue()) {
|
| - HConstant* integer_input =
|
| - HConstant::New(graph->zone(), graph->GetInvalidContext(),
|
| - DoubleToInt32(operand->DoubleValue()));
|
| + HConstant* integer_input = HConstant::New(
|
| + graph->isolate(), graph->zone(), graph->GetInvalidContext(),
|
| + DoubleToInt32(operand->DoubleValue()));
|
| integer_input->InsertAfter(operand);
|
| SetOperandAt(i, integer_input);
|
| } else if (operand->HasBooleanValue()) {
|
|
|