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

Unified Diff: src/hydrogen.cc

Issue 112913002: Split up HLoadNamedField and HStoreNamedField. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | « no previous file | src/hydrogen-check-elimination.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 176dd9fa77a04f8c401cef6fd8da191bd736cefa..911ff266e6f096ef5ebe48498fea902c80fc647a 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5236,6 +5236,11 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
bool transition_to_field = lookup->IsTransitionToField(*map);
HStoreNamedField *instr;
+ HValue* store_target = checked_object->ActualValue();
+ if (!field_access.IsInobject()) {
+ store_target = Add<HLoadNamedField>(
+ store_target, HObjectAccess::ForBackingStore());
+ }
if (FLAG_track_double_fields && field_access.representation().IsDouble()) {
HObjectAccess heap_number_access =
field_access.WithRepresentation(Representation::Tagged());
@@ -5249,32 +5254,27 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map());
Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
value);
- instr = New<HStoreNamedField>(checked_object->ActualValue(),
- heap_number_access,
- heap_number);
+ instr = New<HStoreNamedField>(
+ store_target, heap_number_access, heap_number);
} 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>(
+ store_target, heap_number_access);
heap_number->set_type(HType::HeapNumber());
- instr = New<HStoreNamedField>(heap_number,
- HObjectAccess::ForHeapNumberValue(),
- value);
+ instr = New<HStoreNamedField>(
+ heap_number, HObjectAccess::ForHeapNumberValue(), value);
}
} else {
// This is a normal store.
- instr = New<HStoreNamedField>(checked_object->ActualValue(),
- field_access,
- value);
+ instr = New<HStoreNamedField>(store_target, field_access, value);
}
if (transition_to_field) {
Handle<Map> transition(lookup->GetTransitionMapFromMap(*map));
HConstant* transition_constant = Add<HConstant>(transition);
- instr->SetTransition(transition_constant, top_info());
- // TODO(fschneider): Record the new map type of the object in the IR to
- // enable elimination of redundant checks after the transition store.
- instr->SetGVNFlag(kChangesMaps);
+ Add<HStoreNamedField>(
+ checked_object, HObjectAccess::ForMap(), transition_constant);
+ instr->SetTransition(transition, top_info());
}
return instr;
}
@@ -6125,6 +6125,9 @@ void HOptimizedGraphBuilder::VisitThrow(Throw* expr) {
HLoadNamedField* HGraphBuilder::BuildLoadNamedField(HValue* object,
HObjectAccess access) {
+ if (!access.IsInobject()) {
+ object = Add<HLoadNamedField>(object, HObjectAccess::ForBackingStore());
+ }
if (FLAG_track_double_fields && access.representation().IsDouble()) {
// load the heap number
HLoadNamedField* heap_number = Add<HLoadNamedField>(
« no previous file with comments | « no previous file | src/hydrogen-check-elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698