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

Unified Diff: src/stub-cache.cc

Issue 146003006: Revert broken ArrayPop changes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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/stub-cache.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index f715573556257b93a5b268a6b357d3e1c3ce5109..89ed586c642665239ede225cc29de7044c5e4392 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -1282,6 +1282,41 @@ void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
}
+Handle<Code> CallStubCompiler::CompileArrayPushCall(
+ Handle<Object> object,
+ Handle<JSObject> holder,
+ Handle<Cell> cell,
+ Handle<JSFunction> function,
+ Handle<String> name,
+ Code::StubType type) {
+ // If object is not an array or is observed or sealed, bail out to regular
+ // call.
+ if (!object->IsJSArray() ||
+ !cell.is_null() ||
+ Handle<JSArray>::cast(object)->map()->is_observed() ||
+ !Handle<JSArray>::cast(object)->map()->is_extensible()) {
+ return Handle<Code>::null();
+ }
+
+ Label miss;
+
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
+
+ Handle<Map> map(Handle<JSArray>::cast(object)->map());
+ ElementsKind elements_kind = map->elements_kind();
+ const int argc = arguments().immediate();
+
+ ArrayPushStub stub(elements_kind, argc);
+ Handle<Code> code = stub.GetCode(isolate());
+ StubCompiler::GenerateTailCall(masm(), code);
+
+ HandlerFrontendFooter(&miss);
+
+ // Return the generated code.
+ return GetCode(type, name);
+}
+
+
Handle<Code> CallStubCompiler::CompileCallConstant(
Handle<Object> object,
Handle<JSObject> holder,
@@ -1878,6 +1913,13 @@ CallStubCompiler::CallStubCompiler(Isolate* isolate,
bool CallStubCompiler::HasCustomCallGenerator(Handle<JSFunction> function) {
+ if (function->shared()->HasBuiltinFunctionId()) {
+ BuiltinFunctionId id = function->shared()->builtin_function_id();
+#define CALL_GENERATOR_CASE(name) if (id == k##name) return true;
+ CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
+#undef CALL_GENERATOR_CASE
+ }
+
CallOptimization optimization(function);
return optimization.is_simple_api_call();
}
@@ -1891,6 +1933,21 @@ Handle<Code> CallStubCompiler::CompileCustomCall(
Handle<String> fname,
Code::StubType type) {
ASSERT(HasCustomCallGenerator(function));
+
+ if (function->shared()->HasBuiltinFunctionId()) {
+ BuiltinFunctionId id = function->shared()->builtin_function_id();
+#define CALL_GENERATOR_CASE(name) \
+ if (id == k##name) { \
+ return CallStubCompiler::Compile##name##Call(object, \
+ holder, \
+ cell, \
+ function, \
+ fname, \
+ type); \
+ }
+ CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
+#undef CALL_GENERATOR_CASE
+ }
CallOptimization optimization(function);
ASSERT(optimization.is_simple_api_call());
return CompileFastApiCall(optimization,
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698