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

Unified Diff: src/hydrogen-instructions.cc

Issue 16925008: Generate StoreGlobal stubs with Hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use pointer -> handle trampoline Created 7 years, 5 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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 08837c04fa66b7733f90c2c2464cab9222d1beb8..7406f9c602c9417a9e1c68e1b1607fc257460e4f 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2174,6 +2174,7 @@ HConstant::HConstant(Handle<Object> handle, Representation r)
has_double_value_(false),
is_internalized_string_(false),
is_not_in_new_space_(true),
+ is_cell_(false),
boolean_value_(handle->BooleanValue()) {
if (handle_->IsHeapObject()) {
Heap* heap = Handle<HeapObject>::cast(handle)->GetHeap();
@@ -2190,6 +2191,9 @@ HConstant::HConstant(Handle<Object> handle, Representation r)
type_from_value_ = HType::TypeFromValue(handle_);
is_internalized_string_ = handle_->IsInternalizedString();
}
+
+ is_cell_ = !handle_.is_null() &&
+ (handle_->IsCell() || handle_->IsPropertyCell());
Initialize(r);
}
@@ -2200,6 +2204,7 @@ HConstant::HConstant(Handle<Object> handle,
HType type,
bool is_internalize_string,
bool is_not_in_new_space,
+ bool is_cell,
bool boolean_value)
: handle_(handle),
unique_id_(unique_id),
@@ -2208,6 +2213,7 @@ HConstant::HConstant(Handle<Object> handle,
has_double_value_(false),
is_internalized_string_(is_internalize_string),
is_not_in_new_space_(is_not_in_new_space),
+ is_cell_(is_cell),
boolean_value_(boolean_value),
type_from_value_(type) {
ASSERT(!handle.is_null());
@@ -2227,6 +2233,7 @@ HConstant::HConstant(int32_t integer_value,
has_double_value_(true),
is_internalized_string_(false),
is_not_in_new_space_(is_not_in_new_space),
+ is_cell_(false),
boolean_value_(integer_value != 0),
int32_value_(integer_value),
double_value_(FastI2D(integer_value)) {
@@ -2245,6 +2252,7 @@ HConstant::HConstant(double double_value,
has_double_value_(true),
is_internalized_string_(false),
is_not_in_new_space_(is_not_in_new_space),
+ is_cell_(false),
boolean_value_(double_value != 0 && !std::isnan(double_value)),
int32_value_(DoubleToInt32(double_value)),
double_value_(double_value) {
@@ -2267,9 +2275,17 @@ void HConstant::Initialize(Representation r) {
}
set_representation(r);
SetFlag(kUseGVN);
- if (representation().IsInteger32()) {
- ClearGVNFlag(kDependsOnOsrEntries);
+}
+
+
+bool HConstant::EmitAtUses() {
+ ASSERT(IsLinked());
+ if (block()->graph()->has_osr_loop_entry()) {
+ return block()->graph()->IsStandardConstant(this);
}
+ if (IsCell()) return false;
+ if (representation().IsDouble()) return false;
+ return true;
}
@@ -2290,6 +2306,7 @@ HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
type_from_value_,
is_internalized_string_,
is_not_in_new_space_,
+ is_cell_,
boolean_value_);
}
@@ -3829,6 +3846,13 @@ HObjectAccess HObjectAccess::ForField(Handle<Map> map,
}
+HObjectAccess HObjectAccess::ForCellPayload(Isolate* isolate) {
+ return HObjectAccess(
+ kInobject, Cell::kValueOffset,
+ Handle<String>(isolate->heap()->cell_value_string()));
+}
+
+
void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) {
// set the appropriate GVN flags for a given load or store instruction
if (is_store) {
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698