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

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

Issue 131363008: A64: Synchronize with r15922. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/token.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 Handle<Code> handler = 328 Handle<Code> handler =
329 compiler.CompileLoadViaGetter(receiver, holder, name, getter); 329 compiler.CompileLoadViaGetter(receiver, holder, name, getter);
330 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 330 JSObject::UpdateMapCodeCache(stub_holder, name, handler);
331 return handler; 331 return handler;
332 } 332 }
333 333
334 334
335 Handle<Code> StubCache::ComputeLoadConstant(Handle<Name> name, 335 Handle<Code> StubCache::ComputeLoadConstant(Handle<Name> name,
336 Handle<JSObject> receiver, 336 Handle<JSObject> receiver,
337 Handle<JSObject> holder, 337 Handle<JSObject> holder,
338 Handle<JSFunction> value) { 338 Handle<Object> value) {
339 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 339 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
340 Handle<Code> handler = FindLoadHandler( 340 Handle<Code> handler = FindLoadHandler(
341 name, receiver, stub_holder, Code::LOAD_IC, Code::CONSTANT_FUNCTION); 341 name, receiver, stub_holder, Code::LOAD_IC, Code::CONSTANT);
342 if (!handler.is_null()) return handler; 342 if (!handler.is_null()) return handler;
343 343
344 LoadStubCompiler compiler(isolate_); 344 LoadStubCompiler compiler(isolate_);
345 handler = compiler.CompileLoadConstant(receiver, holder, name, value); 345 handler = compiler.CompileLoadConstant(receiver, holder, name, value);
346 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 346 JSObject::UpdateMapCodeCache(stub_holder, name, handler);
347 347
348 return handler; 348 return handler;
349 } 349 }
350 350
351 351
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 Handle<Code> handler = 410 Handle<Code> handler =
411 compiler.CompileLoadField(receiver, holder, name, field, representation); 411 compiler.CompileLoadField(receiver, holder, name, field, representation);
412 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 412 JSObject::UpdateMapCodeCache(stub_holder, name, handler);
413 return handler; 413 return handler;
414 } 414 }
415 415
416 416
417 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<Name> name, 417 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<Name> name,
418 Handle<JSObject> receiver, 418 Handle<JSObject> receiver,
419 Handle<JSObject> holder, 419 Handle<JSObject> holder,
420 Handle<JSFunction> value) { 420 Handle<Object> value) {
421 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 421 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
422 Handle<Code> handler = FindLoadHandler( 422 Handle<Code> handler = FindLoadHandler(
423 name, receiver, stub_holder, Code::KEYED_LOAD_IC, 423 name, receiver, stub_holder, Code::KEYED_LOAD_IC,
424 Code::CONSTANT_FUNCTION); 424 Code::CONSTANT);
425 if (!handler.is_null()) return handler; 425 if (!handler.is_null()) return handler;
426 426
427 KeyedLoadStubCompiler compiler(isolate_); 427 KeyedLoadStubCompiler compiler(isolate_);
428 handler = compiler.CompileLoadConstant(receiver, holder, name, value); 428 handler = compiler.CompileLoadConstant(receiver, holder, name, value);
429 JSObject::UpdateMapCodeCache(stub_holder, name, handler); 429 JSObject::UpdateMapCodeCache(stub_holder, name, handler);
430 return handler; 430 return handler;
431 } 431 }
432 432
433 433
434 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<Name> name, 434 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<Name> name,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 691
692 if (check != RECEIVER_MAP_CHECK && 692 if (check != RECEIVER_MAP_CHECK &&
693 !function->IsBuiltin() && 693 !function->IsBuiltin() &&
694 function->shared()->is_classic_mode()) { 694 function->shared()->is_classic_mode()) {
695 // Calling non-strict non-builtins with a value as the receiver 695 // Calling non-strict non-builtins with a value as the receiver
696 // requires boxing. 696 // requires boxing.
697 return Handle<Code>::null(); 697 return Handle<Code>::null();
698 } 698 }
699 699
700 Code::Flags flags = Code::ComputeMonomorphicFlags( 700 Code::Flags flags = Code::ComputeMonomorphicFlags(
701 kind, extra_state, Code::CONSTANT_FUNCTION, argc, cache_holder); 701 kind, extra_state, Code::CONSTANT, argc, cache_holder);
702 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), 702 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
703 isolate_); 703 isolate_);
704 if (probe->IsCode()) return Handle<Code>::cast(probe); 704 if (probe->IsCode()) return Handle<Code>::cast(probe);
705 705
706 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); 706 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder);
707 Handle<Code> code = 707 Handle<Code> code =
708 compiler.CompileCallConstant(object, holder, name, check, function); 708 compiler.CompileCallConstant(object, holder, name, check, function);
709 code->set_check_type(check); 709 code->set_check_type(check);
710 ASSERT(flags == code->flags()); 710 ASSERT(flags == code->flags());
711 PROFILE(isolate_, 711 PROFILE(isolate_,
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 1612
1613 // Return the generated code. 1613 // Return the generated code.
1614 return GetCode(kind(), Code::FIELD, name); 1614 return GetCode(kind(), Code::FIELD, name);
1615 } 1615 }
1616 1616
1617 1617
1618 Handle<Code> BaseLoadStubCompiler::CompileLoadConstant( 1618 Handle<Code> BaseLoadStubCompiler::CompileLoadConstant(
1619 Handle<JSObject> object, 1619 Handle<JSObject> object,
1620 Handle<JSObject> holder, 1620 Handle<JSObject> holder,
1621 Handle<Name> name, 1621 Handle<Name> name,
1622 Handle<JSFunction> value) { 1622 Handle<Object> value) {
1623 Label success; 1623 Label success;
1624 HandlerFrontend(object, receiver(), holder, name, &success); 1624 HandlerFrontend(object, receiver(), holder, name, &success);
1625 __ bind(&success); 1625 __ bind(&success);
1626 GenerateLoadConstant(value); 1626 GenerateLoadConstant(value);
1627 1627
1628 // Return the generated code. 1628 // Return the generated code.
1629 return GetCode(kind(), Code::CONSTANT_FUNCTION, name); 1629 return GetCode(kind(), Code::CONSTANT, name);
1630 } 1630 }
1631 1631
1632 1632
1633 Handle<Code> BaseLoadStubCompiler::CompileLoadCallback( 1633 Handle<Code> BaseLoadStubCompiler::CompileLoadCallback(
1634 Handle<JSObject> object, 1634 Handle<JSObject> object,
1635 Handle<JSObject> holder, 1635 Handle<JSObject> holder,
1636 Handle<Name> name, 1636 Handle<Name> name,
1637 Handle<ExecutableAccessorInfo> callback) { 1637 Handle<ExecutableAccessorInfo> callback) {
1638 Label success; 1638 Label success;
1639 1639
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 receiver_map->FindTransitionedMap(receiver_maps); 1985 receiver_map->FindTransitionedMap(receiver_maps);
1986 1986
1987 // TODO(mvstanton): The code below is doing pessimistic elements 1987 // TODO(mvstanton): The code below is doing pessimistic elements
1988 // transitions. I would like to stop doing that and rely on Allocation Site 1988 // transitions. I would like to stop doing that and rely on Allocation Site
1989 // Tracking to do a better job of ensuring the data types are what they need 1989 // Tracking to do a better job of ensuring the data types are what they need
1990 // to be. Not all the elements are in place yet, pessimistic elements 1990 // to be. Not all the elements are in place yet, pessimistic elements
1991 // transitions are still important for performance. 1991 // transitions are still important for performance.
1992 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 1992 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
1993 ElementsKind elements_kind = receiver_map->elements_kind(); 1993 ElementsKind elements_kind = receiver_map->elements_kind();
1994 if (!transitioned_map.is_null()) { 1994 if (!transitioned_map.is_null()) {
1995 if (FLAG_compiled_transitions) { 1995 cached_stub = ElementsTransitionAndStoreStub(
1996 cached_stub = ElementsTransitionAndStoreStub( 1996 elements_kind,
1997 elements_kind, 1997 transitioned_map->elements_kind(),
1998 transitioned_map->elements_kind(), 1998 is_js_array,
1999 is_js_array, 1999 store_mode_).GetCode(isolate());
2000 store_mode_).GetCode(isolate());
2001 } else {
2002 // TODO(bmeurer) Remove this when compiled transitions is enabled
2003 cached_stub = ElementsTransitionAndStorePlatformStub(
2004 elements_kind,
2005 transitioned_map->elements_kind(),
2006 is_js_array,
2007 strict_mode(),
2008 store_mode_).GetCode(isolate());
2009 }
2010 } else { 2000 } else {
2011 if (FLAG_compiled_keyed_stores && 2001 if (FLAG_compiled_keyed_stores &&
2012 (receiver_map->has_fast_elements() || 2002 (receiver_map->has_fast_elements() ||
2013 receiver_map->has_external_array_elements())) { 2003 receiver_map->has_external_array_elements())) {
2014 cached_stub = KeyedStoreFastElementStub( 2004 cached_stub = KeyedStoreFastElementStub(
2015 is_js_array, 2005 is_js_array,
2016 elements_kind, 2006 elements_kind,
2017 store_mode_).GetCode(isolate()); 2007 store_mode_).GetCode(isolate());
2018 } else { 2008 } else {
2019 cached_stub = KeyedStoreElementStub( 2009 cached_stub = KeyedStoreElementStub(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 cache_holder_); 2113 cache_holder_);
2124 return GetCodeWithFlags(flags, name); 2114 return GetCodeWithFlags(flags, name);
2125 } 2115 }
2126 2116
2127 2117
2128 Handle<Code> CallStubCompiler::GetCode(Handle<JSFunction> function) { 2118 Handle<Code> CallStubCompiler::GetCode(Handle<JSFunction> function) {
2129 Handle<String> function_name; 2119 Handle<String> function_name;
2130 if (function->shared()->name()->IsString()) { 2120 if (function->shared()->name()->IsString()) {
2131 function_name = Handle<String>(String::cast(function->shared()->name())); 2121 function_name = Handle<String>(String::cast(function->shared()->name()));
2132 } 2122 }
2133 return GetCode(Code::CONSTANT_FUNCTION, function_name); 2123 return GetCode(Code::CONSTANT, function_name);
2134 } 2124 }
2135 2125
2136 2126
2137 CallOptimization::CallOptimization(LookupResult* lookup) { 2127 CallOptimization::CallOptimization(LookupResult* lookup) {
2138 if (lookup->IsFound() && 2128 if (lookup->IsFound() &&
2139 lookup->IsCacheable() && 2129 lookup->IsCacheable() &&
2140 lookup->type() == CONSTANT_FUNCTION) { 2130 lookup->IsConstantFunction()) {
2141 // We only optimize constant function calls. 2131 // We only optimize constant function calls.
2142 Initialize(Handle<JSFunction>(lookup->GetConstantFunction())); 2132 Initialize(Handle<JSFunction>(lookup->GetConstantFunction()));
2143 } else { 2133 } else {
2144 Initialize(Handle<JSFunction>::null()); 2134 Initialize(Handle<JSFunction>::null());
2145 } 2135 }
2146 } 2136 }
2147 2137
2148 2138
2149 CallOptimization::CallOptimization(Handle<JSFunction> function) { 2139 CallOptimization::CallOptimization(Handle<JSFunction> function) {
2150 Initialize(function); 2140 Initialize(function);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 Handle<FunctionTemplateInfo>( 2191 Handle<FunctionTemplateInfo>(
2202 FunctionTemplateInfo::cast(signature->receiver())); 2192 FunctionTemplateInfo::cast(signature->receiver()));
2203 } 2193 }
2204 } 2194 }
2205 2195
2206 is_simple_api_call_ = true; 2196 is_simple_api_call_ = true;
2207 } 2197 }
2208 2198
2209 2199
2210 } } // namespace v8::internal 2200 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698