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

Side by Side Diff: src/stub-cache.cc

Issue 819001: Revert change to always call builtins for Array functions.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.h ('k') | src/top.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 check = StubCompiler::BOOLEAN_CHECK; 428 check = StubCompiler::BOOLEAN_CHECK;
429 } 429 }
430 430
431 Code::Flags flags = 431 Code::Flags flags =
432 Code::ComputeMonomorphicFlags(Code::CALL_IC, 432 Code::ComputeMonomorphicFlags(Code::CALL_IC,
433 CONSTANT_FUNCTION, 433 CONSTANT_FUNCTION,
434 in_loop, 434 in_loop,
435 argc); 435 argc);
436 Object* code = map->FindInCodeCache(name, flags); 436 Object* code = map->FindInCodeCache(name, flags);
437 if (code->IsUndefined()) { 437 if (code->IsUndefined()) {
438 if (object->IsJSObject()) {
439 Object* opt =
440 Top::LookupSpecialFunction(JSObject::cast(object), holder, function);
441 if (opt->IsJSFunction()) {
442 check = StubCompiler::JSARRAY_HAS_FAST_ELEMENTS_CHECK;
443 function = JSFunction::cast(opt);
444 }
445 }
438 // If the function hasn't been compiled yet, we cannot do it now 446 // If the function hasn't been compiled yet, we cannot do it now
439 // because it may cause GC. To avoid this issue, we return an 447 // because it may cause GC. To avoid this issue, we return an
440 // internal error which will make sure we do not update any 448 // internal error which will make sure we do not update any
441 // caches. 449 // caches.
442 if (!function->is_compiled()) return Failure::InternalError(); 450 if (!function->is_compiled()) return Failure::InternalError();
443 // Compile the stub - only create stubs for fully compiled functions. 451 // Compile the stub - only create stubs for fully compiled functions.
444 CallStubCompiler compiler(argc, in_loop); 452 CallStubCompiler compiler(argc, in_loop);
445 code = compiler.CompileCallConstant(object, holder, function, name, check); 453 code = compiler.CompileCallConstant(object, holder, function, name, check);
446 if (code->IsFailure()) return code; 454 if (code->IsFailure()) return code;
447 ASSERT_EQ(flags, Code::cast(code)->flags()); 455 ASSERT_EQ(flags, Code::cast(code)->flags());
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 if (!result->IsFailure()) { 1126 if (!result->IsFailure()) {
1119 Code* code = Code::cast(result); 1127 Code* code = Code::cast(result);
1120 USE(code); 1128 USE(code);
1121 LOG(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub")); 1129 LOG(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub"));
1122 } 1130 }
1123 return result; 1131 return result;
1124 } 1132 }
1125 1133
1126 1134
1127 } } // namespace v8::internal 1135 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/top.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698