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

Issue 9365013: Inline builtin Math functions functions in more cases. (Closed)

Created:
8 years, 10 months ago by fschneider
Modified:
8 years, 10 months ago
CC:
v8-dev
Visibility:
Public.

Description

Inline builtin Math functions functions in more cases. Until now we only could inline as specialized HIR instructions when called as a method (e.g. Math.abs) It is very common practice to abbreviate calls to those functions by defining a global or local variable like: var a = Math.abs; var x = a(123); This change allows inlining them when called as a function (global or local). Committed: https://code.google.com/p/v8/source/detail?r=10640

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 5

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+387 lines, -10 lines) Patch
M src/hydrogen.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/hydrogen.cc View 1 2 5 chunks +63 lines, -9 lines 0 comments Download
A test/mjsunit/compiler/math-floor-global.js View 1 2 1 chunk +161 lines, -0 lines 0 comments Download
A test/mjsunit/compiler/math-floor-local.js View 1 2 1 chunk +161 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
fschneider
8 years, 10 months ago (2012-02-08 10:40:25 UTC) #1
Vyacheslav Egorov (Chromium)
lgtm https://chromiumcodereview.appspot.com/9365013/diff/3002/src/hydrogen.cc File src/hydrogen.cc (right): https://chromiumcodereview.appspot.com/9365013/diff/3002/src/hydrogen.cc#newcode5061 src/hydrogen.cc:5061: bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra) { maybe it's ...
8 years, 10 months ago (2012-02-08 10:50:59 UTC) #2
fschneider
8 years, 10 months ago (2012-02-08 11:45:17 UTC) #3
https://chromiumcodereview.appspot.com/9365013/diff/3002/src/hydrogen.cc
File src/hydrogen.cc (right):

https://chromiumcodereview.appspot.com/9365013/diff/3002/src/hydrogen.cc#newc...
src/hydrogen.cc:5073: if (argument_count == 2) {
On 2012/02/08 10:50:59, Vyacheslav Egorov wrote:
> I think you can just use expr->arguments()->length() == 1 here.

Done.

https://chromiumcodereview.appspot.com/9365013/diff/3002/src/hydrogen.cc#newc...
src/hydrogen.cc:5080: if (drop_extra) Drop(1);  // Optionally drop the function.
On 2012/02/08 10:50:59, Vyacheslav Egorov wrote:
> It would be good to add test case that ensures that we deopt from inside
> LUnaryMathOperation with correct environment.

Done.

Powered by Google App Engine
This is Rietveld 408576698