Commit 4dbbe078 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[GetIsolate] Remove GetIsolate from src/ic

TBR=jarin@chromium.org

Bug: v8:7786
Change-Id: Ie9615de46298df3fbd8492841a35ad0337dd2ccc
Reviewed-on: https://chromium-review.googlesource.com/1120485Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54134}
parent 1d6d89d0
......@@ -456,7 +456,7 @@ bool AccessInfoFactory::ComputePropertyAccessInfo(
: Handle<AccessorPair>::cast(accessors)->setter(),
isolate());
if (!accessor->IsJSFunction()) {
CallOptimization optimization(accessor);
CallOptimization optimization(isolate(), accessor);
if (!optimization.is_simple_api_call()) return false;
if (optimization.IsCrossContextLazyAccessorPair(*native_context_,
*map)) {
......
......@@ -2874,7 +2874,7 @@ Reduction JSCallReducer::ReduceCallApiFunction(
}
// See if we can constant-fold the compatible receiver checks.
CallOptimization call_optimization(function_template_info);
CallOptimization call_optimization(isolate(), function_template_info);
if (!call_optimization.is_simple_api_call()) return NoChange();
CallOptimization::HolderLookup lookup;
Handle<JSObject> api_holder =
......
......@@ -8,15 +8,15 @@
namespace v8 {
namespace internal {
CallOptimization::CallOptimization(Handle<Object> function) {
CallOptimization::CallOptimization(Isolate* isolate, Handle<Object> function) {
constant_function_ = Handle<JSFunction>::null();
is_simple_api_call_ = false;
expected_receiver_type_ = Handle<FunctionTemplateInfo>::null();
api_call_info_ = Handle<CallHandlerInfo>::null();
if (function->IsJSFunction()) {
Initialize(Handle<JSFunction>::cast(function));
Initialize(isolate, Handle<JSFunction>::cast(function));
} else if (function->IsFunctionTemplateInfo()) {
Initialize(Handle<FunctionTemplateInfo>::cast(function));
Initialize(isolate, Handle<FunctionTemplateInfo>::cast(function));
}
}
......@@ -97,8 +97,7 @@ bool CallOptimization::IsCompatibleReceiverMap(Handle<Map> map,
}
void CallOptimization::Initialize(
Handle<FunctionTemplateInfo> function_template_info) {
Isolate* isolate = function_template_info->GetIsolate();
Isolate* isolate, Handle<FunctionTemplateInfo> function_template_info) {
if (function_template_info->call_code()->IsUndefined(isolate)) return;
api_call_info_ = handle(
CallHandlerInfo::cast(function_template_info->call_code()), isolate);
......@@ -111,17 +110,17 @@ void CallOptimization::Initialize(
is_simple_api_call_ = true;
}
void CallOptimization::Initialize(Handle<JSFunction> function) {
void CallOptimization::Initialize(Isolate* isolate,
Handle<JSFunction> function) {
if (function.is_null() || !function->is_compiled()) return;
constant_function_ = function;
AnalyzePossibleApiFunction(function);
AnalyzePossibleApiFunction(isolate, function);
}
void CallOptimization::AnalyzePossibleApiFunction(Handle<JSFunction> function) {
void CallOptimization::AnalyzePossibleApiFunction(Isolate* isolate,
Handle<JSFunction> function) {
if (!function->shared()->IsApiFunction()) return;
Isolate* isolate = function->GetIsolate();
Handle<FunctionTemplateInfo> info(function->shared()->get_api_func_data(),
isolate);
......
......@@ -14,7 +14,7 @@ namespace internal {
// Holds information about possible function call optimizations.
class CallOptimization BASE_EMBEDDED {
public:
explicit CallOptimization(Handle<Object> function);
CallOptimization(Isolate* isolate, Handle<Object> function);
Context* GetAccessorContext(Map* holder_map) const;
bool IsCrossContextLazyAccessorPair(Context* native_context,
......@@ -52,12 +52,14 @@ class CallOptimization BASE_EMBEDDED {
Handle<JSObject> holder) const;
private:
void Initialize(Handle<JSFunction> function);
void Initialize(Handle<FunctionTemplateInfo> function_template_info);
void Initialize(Isolate* isolate, Handle<JSFunction> function);
void Initialize(Isolate* isolate,
Handle<FunctionTemplateInfo> function_template_info);
// Determines whether the given function can be called using the
// fast api call builtin.
void AnalyzePossibleApiFunction(Handle<JSFunction> function);
void AnalyzePossibleApiFunction(Isolate* isolate,
Handle<JSFunction> function);
Handle<JSFunction> constant_function_;
bool is_simple_api_call_;
......
......@@ -837,7 +837,7 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
Handle<Smi> smi_handler;
CallOptimization call_optimization(getter);
CallOptimization call_optimization(isolate(), getter);
if (call_optimization.is_simple_api_call()) {
if (!call_optimization.IsCompatibleReceiverMap(map, holder) ||
!holder->HasFastProperties()) {
......@@ -1570,7 +1570,7 @@ MaybeObjectHandle StoreIC::ComputeHandler(LookupIterator* lookup) {
return MaybeObjectHandle(slow_stub());
}
CallOptimization call_optimization(setter);
CallOptimization call_optimization(isolate(), setter);
if (call_optimization.is_simple_api_call()) {
if (call_optimization.IsCompatibleReceiver(receiver, holder)) {
CallOptimization::HolderLookup holder_lookup;
......
......@@ -61,8 +61,8 @@ bool CommonStubCacheChecks(StubCache* stub_cache, Name* name, Map* map,
MaybeObject* handler) {
// Validate that the name and handler do not move on scavenge, and that we
// can use identity checks instead of structural equality checks.
DCHECK(!name->GetHeap()->InNewSpace(name));
DCHECK(!name->GetHeap()->InNewSpace(handler));
DCHECK(!stub_cache->isolate()->heap()->InNewSpace(name));
DCHECK(!stub_cache->isolate()->heap()->InNewSpace(handler));
DCHECK(name->IsUniqueName());
DCHECK(name->HasHashCode());
if (handler) DCHECK(IC::IsHandler(handler));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment