Reviewers: Michael Starzinger, Erik Corry,
https://chromiumcodereview.appspot.com/9956060/diff/1/src/objects.cc
File src/objects.cc (right):
https://chromiumcodereview.appspot.com/9956060/diff/1/src/objects.cc#newcode7873
src/objects.cc:7873: if (code()->kind() == Code::FUNCTION) {
Another kind that can appear here is Code::BUILTIN.
Builtins implemented in assembly have such kind.
Builtins implemented in javasript have kind Code::FUNCTION.
For example, d8 outputs the following for the EQUALS builtin implemented
in javascript:
--- Code ---
kind = FUNCTION
name = EQUALS
Instructions (size = 2076)
[ function compiled by full code generator
Description:
Check code kind when resetting profiler ticks.
BUG=121147
TEST=chromium gpu_tests/WebGLConformanceTests
Please review this at https://chromiumcodereview.appspot.com/9956060/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/objects.cc
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
58a34634a7ffc4842ac7a6fa6114002cacdca85b..d99338cbcff22df1ab574f0991df1094a8384063
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -7869,14 +7869,17 @@ void SharedFunctionInfo::AttachInitialMap(Map* map)
{
void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
code()->ClearInlineCaches();
- code()->set_profiler_ticks(0);
set_ic_age(new_ic_age);
- if (optimization_disabled() && opt_count() >=
Compiler::kDefaultMaxOptCount) {
- // Re-enable optimizations if they were disabled due to opt_count
limit.
- set_optimization_disabled(false);
- code()->set_optimizable(true);
+ if (code()->kind() == Code::FUNCTION) {
+ code()->set_profiler_ticks(0);
+ if (optimization_disabled() &&
+ opt_count() >= Compiler::kDefaultMaxOptCount) {
+ // Re-enable optimizations if they were disabled due to opt_count
limit.
+ set_optimization_disabled(false);
+ code()->set_optimizable(true);
+ }
+ set_opt_count(0);
}
- set_opt_count(0);
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev