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

Unified Diff: src/hydrogen.cc

Issue 18154004: Replace custom builtin invocation instructions by a generic version (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase 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 fa6dd72ec06261889731cdee8619e0847fed7133..074ca17fe101efbf5ceb08f4dcfceb16cdaadf11 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1957,7 +1957,7 @@ HStoreNamedField* HGraphBuilder::AddStoreMapConstant(HValue *object,
HValue* HGraphBuilder::AddLoadJSBuiltin(Builtins::JavaScript builtin,
- HContext* context) {
+ HValue* context) {
HGlobalObject* global_object = Add<HGlobalObject>(context);
HObjectAccess access = HObjectAccess::ForJSObjectOffset(
GlobalObject::kBuiltinsOffset);
@@ -7628,7 +7628,13 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) {
HValue* key = Pop();
HValue* obj = Pop();
HValue* context = environment()->LookupContext();
- HDeleteProperty* instr = new(zone()) HDeleteProperty(context, obj, key);
+ HValue* function = AddLoadJSBuiltin(Builtins::DELETE, context);
+ Add<HPushArgument>(obj);
+ Add<HPushArgument>(key);
+ Add<HPushArgument>(Add<HConstant>(function_strict_mode_flag()));
+ // TODO(olivf) InvokeFunction produces a check for the parameter count,
+ // even though we are certain to pass the correct number of arguments here.
+ HInstruction* instr = new(zone()) HInvokeFunction(context, function, 3);
return ast_context()->ReturnInstruction(instr, expr->id());
} else if (proxy != NULL) {
Variable* var = proxy->var();
@@ -8441,7 +8447,12 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
// Code below assumes that we don't fall through.
UNREACHABLE();
} else if (op == Token::IN) {
- HIn* result = new(zone()) HIn(context, left, right);
+ HValue* function = AddLoadJSBuiltin(Builtins::IN, context);
+ Add<HPushArgument>(left);
+ Add<HPushArgument>(right);
+ // TODO(olivf) InvokeFunction produces a check for the parameter count,
+ // even though we are certain to pass the correct number of arguments here.
+ HInstruction* result = new(zone()) HInvokeFunction(context, function, 2);
result->set_position(expr->position());
return ast_context()->ReturnInstruction(result, expr->id());
}
« 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