| OLD | NEW |
| 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 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2358 | 2358 |
| 2359 | 2359 |
| 2360 static bool IsInteger32(double value) { | 2360 static bool IsInteger32(double value) { |
| 2361 double roundtrip_value = static_cast<double>(static_cast<int32_t>(value)); | 2361 double roundtrip_value = static_cast<double>(static_cast<int32_t>(value)); |
| 2362 return BitCast<int64_t>(roundtrip_value) == BitCast<int64_t>(value); | 2362 return BitCast<int64_t>(roundtrip_value) == BitCast<int64_t>(value); |
| 2363 } | 2363 } |
| 2364 | 2364 |
| 2365 | 2365 |
| 2366 HConstant::HConstant(Handle<Object> handle, Representation r) | 2366 HConstant::HConstant(Handle<Object> handle, Representation r) |
| 2367 : HTemplateInstruction<0>(HType::TypeFromValue(handle)), | 2367 : HTemplateInstruction<0>(HType::TypeFromValue(handle)), |
| 2368 handle_(handle), | 2368 object_(Unique<Object>::CreateUninitialized(handle)), |
| 2369 unique_id_(), | |
| 2370 has_smi_value_(false), | 2369 has_smi_value_(false), |
| 2371 has_int32_value_(false), | 2370 has_int32_value_(false), |
| 2372 has_double_value_(false), | 2371 has_double_value_(false), |
| 2373 has_external_reference_value_(false), | 2372 has_external_reference_value_(false), |
| 2374 is_internalized_string_(false), | 2373 is_internalized_string_(false), |
| 2375 is_not_in_new_space_(true), | 2374 is_not_in_new_space_(true), |
| 2376 is_cell_(false), | 2375 is_cell_(false), |
| 2377 boolean_value_(handle->BooleanValue()) { | 2376 boolean_value_(handle->BooleanValue()) { |
| 2378 if (handle_->IsHeapObject()) { | 2377 if (handle->IsHeapObject()) { |
| 2379 Heap* heap = Handle<HeapObject>::cast(handle)->GetHeap(); | 2378 Heap* heap = Handle<HeapObject>::cast(handle)->GetHeap(); |
| 2380 is_not_in_new_space_ = !heap->InNewSpace(*handle); | 2379 is_not_in_new_space_ = !heap->InNewSpace(*handle); |
| 2381 } | 2380 } |
| 2382 if (handle_->IsNumber()) { | 2381 if (handle->IsNumber()) { |
| 2383 double n = handle_->Number(); | 2382 double n = handle->Number(); |
| 2384 has_int32_value_ = IsInteger32(n); | 2383 has_int32_value_ = IsInteger32(n); |
| 2385 int32_value_ = DoubleToInt32(n); | 2384 int32_value_ = DoubleToInt32(n); |
| 2386 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); | 2385 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); |
| 2387 double_value_ = n; | 2386 double_value_ = n; |
| 2388 has_double_value_ = true; | 2387 has_double_value_ = true; |
| 2389 } else { | 2388 } else { |
| 2390 is_internalized_string_ = handle_->IsInternalizedString(); | 2389 is_internalized_string_ = handle->IsInternalizedString(); |
| 2391 } | 2390 } |
| 2392 | 2391 |
| 2393 is_cell_ = !handle_.is_null() && | 2392 is_cell_ = !handle.is_null() && |
| 2394 (handle_->IsCell() || handle_->IsPropertyCell()); | 2393 (handle->IsCell() || handle->IsPropertyCell()); |
| 2395 Initialize(r); | 2394 Initialize(r); |
| 2396 } | 2395 } |
| 2397 | 2396 |
| 2398 | 2397 |
| 2399 HConstant::HConstant(Handle<Object> handle, | 2398 HConstant::HConstant(Unique<Object> unique, |
| 2400 UniqueValueId unique_id, | |
| 2401 Representation r, | 2399 Representation r, |
| 2402 HType type, | 2400 HType type, |
| 2403 bool is_internalize_string, | 2401 bool is_internalize_string, |
| 2404 bool is_not_in_new_space, | 2402 bool is_not_in_new_space, |
| 2405 bool is_cell, | 2403 bool is_cell, |
| 2406 bool boolean_value) | 2404 bool boolean_value) |
| 2407 : HTemplateInstruction<0>(type), | 2405 : HTemplateInstruction<0>(type), |
| 2408 handle_(handle), | 2406 object_(unique), |
| 2409 unique_id_(unique_id), | |
| 2410 has_smi_value_(false), | 2407 has_smi_value_(false), |
| 2411 has_int32_value_(false), | 2408 has_int32_value_(false), |
| 2412 has_double_value_(false), | 2409 has_double_value_(false), |
| 2413 has_external_reference_value_(false), | 2410 has_external_reference_value_(false), |
| 2414 is_internalized_string_(is_internalize_string), | 2411 is_internalized_string_(is_internalize_string), |
| 2415 is_not_in_new_space_(is_not_in_new_space), | 2412 is_not_in_new_space_(is_not_in_new_space), |
| 2416 is_cell_(is_cell), | 2413 is_cell_(is_cell), |
| 2417 boolean_value_(boolean_value) { | 2414 boolean_value_(boolean_value) { |
| 2418 ASSERT(!handle.is_null()); | 2415 ASSERT(!unique.handle().is_null()); |
| 2419 ASSERT(!type.IsTaggedNumber()); | 2416 ASSERT(!type.IsTaggedNumber()); |
| 2420 Initialize(r); | 2417 Initialize(r); |
| 2421 } | 2418 } |
| 2422 | 2419 |
| 2423 | 2420 |
| 2424 HConstant::HConstant(Handle<Map> handle, | |
| 2425 UniqueValueId unique_id) | |
| 2426 : HTemplateInstruction<0>(HType::Tagged()), | |
| 2427 handle_(handle), | |
| 2428 unique_id_(unique_id), | |
| 2429 has_smi_value_(false), | |
| 2430 has_int32_value_(false), | |
| 2431 has_double_value_(false), | |
| 2432 has_external_reference_value_(false), | |
| 2433 is_internalized_string_(false), | |
| 2434 is_not_in_new_space_(true), | |
| 2435 is_cell_(false), | |
| 2436 boolean_value_(false) { | |
| 2437 ASSERT(!handle.is_null()); | |
| 2438 Initialize(Representation::Tagged()); | |
| 2439 } | |
| 2440 | |
| 2441 | |
| 2442 HConstant::HConstant(int32_t integer_value, | 2421 HConstant::HConstant(int32_t integer_value, |
| 2443 Representation r, | 2422 Representation r, |
| 2444 bool is_not_in_new_space, | 2423 bool is_not_in_new_space, |
| 2445 Handle<Object> optional_handle) | 2424 Unique<Object> object) |
| 2446 : handle_(optional_handle), | 2425 : object_(object), |
| 2447 unique_id_(), | |
| 2448 has_smi_value_(Smi::IsValid(integer_value)), | 2426 has_smi_value_(Smi::IsValid(integer_value)), |
| 2449 has_int32_value_(true), | 2427 has_int32_value_(true), |
| 2450 has_double_value_(true), | 2428 has_double_value_(true), |
| 2451 has_external_reference_value_(false), | 2429 has_external_reference_value_(false), |
| 2452 is_internalized_string_(false), | 2430 is_internalized_string_(false), |
| 2453 is_not_in_new_space_(is_not_in_new_space), | 2431 is_not_in_new_space_(is_not_in_new_space), |
| 2454 is_cell_(false), | 2432 is_cell_(false), |
| 2455 boolean_value_(integer_value != 0), | 2433 boolean_value_(integer_value != 0), |
| 2456 int32_value_(integer_value), | 2434 int32_value_(integer_value), |
| 2457 double_value_(FastI2D(integer_value)) { | 2435 double_value_(FastI2D(integer_value)) { |
| 2458 set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); | 2436 set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); |
| 2459 Initialize(r); | 2437 Initialize(r); |
| 2460 } | 2438 } |
| 2461 | 2439 |
| 2462 | 2440 |
| 2463 HConstant::HConstant(double double_value, | 2441 HConstant::HConstant(double double_value, |
| 2464 Representation r, | 2442 Representation r, |
| 2465 bool is_not_in_new_space, | 2443 bool is_not_in_new_space, |
| 2466 Handle<Object> optional_handle) | 2444 Unique<Object> object) |
| 2467 : handle_(optional_handle), | 2445 : object_(object), |
| 2468 unique_id_(), | |
| 2469 has_int32_value_(IsInteger32(double_value)), | 2446 has_int32_value_(IsInteger32(double_value)), |
| 2470 has_double_value_(true), | 2447 has_double_value_(true), |
| 2471 has_external_reference_value_(false), | 2448 has_external_reference_value_(false), |
| 2472 is_internalized_string_(false), | 2449 is_internalized_string_(false), |
| 2473 is_not_in_new_space_(is_not_in_new_space), | 2450 is_not_in_new_space_(is_not_in_new_space), |
| 2474 is_cell_(false), | 2451 is_cell_(false), |
| 2475 boolean_value_(double_value != 0 && !std::isnan(double_value)), | 2452 boolean_value_(double_value != 0 && !std::isnan(double_value)), |
| 2476 int32_value_(DoubleToInt32(double_value)), | 2453 int32_value_(DoubleToInt32(double_value)), |
| 2477 double_value_(double_value) { | 2454 double_value_(double_value) { |
| 2478 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); | 2455 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); |
| 2479 set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); | 2456 set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); |
| 2480 Initialize(r); | 2457 Initialize(r); |
| 2481 } | 2458 } |
| 2482 | 2459 |
| 2483 | 2460 |
| 2484 HConstant::HConstant(ExternalReference reference) | 2461 HConstant::HConstant(ExternalReference reference) |
| 2485 : HTemplateInstruction<0>(HType::None()), | 2462 : HTemplateInstruction<0>(HType::None()), |
| 2463 object_(Unique<Object>(Handle<Object>::null())), |
| 2486 has_smi_value_(false), | 2464 has_smi_value_(false), |
| 2487 has_int32_value_(false), | 2465 has_int32_value_(false), |
| 2488 has_double_value_(false), | 2466 has_double_value_(false), |
| 2489 has_external_reference_value_(true), | 2467 has_external_reference_value_(true), |
| 2490 is_internalized_string_(false), | 2468 is_internalized_string_(false), |
| 2491 is_not_in_new_space_(true), | 2469 is_not_in_new_space_(true), |
| 2492 is_cell_(false), | 2470 is_cell_(false), |
| 2493 boolean_value_(true), | 2471 boolean_value_(true), |
| 2494 external_reference_value_(reference) { | 2472 external_reference_value_(reference) { |
| 2495 Initialize(Representation::External()); | 2473 Initialize(Representation::External()); |
| 2496 } | 2474 } |
| 2497 | 2475 |
| 2498 | 2476 |
| 2499 static void PrepareConstant(Handle<Object> object) { | |
| 2500 if (!object->IsJSObject()) return; | |
| 2501 Handle<JSObject> js_object = Handle<JSObject>::cast(object); | |
| 2502 if (!js_object->map()->is_deprecated()) return; | |
| 2503 JSObject::TryMigrateInstance(js_object); | |
| 2504 } | |
| 2505 | |
| 2506 | |
| 2507 void HConstant::Initialize(Representation r) { | 2477 void HConstant::Initialize(Representation r) { |
| 2508 if (r.IsNone()) { | 2478 if (r.IsNone()) { |
| 2509 if (has_smi_value_ && SmiValuesAre31Bits()) { | 2479 if (has_smi_value_ && SmiValuesAre31Bits()) { |
| 2510 r = Representation::Smi(); | 2480 r = Representation::Smi(); |
| 2511 } else if (has_int32_value_) { | 2481 } else if (has_int32_value_) { |
| 2512 r = Representation::Integer32(); | 2482 r = Representation::Integer32(); |
| 2513 } else if (has_double_value_) { | 2483 } else if (has_double_value_) { |
| 2514 r = Representation::Double(); | 2484 r = Representation::Double(); |
| 2515 } else if (has_external_reference_value_) { | 2485 } else if (has_external_reference_value_) { |
| 2516 r = Representation::External(); | 2486 r = Representation::External(); |
| 2517 } else { | 2487 } else { |
| 2518 PrepareConstant(handle_); | 2488 Handle<Object> object = object_.handle(); |
| 2489 if (object->IsJSObject()) { |
| 2490 // Try to eagerly migrate JSObjects that have deprecated maps. |
| 2491 Handle<JSObject> js_object = Handle<JSObject>::cast(object); |
| 2492 if (js_object->map()->is_deprecated()) { |
| 2493 JSObject::TryMigrateInstance(js_object); |
| 2494 } |
| 2495 } |
| 2519 r = Representation::Tagged(); | 2496 r = Representation::Tagged(); |
| 2520 } | 2497 } |
| 2521 } | 2498 } |
| 2522 set_representation(r); | 2499 set_representation(r); |
| 2523 SetFlag(kUseGVN); | 2500 SetFlag(kUseGVN); |
| 2524 } | 2501 } |
| 2525 | 2502 |
| 2526 | 2503 |
| 2527 bool HConstant::EmitAtUses() { | 2504 bool HConstant::EmitAtUses() { |
| 2528 ASSERT(IsLinked()); | 2505 ASSERT(IsLinked()); |
| 2529 if (block()->graph()->has_osr() && | 2506 if (block()->graph()->has_osr() && |
| 2530 block()->graph()->IsStandardConstant(this)) { | 2507 block()->graph()->IsStandardConstant(this)) { |
| 2531 return true; | 2508 return true; |
| 2532 } | 2509 } |
| 2533 if (UseCount() == 0) return true; | 2510 if (UseCount() == 0) return true; |
| 2534 if (IsCell()) return false; | 2511 if (IsCell()) return false; |
| 2535 if (representation().IsDouble()) return false; | 2512 if (representation().IsDouble()) return false; |
| 2536 return true; | 2513 return true; |
| 2537 } | 2514 } |
| 2538 | 2515 |
| 2539 | 2516 |
| 2540 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const { | 2517 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const { |
| 2541 if (r.IsSmi() && !has_smi_value_) return NULL; | 2518 if (r.IsSmi() && !has_smi_value_) return NULL; |
| 2542 if (r.IsInteger32() && !has_int32_value_) return NULL; | 2519 if (r.IsInteger32() && !has_int32_value_) return NULL; |
| 2543 if (r.IsDouble() && !has_double_value_) return NULL; | 2520 if (r.IsDouble() && !has_double_value_) return NULL; |
| 2544 if (r.IsExternal() && !has_external_reference_value_) return NULL; | 2521 if (r.IsExternal() && !has_external_reference_value_) return NULL; |
| 2545 if (has_int32_value_) { | 2522 if (has_int32_value_) { |
| 2546 return new(zone) HConstant(int32_value_, r, is_not_in_new_space_, handle_); | 2523 return new(zone) HConstant(int32_value_, r, is_not_in_new_space_, object_); |
| 2547 } | 2524 } |
| 2548 if (has_double_value_) { | 2525 if (has_double_value_) { |
| 2549 return new(zone) HConstant(double_value_, r, is_not_in_new_space_, handle_); | 2526 return new(zone) HConstant(double_value_, r, is_not_in_new_space_, object_); |
| 2550 } | 2527 } |
| 2551 if (has_external_reference_value_) { | 2528 if (has_external_reference_value_) { |
| 2552 return new(zone) HConstant(external_reference_value_); | 2529 return new(zone) HConstant(external_reference_value_); |
| 2553 } | 2530 } |
| 2554 ASSERT(!handle_.is_null()); | 2531 ASSERT(!object_.handle().is_null()); |
| 2555 return new(zone) HConstant(handle_, | 2532 return new(zone) HConstant(object_, |
| 2556 unique_id_, | |
| 2557 r, | 2533 r, |
| 2558 type_, | 2534 type_, |
| 2559 is_internalized_string_, | 2535 is_internalized_string_, |
| 2560 is_not_in_new_space_, | 2536 is_not_in_new_space_, |
| 2561 is_cell_, | 2537 is_cell_, |
| 2562 boolean_value_); | 2538 boolean_value_); |
| 2563 } | 2539 } |
| 2564 | 2540 |
| 2565 | 2541 |
| 2566 Maybe<HConstant*> HConstant::CopyToTruncatedInt32(Zone* zone) { | 2542 Maybe<HConstant*> HConstant::CopyToTruncatedInt32(Zone* zone) { |
| 2567 HConstant* res = NULL; | 2543 HConstant* res = NULL; |
| 2568 if (has_int32_value_) { | 2544 if (has_int32_value_) { |
| 2569 res = new(zone) HConstant(int32_value_, | 2545 res = new(zone) HConstant(int32_value_, |
| 2570 Representation::Integer32(), | 2546 Representation::Integer32(), |
| 2571 is_not_in_new_space_, | 2547 is_not_in_new_space_, |
| 2572 handle_); | 2548 object_); |
| 2573 } else if (has_double_value_) { | 2549 } else if (has_double_value_) { |
| 2574 res = new(zone) HConstant(DoubleToInt32(double_value_), | 2550 res = new(zone) HConstant(DoubleToInt32(double_value_), |
| 2575 Representation::Integer32(), | 2551 Representation::Integer32(), |
| 2576 is_not_in_new_space_, | 2552 is_not_in_new_space_, |
| 2577 handle_); | 2553 object_); |
| 2578 } | 2554 } |
| 2579 return Maybe<HConstant*>(res != NULL, res); | 2555 return Maybe<HConstant*>(res != NULL, res); |
| 2580 } | 2556 } |
| 2581 | 2557 |
| 2582 | 2558 |
| 2583 Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Zone* zone) { | 2559 Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Zone* zone) { |
| 2584 HConstant* res = NULL; | 2560 HConstant* res = NULL; |
| 2585 Handle<Object> handle = this->handle(zone->isolate()); | 2561 Handle<Object> handle = this->handle(zone->isolate()); |
| 2586 if (handle->IsBoolean()) { | 2562 if (handle->IsBoolean()) { |
| 2587 res = handle->BooleanValue() ? | 2563 res = handle->BooleanValue() ? |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3128 object()->PrintNameTo(stream); | 3104 object()->PrintNameTo(stream); |
| 3129 stream->Add("["); | 3105 stream->Add("["); |
| 3130 key()->PrintNameTo(stream); | 3106 key()->PrintNameTo(stream); |
| 3131 stream->Add("] = "); | 3107 stream->Add("] = "); |
| 3132 value()->PrintNameTo(stream); | 3108 value()->PrintNameTo(stream); |
| 3133 } | 3109 } |
| 3134 | 3110 |
| 3135 | 3111 |
| 3136 void HTransitionElementsKind::PrintDataTo(StringStream* stream) { | 3112 void HTransitionElementsKind::PrintDataTo(StringStream* stream) { |
| 3137 object()->PrintNameTo(stream); | 3113 object()->PrintNameTo(stream); |
| 3138 ElementsKind from_kind = original_map()->elements_kind(); | 3114 ElementsKind from_kind = original_map().handle()->elements_kind(); |
| 3139 ElementsKind to_kind = transitioned_map()->elements_kind(); | 3115 ElementsKind to_kind = transitioned_map().handle()->elements_kind(); |
| 3140 stream->Add(" %p [%s] -> %p [%s]", | 3116 stream->Add(" %p [%s] -> %p [%s]", |
| 3141 *original_map(), | 3117 *original_map().handle(), |
| 3142 ElementsAccessor::ForKind(from_kind)->name(), | 3118 ElementsAccessor::ForKind(from_kind)->name(), |
| 3143 *transitioned_map(), | 3119 *transitioned_map().handle(), |
| 3144 ElementsAccessor::ForKind(to_kind)->name()); | 3120 ElementsAccessor::ForKind(to_kind)->name()); |
| 3145 if (IsSimpleMapChangeTransition(from_kind, to_kind)) stream->Add(" (simple)"); | 3121 if (IsSimpleMapChangeTransition(from_kind, to_kind)) stream->Add(" (simple)"); |
| 3146 } | 3122 } |
| 3147 | 3123 |
| 3148 | 3124 |
| 3149 void HLoadGlobalCell::PrintDataTo(StringStream* stream) { | 3125 void HLoadGlobalCell::PrintDataTo(StringStream* stream) { |
| 3150 stream->Add("[%p]", *cell()); | 3126 stream->Add("[%p]", *cell().handle()); |
| 3151 if (!details_.IsDontDelete()) stream->Add(" (deleteable)"); | 3127 if (!details_.IsDontDelete()) stream->Add(" (deleteable)"); |
| 3152 if (details_.IsReadOnly()) stream->Add(" (read-only)"); | 3128 if (details_.IsReadOnly()) stream->Add(" (read-only)"); |
| 3153 } | 3129 } |
| 3154 | 3130 |
| 3155 | 3131 |
| 3156 bool HLoadGlobalCell::RequiresHoleCheck() const { | 3132 bool HLoadGlobalCell::RequiresHoleCheck() const { |
| 3157 if (details_.IsDontDelete() && !details_.IsReadOnly()) return false; | 3133 if (details_.IsDontDelete() && !details_.IsReadOnly()) return false; |
| 3158 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { | 3134 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { |
| 3159 HValue* use = it.value(); | 3135 HValue* use = it.value(); |
| 3160 if (!use->IsChange()) return true; | 3136 if (!use->IsChange()) return true; |
| 3161 } | 3137 } |
| 3162 return false; | 3138 return false; |
| 3163 } | 3139 } |
| 3164 | 3140 |
| 3165 | 3141 |
| 3166 void HLoadGlobalGeneric::PrintDataTo(StringStream* stream) { | 3142 void HLoadGlobalGeneric::PrintDataTo(StringStream* stream) { |
| 3167 stream->Add("%o ", *name()); | 3143 stream->Add("%o ", *name()); |
| 3168 } | 3144 } |
| 3169 | 3145 |
| 3170 | 3146 |
| 3171 void HInnerAllocatedObject::PrintDataTo(StringStream* stream) { | 3147 void HInnerAllocatedObject::PrintDataTo(StringStream* stream) { |
| 3172 base_object()->PrintNameTo(stream); | 3148 base_object()->PrintNameTo(stream); |
| 3173 stream->Add(" offset %d", offset()); | 3149 stream->Add(" offset %d", offset()); |
| 3174 } | 3150 } |
| 3175 | 3151 |
| 3176 | 3152 |
| 3177 void HStoreGlobalCell::PrintDataTo(StringStream* stream) { | 3153 void HStoreGlobalCell::PrintDataTo(StringStream* stream) { |
| 3178 stream->Add("[%p] = ", *cell()); | 3154 stream->Add("[%p] = ", *cell().handle()); |
| 3179 value()->PrintNameTo(stream); | 3155 value()->PrintNameTo(stream); |
| 3180 if (!details_.IsDontDelete()) stream->Add(" (deleteable)"); | 3156 if (!details_.IsDontDelete()) stream->Add(" (deleteable)"); |
| 3181 if (details_.IsReadOnly()) stream->Add(" (read-only)"); | 3157 if (details_.IsReadOnly()) stream->Add(" (read-only)"); |
| 3182 } | 3158 } |
| 3183 | 3159 |
| 3184 | 3160 |
| 3185 void HStoreGlobalGeneric::PrintDataTo(StringStream* stream) { | 3161 void HStoreGlobalGeneric::PrintDataTo(StringStream* stream) { |
| 3186 stream->Add("%o = ", *name()); | 3162 stream->Add("%o = ", *name()); |
| 3187 value()->PrintNameTo(stream); | 3163 value()->PrintNameTo(stream); |
| 3188 } | 3164 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3434 Zone* zone = block()->zone(); | 3410 Zone* zone = block()->zone(); |
| 3435 int32_t dominator_size = | 3411 int32_t dominator_size = |
| 3436 HConstant::cast(dominating_allocate_->size())->GetInteger32Constant(); | 3412 HConstant::cast(dominating_allocate_->size())->GetInteger32Constant(); |
| 3437 HInstruction* free_space_instr = | 3413 HInstruction* free_space_instr = |
| 3438 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, | 3414 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, |
| 3439 dominator_size, type()); | 3415 dominator_size, type()); |
| 3440 free_space_instr->InsertBefore(this); | 3416 free_space_instr->InsertBefore(this); |
| 3441 HConstant* filler_map = HConstant::New( | 3417 HConstant* filler_map = HConstant::New( |
| 3442 zone, | 3418 zone, |
| 3443 context(), | 3419 context(), |
| 3444 isolate()->factory()->free_space_map(), | 3420 isolate()->factory()->free_space_map()); |
| 3445 UniqueValueId::free_space_map(isolate()->heap())); | 3421 filler_map->FinalizeUniqueness(); // TODO(titzer): should be init'd a'ready |
| 3446 filler_map->InsertAfter(free_space_instr); | 3422 filler_map->InsertAfter(free_space_instr); |
| 3447 HInstruction* store_map = HStoreNamedField::New(zone, context(), | 3423 HInstruction* store_map = HStoreNamedField::New(zone, context(), |
| 3448 free_space_instr, HObjectAccess::ForMap(), filler_map); | 3424 free_space_instr, HObjectAccess::ForMap(), filler_map); |
| 3449 store_map->SetFlag(HValue::kHasNoObservableSideEffects); | 3425 store_map->SetFlag(HValue::kHasNoObservableSideEffects); |
| 3450 store_map->InsertAfter(filler_map); | 3426 store_map->InsertAfter(filler_map); |
| 3451 | 3427 |
| 3452 // We must explicitly force Smi representation here because on x64 we | 3428 // We must explicitly force Smi representation here because on x64 we |
| 3453 // would otherwise automatically choose int32, but the actual store | 3429 // would otherwise automatically choose int32, but the actual store |
| 3454 // requires a Smi-tagged value. | 3430 // requires a Smi-tagged value. |
| 3455 HConstant* filler_size = HConstant::CreateAndInsertAfter( | 3431 HConstant* filler_size = HConstant::CreateAndInsertAfter( |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4225 break; | 4201 break; |
| 4226 case kExternalMemory: | 4202 case kExternalMemory: |
| 4227 stream->Add("[external-memory]"); | 4203 stream->Add("[external-memory]"); |
| 4228 break; | 4204 break; |
| 4229 } | 4205 } |
| 4230 | 4206 |
| 4231 stream->Add("@%d", offset()); | 4207 stream->Add("@%d", offset()); |
| 4232 } | 4208 } |
| 4233 | 4209 |
| 4234 } } // namespace v8::internal | 4210 } } // namespace v8::internal |
| OLD | NEW |