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

Side by Side Diff: src/deoptimizer.cc

Issue 1998143002: [deoptimizer] Support materialization of closures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/deoptimizer.h" 5 #include "src/deoptimizer.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
(...skipping 3693 matching lines...) Expand 10 before | Expand all | Expand 10 after
3704 isolate_->factory()->NewJSArray(0, map->elements_kind()); 3704 isolate_->factory()->NewJSArray(0, map->elements_kind());
3705 slot->value_ = object; 3705 slot->value_ = object;
3706 Handle<Object> properties = MaterializeAt(frame_index, value_index); 3706 Handle<Object> properties = MaterializeAt(frame_index, value_index);
3707 Handle<Object> elements = MaterializeAt(frame_index, value_index); 3707 Handle<Object> elements = MaterializeAt(frame_index, value_index);
3708 Handle<Object> length = MaterializeAt(frame_index, value_index); 3708 Handle<Object> length = MaterializeAt(frame_index, value_index);
3709 object->set_properties(FixedArray::cast(*properties)); 3709 object->set_properties(FixedArray::cast(*properties));
3710 object->set_elements(FixedArrayBase::cast(*elements)); 3710 object->set_elements(FixedArrayBase::cast(*elements));
3711 object->set_length(*length); 3711 object->set_length(*length);
3712 return object; 3712 return object;
3713 } 3713 }
3714 case JS_FUNCTION_TYPE: {
3715 Handle<JSFunction> object =
3716 isolate_->factory()->NewFunctionFromSharedFunctionInfo(
3717 handle(isolate_->object_function()->shared()),
3718 handle(isolate_->context()));
Jarin 2016/05/20 08:15:24 Don't you want to add a comment about the temporar
Michael Starzinger 2016/05/20 08:32:39 Done.
3719 slot->value_ = object;
3720 Handle<Object> properties = MaterializeAt(frame_index, value_index);
3721 Handle<Object> elements = MaterializeAt(frame_index, value_index);
3722 Handle<Object> prototype = MaterializeAt(frame_index, value_index);
3723 Handle<Object> shared = MaterializeAt(frame_index, value_index);
3724 Handle<Object> context = MaterializeAt(frame_index, value_index);
3725 Handle<Object> literals = MaterializeAt(frame_index, value_index);
3726 Handle<Object> entry = MaterializeAt(frame_index, value_index);
3727 Handle<Object> next_link = MaterializeAt(frame_index, value_index);
3728 object->ReplaceCode(*isolate_->builtins()->CompileLazy());
3729 object->set_map(*map);
3730 object->set_properties(FixedArray::cast(*properties));
3731 object->set_elements(FixedArrayBase::cast(*elements));
3732 object->set_prototype_or_initial_map(*prototype);
3733 object->set_shared(SharedFunctionInfo::cast(*shared));
3734 object->set_context(Context::cast(*context));
3735 object->set_literals(LiteralsArray::cast(*literals));
3736 CHECK(entry->IsNumber()); // Entry to compile lazy stub.
3737 CHECK(next_link->IsUndefined());
3738 return object;
3739 }
3714 case FIXED_ARRAY_TYPE: { 3740 case FIXED_ARRAY_TYPE: {
3715 Handle<Object> lengthObject = MaterializeAt(frame_index, value_index); 3741 Handle<Object> lengthObject = MaterializeAt(frame_index, value_index);
3716 int32_t length = 0; 3742 int32_t length = 0;
3717 CHECK(lengthObject->ToInt32(&length)); 3743 CHECK(lengthObject->ToInt32(&length));
3718 Handle<FixedArray> object = 3744 Handle<FixedArray> object =
3719 isolate_->factory()->NewFixedArray(length); 3745 isolate_->factory()->NewFixedArray(length);
3720 // We need to set the map, because the fixed array we are 3746 // We need to set the map, because the fixed array we are
3721 // materializing could be a context or an arguments object, 3747 // materializing could be a context or an arguments object,
3722 // in which case we must retain that information. 3748 // in which case we must retain that information.
3723 object->set_map(*map); 3749 object->set_map(*map);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3933 CHECK(value_info->IsMaterializedObject()); 3959 CHECK(value_info->IsMaterializedObject());
3934 3960
3935 value_info->value_ = 3961 value_info->value_ =
3936 Handle<Object>(previously_materialized_objects->get(i), isolate_); 3962 Handle<Object>(previously_materialized_objects->get(i), isolate_);
3937 } 3963 }
3938 } 3964 }
3939 } 3965 }
3940 3966
3941 } // namespace internal 3967 } // namespace internal
3942 } // namespace v8 3968 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698