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

Unified Diff: src/hydrogen.cc

Issue 19493005: Avoid adding HWrapReceiver during graph building. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('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 57220e0de1e5cf77641235343b45aba12249cb8a..db0b5ea331b8867c4ce4c53719bd7baa4a912db9 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1043,14 +1043,19 @@ HValue* HGraphBuilder::BuildCheckHeapObject(HValue* obj) {
}
-HValue* HGraphBuilder::BuildCheckMap(HValue* obj,
- Handle<Map> map) {
+HValue* HGraphBuilder::BuildCheckMap(HValue* obj, Handle<Map> map) {
HCheckMaps* check = HCheckMaps::New(obj, map, zone());
AddInstruction(check);
return check;
}
+HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) {
+ if (object->type().IsJSObject()) return object;
+ return Add<HWrapReceiver>(object, function);
+}
+
+
HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object,
HValue* elements,
ElementsKind kind,
@@ -6881,7 +6886,7 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
if (function_state()->outer() == NULL) {
HInstruction* elements = Add<HArgumentsElements>(false);
HInstruction* length = Add<HArgumentsLength>(elements);
- HValue* wrapped_receiver = Add<HWrapReceiver>(receiver, function);
+ HValue* wrapped_receiver = BuildWrapReceiver(receiver, function);
HInstruction* result =
new(zone()) HApplyArguments(function,
wrapped_receiver,
@@ -6898,7 +6903,7 @@ bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
HArgumentsObject* args = function_state()->entry()->arguments_object();
const ZoneList<HValue*>* arguments_values = args->arguments_values();
int arguments_count = arguments_values->length();
- PushAndAdd(new(zone()) HWrapReceiver(receiver, function));
+ Push(BuildWrapReceiver(receiver, function));
for (int i = 1; i < arguments_count; i++) {
Push(arguments_values->at(i));
}
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698