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

Unified Diff: src/hydrogen-instructions.cc

Issue 14159028: Fixed an issue with HConstant::InNewSpace() for parallel compilation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Be able to recognize if running on the optimizer thread Created 7 years, 8 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
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index aadf87572df411eb5d8c9c9aeb1ce8b985010aea..d47c6efc67d2ba8f3defc21776c6153d454cdde0 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2073,6 +2073,7 @@ HConstant::HConstant(Handle<Object> handle, Representation r)
type_from_value_ = HType::TypeFromValue(handle_);
is_internalized_string_ = handle_->IsInternalizedString();
}
+
if (r.IsNone()) {
if (has_int32_value_) {
r = Representation::Integer32();
@@ -2142,34 +2143,56 @@ void HConstant::Initialize(Representation r) {
if (representation().IsInteger32()) {
ClearGVNFlag(kDependsOnOsrEntries);
}
+
+ // TODO(mvstanton): pass isolate as a parameter
+ Isolate* isolate = Isolate::Current();
+ if (handle_.is_null()) {
+ guaranteed_in_old_space_ = true;
+ } else if (!isolate->optimizing_compiler_thread()->IsOptimizerThread()) {
+ ALLOW_HANDLE_DEREF(isolate, "using raw address");
+ guaranteed_in_old_space_ = !(isolate->heap()->InNewSpace(*handle_));
+ } else {
+ guaranteed_in_old_space_ = false;
+ }
}
HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
if (r.IsInteger32() && !has_int32_value_) return NULL;
if (r.IsDouble() && !has_double_value_) return NULL;
- if (has_int32_value_) return new(zone) HConstant(int32_value_, r, handle_);
- if (has_double_value_) return new(zone) HConstant(double_value_, r, handle_);
- ASSERT(!handle_.is_null());
- return new(zone) HConstant(handle_,
- unique_id_,
- r,
- type_from_value_,
- is_internalized_string_,
- boolean_value_);
+ HConstant* result;
+ if (has_int32_value_) {
+ result = new(zone) HConstant(int32_value_, r, handle_);
+ } else if (has_double_value_) {
+ result = new(zone) HConstant(double_value_, r, handle_);
+ } else {
+ ASSERT(!handle_.is_null());
+ result = new(zone) HConstant(handle_,
+ unique_id_,
+ r,
+ type_from_value_,
+ is_internalized_string_,
+ boolean_value_);
+ }
+ result->set_guaranteed_in_old_space(guaranteed_in_old_space_);
+ return result;
}
HConstant* HConstant::CopyToTruncatedInt32(Zone* zone) const {
+ HConstant* result;
if (has_int32_value_) {
- return new(zone) HConstant(
+ result = new(zone) HConstant(
int32_value_, Representation::Integer32(), handle_);
- }
- if (has_double_value_) {
- return new(zone) HConstant(
+ } else if (has_double_value_) {
+ result = new(zone) HConstant(
DoubleToInt32(double_value_), Representation::Integer32(), handle_);
+ } else {
+ return NULL;
}
- return NULL;
+
+ result->set_guaranteed_in_old_space(guaranteed_in_old_space_);
+ return result;
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698