| Index: src/code-stubs-hydrogen.cc
|
| diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
|
| index 785b9ca9ac679facf17147930569c054e5e7cecd..6bb011829c04e7b07b993e9c56442ce37a2d13a1 100644
|
| --- a/src/code-stubs-hydrogen.cc
|
| +++ b/src/code-stubs-hydrogen.cc
|
| @@ -81,6 +81,11 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
|
| HContext* context() { return context_; }
|
| Isolate* isolate() { return info_.isolate(); }
|
|
|
| + HLoadNamedField* BuildLoadNamedField(HValue* object,
|
| + Representation representation,
|
| + int offset,
|
| + bool is_inobject);
|
| +
|
| enum ArgumentClass {
|
| NONE,
|
| SINGLE,
|
| @@ -247,8 +252,7 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode(Isolate* isolate) {
|
| GetCodeKind(),
|
| GetICState(),
|
| GetExtraICState(),
|
| - GetStubType(),
|
| - GetStubFlags());
|
| + GetStubType());
|
| Handle<Code> new_object = factory->NewCode(
|
| desc, flags, masm.CodeObject(), NeedsImmovableCode());
|
| return new_object;
|
| @@ -323,7 +327,7 @@ template <>
|
| HValue* CodeStubGraphBuilder<NumberToStringStub>::BuildCodeStub() {
|
| info()->MarkAsSavesCallerDoubles();
|
| HValue* number = GetParameter(NumberToStringStub::kNumber);
|
| - return BuildNumberToString(number, Type::Number(isolate()));
|
| + return BuildNumberToString(number, Type::Number(zone()));
|
| }
|
|
|
|
|
| @@ -351,7 +355,8 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
|
|
|
| HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
|
| AllocationSite::kTransitionInfoOffset);
|
| - HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access);
|
| + HInstruction* boilerplate = Add<HLoadNamedField>(
|
| + allocation_site, static_cast<HValue*>(NULL), access);
|
| HValue* push_value;
|
| if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) {
|
| HValue* elements = AddLoadElements(boilerplate);
|
| @@ -421,7 +426,8 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
|
|
|
| HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
|
| AllocationSite::kTransitionInfoOffset);
|
| - HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access);
|
| + HInstruction* boilerplate = Add<HLoadNamedField>(
|
| + allocation_site, static_cast<HValue*>(NULL), access);
|
|
|
| int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
|
| int object_size = size;
|
| @@ -430,9 +436,11 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
|
| }
|
|
|
| HValue* boilerplate_map = Add<HLoadNamedField>(
|
| - boilerplate, HObjectAccess::ForMap());
|
| + boilerplate, static_cast<HValue*>(NULL),
|
| + HObjectAccess::ForMap());
|
| HValue* boilerplate_size = Add<HLoadNamedField>(
|
| - boilerplate_map, HObjectAccess::ForMapInstanceSize());
|
| + boilerplate_map, static_cast<HValue*>(NULL),
|
| + HObjectAccess::ForMapInstanceSize());
|
| HValue* size_in_words = Add<HConstant>(object_size >> kPointerSizeLog2);
|
| checker.If<HCompareNumericAndBranch>(boilerplate_size,
|
| size_in_words, Token::EQ);
|
| @@ -444,9 +452,10 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
|
| NOT_TENURED, JS_OBJECT_TYPE);
|
|
|
| for (int i = 0; i < object_size; i += kPointerSize) {
|
| - HObjectAccess access = HObjectAccess::ForJSObjectOffset(i);
|
| - Add<HStoreNamedField>(object, access,
|
| - Add<HLoadNamedField>(boilerplate, access));
|
| + HObjectAccess access = HObjectAccess::ForObservableJSObjectOffset(i);
|
| + Add<HStoreNamedField>(
|
| + object, access, Add<HLoadNamedField>(
|
| + boilerplate, static_cast<HValue*>(NULL), access));
|
| }
|
|
|
| ASSERT(FLAG_allocation_site_pretenuring || (size == object_size));
|
| @@ -515,8 +524,9 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
|
| // Link the object to the allocation site list
|
| HValue* site_list = Add<HConstant>(
|
| ExternalReference::allocation_sites_list_address(isolate()));
|
| - HValue* site = Add<HLoadNamedField>(site_list,
|
| - HObjectAccess::ForAllocationSiteList());
|
| + HValue* site = Add<HLoadNamedField>(
|
| + site_list, static_cast<HValue*>(NULL),
|
| + HObjectAccess::ForAllocationSiteList());
|
| store = Add<HStoreNamedField>(object,
|
| HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset),
|
| site);
|
| @@ -524,15 +534,11 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
|
| Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
|
| object);
|
|
|
| - // We use a hammer (SkipWriteBarrier()) to indicate that we know the input
|
| - // cell is really a Cell, and so no write barrier is needed.
|
| - // TODO(mvstanton): Add a debug_code check to verify the input cell is really
|
| - // a cell. (perhaps with a new instruction, HAssert).
|
| - HInstruction* cell = GetParameter(0);
|
| - HObjectAccess access = HObjectAccess::ForCellValue();
|
| - store = Add<HStoreNamedField>(cell, access, object);
|
| - store->SkipWriteBarrier();
|
| - return cell;
|
| + HInstruction* feedback_vector = GetParameter(0);
|
| + HInstruction* slot = GetParameter(1);
|
| + Add<HStoreKeyed>(feedback_vector, slot, object, FAST_ELEMENTS,
|
| + INITIALIZING_STORE);
|
| + return feedback_vector;
|
| }
|
|
|
|
|
| @@ -546,7 +552,7 @@ HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
|
| HInstruction* load = BuildUncheckedMonomorphicElementAccess(
|
| GetParameter(0), GetParameter(1), NULL,
|
| casted_stub()->is_js_array(), casted_stub()->elements_kind(),
|
| - false, NEVER_RETURN_HOLE, STANDARD_STORE);
|
| + LOAD, NEVER_RETURN_HOLE, STANDARD_STORE);
|
| return load;
|
| }
|
|
|
| @@ -556,13 +562,32 @@ Handle<Code> KeyedLoadFastElementStub::GenerateCode(Isolate* isolate) {
|
| }
|
|
|
|
|
| +HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
|
| + HValue* object,
|
| + Representation representation,
|
| + int offset,
|
| + bool is_inobject) {
|
| + HObjectAccess access = is_inobject
|
| + ? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
|
| + : HObjectAccess::ForBackingStoreOffset(offset, representation);
|
| + if (representation.IsDouble()) {
|
| + // Load the heap number.
|
| + object = Add<HLoadNamedField>(
|
| + object, static_cast<HValue*>(NULL),
|
| + access.WithRepresentation(Representation::Tagged()));
|
| + // Load the double value from it.
|
| + access = HObjectAccess::ForHeapNumberValue();
|
| + }
|
| + return Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), access);
|
| +}
|
| +
|
| +
|
| template<>
|
| HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() {
|
| - Representation rep = casted_stub()->representation();
|
| - HObjectAccess access = casted_stub()->is_inobject() ?
|
| - HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) :
|
| - HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep);
|
| - return AddLoadNamedField(GetParameter(0), access);
|
| + return BuildLoadNamedField(GetParameter(0),
|
| + casted_stub()->representation(),
|
| + casted_stub()->offset(),
|
| + casted_stub()->is_inobject());
|
| }
|
|
|
|
|
| @@ -573,11 +598,10 @@ Handle<Code> LoadFieldStub::GenerateCode(Isolate* isolate) {
|
|
|
| template<>
|
| HValue* CodeStubGraphBuilder<KeyedLoadFieldStub>::BuildCodeStub() {
|
| - Representation rep = casted_stub()->representation();
|
| - HObjectAccess access = casted_stub()->is_inobject() ?
|
| - HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) :
|
| - HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep);
|
| - return AddLoadNamedField(GetParameter(0), access);
|
| + return BuildLoadNamedField(GetParameter(0),
|
| + casted_stub()->representation(),
|
| + casted_stub()->offset(),
|
| + casted_stub()->is_inobject());
|
| }
|
|
|
|
|
| @@ -586,39 +610,12 @@ Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) {
|
| }
|
|
|
|
|
| -template<>
|
| -HValue* CodeStubGraphBuilder<KeyedArrayCallStub>::BuildCodeStub() {
|
| - int argc = casted_stub()->argc() + 1;
|
| - info()->set_parameter_count(argc);
|
| -
|
| - HValue* receiver = Add<HParameter>(1);
|
| - BuildCheckHeapObject(receiver);
|
| -
|
| - // Load the expected initial array map from the context.
|
| - JSArrayBuilder array_builder(this, casted_stub()->elements_kind());
|
| - HValue* map = array_builder.EmitMapCode();
|
| -
|
| - HValue* checked_receiver = Add<HCheckMapValue>(receiver, map);
|
| -
|
| - HValue* function = BuildUncheckedMonomorphicElementAccess(
|
| - checked_receiver, GetParameter(0),
|
| - NULL, true, casted_stub()->elements_kind(),
|
| - false, NEVER_RETURN_HOLE, STANDARD_STORE);
|
| - return Add<HCallFunction>(function, argc, TAIL_CALL);
|
| -}
|
| -
|
| -
|
| -Handle<Code> KeyedArrayCallStub::GenerateCode(Isolate* isolate) {
|
| - return DoGenerateCode(isolate, this);
|
| -}
|
| -
|
| -
|
| template <>
|
| HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
|
| BuildUncheckedMonomorphicElementAccess(
|
| GetParameter(0), GetParameter(1), GetParameter(2),
|
| casted_stub()->is_js_array(), casted_stub()->elements_kind(),
|
| - true, NEVER_RETURN_HOLE, casted_stub()->store_mode());
|
| + STORE, NEVER_RETURN_HOLE, casted_stub()->store_mode());
|
|
|
| return GetParameter(2);
|
| }
|
| @@ -652,10 +649,7 @@ HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
|
| AllocationSiteOverrideMode override_mode,
|
| ArgumentClass argument_class) {
|
| HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor);
|
| - HValue* property_cell = GetParameter(ArrayConstructorStubBase::kPropertyCell);
|
| - // Walk through the property cell to the AllocationSite
|
| - HValue* alloc_site = Add<HLoadNamedField>(property_cell,
|
| - HObjectAccess::ForCellValue());
|
| + HValue* alloc_site = GetParameter(ArrayConstructorStubBase::kAllocationSite);
|
| JSArrayBuilder array_builder(this, kind, alloc_site, constructor,
|
| override_mode);
|
| HValue* result = NULL;
|
| @@ -844,7 +838,7 @@ HValue* CodeStubGraphBuilder<CompareNilICStub>::BuildCodeInitializedStub() {
|
| CompareNilICStub* stub = casted_stub();
|
| HIfContinuation continuation;
|
| Handle<Map> sentinel_map(isolate->heap()->meta_map());
|
| - Handle<Type> type = stub->GetType(isolate, sentinel_map);
|
| + Type* type = stub->GetType(zone(), sentinel_map);
|
| BuildCompareNil(GetParameter(0), type, &continuation);
|
| IfBuilder if_nil(this, &continuation);
|
| if_nil.Then();
|
| @@ -871,9 +865,9 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
|
| HValue* left = GetParameter(BinaryOpICStub::kLeft);
|
| HValue* right = GetParameter(BinaryOpICStub::kRight);
|
|
|
| - Handle<Type> left_type = state.GetLeftType(isolate());
|
| - Handle<Type> right_type = state.GetRightType(isolate());
|
| - Handle<Type> result_type = state.GetResultType(isolate());
|
| + Type* left_type = state.GetLeftType(zone());
|
| + Type* right_type = state.GetRightType(zone());
|
| + Type* result_type = state.GetResultType(zone());
|
|
|
| ASSERT(!left_type->Is(Type::None()) && !right_type->Is(Type::None()) &&
|
| (state.HasSideEffects() || !result_type->Is(Type::None())));
|
| @@ -892,7 +886,7 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
|
| {
|
| Push(BuildBinaryOperation(
|
| state.op(), left, right,
|
| - Type::String(isolate()), right_type,
|
| + Type::String(zone()), right_type,
|
| result_type, state.fixed_right_arg(),
|
| allocation_mode));
|
| }
|
| @@ -912,7 +906,7 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
|
| {
|
| Push(BuildBinaryOperation(
|
| state.op(), left, right,
|
| - left_type, Type::String(isolate()),
|
| + left_type, Type::String(zone()),
|
| result_type, state.fixed_right_arg(),
|
| allocation_mode));
|
| }
|
| @@ -986,9 +980,9 @@ HValue* CodeStubGraphBuilder<BinaryOpWithAllocationSiteStub>::BuildCodeStub() {
|
| HValue* left = GetParameter(BinaryOpWithAllocationSiteStub::kLeft);
|
| HValue* right = GetParameter(BinaryOpWithAllocationSiteStub::kRight);
|
|
|
| - Handle<Type> left_type = state.GetLeftType(isolate());
|
| - Handle<Type> right_type = state.GetRightType(isolate());
|
| - Handle<Type> result_type = state.GetResultType(isolate());
|
| + Type* left_type = state.GetLeftType(zone());
|
| + Type* right_type = state.GetRightType(zone());
|
| + Type* result_type = state.GetResultType(zone());
|
| HAllocationMode allocation_mode(allocation_site);
|
|
|
| return BuildBinaryOperation(state.op(), left, right,
|
| @@ -1003,13 +997,13 @@ Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode(Isolate* isolate) {
|
|
|
|
|
| template <>
|
| -HValue* CodeStubGraphBuilder<NewStringAddStub>::BuildCodeInitializedStub() {
|
| - NewStringAddStub* stub = casted_stub();
|
| +HValue* CodeStubGraphBuilder<StringAddStub>::BuildCodeInitializedStub() {
|
| + StringAddStub* stub = casted_stub();
|
| StringAddFlags flags = stub->flags();
|
| PretenureFlag pretenure_flag = stub->pretenure_flag();
|
|
|
| - HValue* left = GetParameter(NewStringAddStub::kLeft);
|
| - HValue* right = GetParameter(NewStringAddStub::kRight);
|
| + HValue* left = GetParameter(StringAddStub::kLeft);
|
| + HValue* right = GetParameter(StringAddStub::kRight);
|
|
|
| // Make sure that both arguments are strings if not known in advance.
|
| if ((flags & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) {
|
| @@ -1023,7 +1017,7 @@ HValue* CodeStubGraphBuilder<NewStringAddStub>::BuildCodeInitializedStub() {
|
| }
|
|
|
|
|
| -Handle<Code> NewStringAddStub::GenerateCode(Isolate* isolate) {
|
| +Handle<Code> StringAddStub::GenerateCode(Isolate* isolate) {
|
| return DoGenerateCode(isolate, this);
|
| }
|
|
|
| @@ -1065,7 +1059,8 @@ HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() {
|
|
|
| HValue* cell = Add<HConstant>(placeholder_cell);
|
| HObjectAccess access(HObjectAccess::ForCellPayload(isolate()));
|
| - HValue* cell_contents = Add<HLoadNamedField>(cell, access);
|
| + HValue* cell_contents = Add<HLoadNamedField>(
|
| + cell, static_cast<HValue*>(NULL), access);
|
|
|
| if (stub->is_constant()) {
|
| IfBuilder builder(this);
|
| @@ -1117,7 +1112,7 @@ HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() {
|
| BuildUncheckedMonomorphicElementAccess(object, key, value,
|
| casted_stub()->is_jsarray(),
|
| casted_stub()->to_kind(),
|
| - true, ALLOW_RETURN_HOLE,
|
| + STORE, ALLOW_RETURN_HOLE,
|
| casted_stub()->store_mode());
|
| }
|
|
|
| @@ -1143,7 +1138,8 @@ void CodeStubGraphBuilderBase::BuildInstallOptimizedCode(
|
| Add<HStoreCodeEntry>(js_function, code_object);
|
|
|
| // Now link a function into a list of optimized functions.
|
| - HValue* optimized_functions_list = Add<HLoadNamedField>(native_context,
|
| + HValue* optimized_functions_list = Add<HLoadNamedField>(
|
| + native_context, static_cast<HValue*>(NULL),
|
| HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST));
|
| Add<HStoreNamedField>(js_function,
|
| HObjectAccess::ForNextFunctionLinkPointer(),
|
| @@ -1161,8 +1157,8 @@ void CodeStubGraphBuilderBase::BuildInstallCode(HValue* js_function,
|
| Add<HStoreNamedField>(js_function,
|
| HObjectAccess::ForNextFunctionLinkPointer(),
|
| graph()->GetConstantUndefined());
|
| - HValue* code_object = Add<HLoadNamedField>(shared_info,
|
| - HObjectAccess::ForCodeOffset());
|
| + HValue* code_object = Add<HLoadNamedField>(
|
| + shared_info, static_cast<HValue*>(NULL), HObjectAccess::ForCodeOffset());
|
| Add<HStoreCodeEntry>(js_function, code_object);
|
| }
|
|
|
| @@ -1173,7 +1169,8 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
|
| HValue* native_context) {
|
| Counters* counters = isolate()->counters();
|
| IfBuilder is_optimized(this);
|
| - HInstruction* optimized_map = Add<HLoadNamedField>(shared_info,
|
| + HInstruction* optimized_map = Add<HLoadNamedField>(
|
| + shared_info, static_cast<HValue*>(NULL),
|
| HObjectAccess::ForOptimizedCodeMap());
|
| HValue* null_constant = Add<HConstant>(0);
|
| is_optimized.If<HCompareObjectEqAndBranch>(optimized_map, null_constant);
|
| @@ -1188,9 +1185,11 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
|
| // (native context, optimized code, literals).
|
| // Map must never be empty, so check the first elements.
|
| Label install_optimized;
|
| - HValue* first_context_slot = Add<HLoadNamedField>(optimized_map,
|
| + HValue* first_context_slot = Add<HLoadNamedField>(
|
| + optimized_map, static_cast<HValue*>(NULL),
|
| HObjectAccess::ForFirstContextSlot());
|
| - HValue* first_osr_ast_slot = Add<HLoadNamedField>(optimized_map,
|
| + HValue* first_osr_ast_slot = Add<HLoadNamedField>(
|
| + optimized_map, static_cast<HValue*>(NULL),
|
| HObjectAccess::ForFirstOsrAstIdSlot());
|
| HValue* osr_ast_id_none = Add<HConstant>(BailoutId::None().ToInt());
|
| IfBuilder already_in(this);
|
| @@ -1200,8 +1199,9 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
|
| osr_ast_id_none);
|
| already_in.Then();
|
| {
|
| - HValue* code_object = Add<HLoadNamedField>(optimized_map,
|
| - HObjectAccess::ForFirstCodeSlot());
|
| + HValue* code_object = Add<HLoadNamedField>(
|
| + optimized_map, static_cast<HValue*>(NULL),
|
| + HObjectAccess::ForFirstCodeSlot());
|
| BuildInstallOptimizedCode(js_function, native_context, code_object);
|
| }
|
| already_in.Else();
|
| @@ -1212,7 +1212,8 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
|
| context(),
|
| LoopBuilder::kPostDecrement,
|
| shared_function_entry_length);
|
| - HValue* array_length = Add<HLoadNamedField>(optimized_map,
|
| + HValue* array_length = Add<HLoadNamedField>(
|
| + optimized_map, static_cast<HValue*>(NULL),
|
| HObjectAccess::ForFixedArrayLength());
|
| HValue* slot_iterator = loop_builder.BeginBody(array_length,
|
| graph()->GetConstant0(),
|
| @@ -1295,7 +1296,8 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() {
|
| // Compute the function map in the current native context and set that
|
| // as the map of the allocated object.
|
| HInstruction* native_context = BuildGetNativeContext();
|
| - HInstruction* map_slot_value = Add<HLoadNamedField>(native_context,
|
| + HInstruction* map_slot_value = Add<HLoadNamedField>(
|
| + native_context, static_cast<HValue*>(NULL),
|
| HObjectAccess::ForContextSlot(map_index));
|
| Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value);
|
|
|
| @@ -1333,6 +1335,61 @@ Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
|
|
|
|
|
| template<>
|
| +HValue* CodeStubGraphBuilder<FastNewContextStub>::BuildCodeStub() {
|
| + int length = casted_stub()->slots() + Context::MIN_CONTEXT_SLOTS;
|
| +
|
| + // Get the function.
|
| + HParameter* function = GetParameter(FastNewContextStub::kFunction);
|
| +
|
| + // Allocate the context in new space.
|
| + HAllocate* function_context = Add<HAllocate>(
|
| + Add<HConstant>(length * kPointerSize + FixedArray::kHeaderSize),
|
| + HType::Tagged(), NOT_TENURED, FIXED_ARRAY_TYPE);
|
| +
|
| + // Set up the object header.
|
| + AddStoreMapConstant(function_context,
|
| + isolate()->factory()->function_context_map());
|
| + Add<HStoreNamedField>(function_context,
|
| + HObjectAccess::ForFixedArrayLength(),
|
| + Add<HConstant>(length));
|
| +
|
| + // Set up the fixed slots.
|
| + Add<HStoreNamedField>(function_context,
|
| + HObjectAccess::ForContextSlot(Context::CLOSURE_INDEX),
|
| + function);
|
| + Add<HStoreNamedField>(function_context,
|
| + HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX),
|
| + context());
|
| + Add<HStoreNamedField>(function_context,
|
| + HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX),
|
| + graph()->GetConstant0());
|
| +
|
| + // Copy the global object from the previous context.
|
| + HValue* global_object = Add<HLoadNamedField>(
|
| + context(), static_cast<HValue*>(NULL),
|
| + HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
|
| + Add<HStoreNamedField>(function_context,
|
| + HObjectAccess::ForContextSlot(
|
| + Context::GLOBAL_OBJECT_INDEX),
|
| + global_object);
|
| +
|
| + // Initialize the rest of the slots to undefined.
|
| + for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) {
|
| + Add<HStoreNamedField>(function_context,
|
| + HObjectAccess::ForContextSlot(i),
|
| + graph()->GetConstantUndefined());
|
| + }
|
| +
|
| + return function_context;
|
| +}
|
| +
|
| +
|
| +Handle<Code> FastNewContextStub::GenerateCode(Isolate* isolate) {
|
| + return DoGenerateCode(isolate, this);
|
| +}
|
| +
|
| +
|
| +template<>
|
| HValue* CodeStubGraphBuilder<KeyedLoadDictionaryElementStub>::BuildCodeStub() {
|
| HValue* receiver = GetParameter(0);
|
| HValue* key = GetParameter(1);
|
| @@ -1348,4 +1405,20 @@ Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) {
|
| }
|
|
|
|
|
| +template<>
|
| +HValue* CodeStubGraphBuilder<RegExpConstructResultStub>::BuildCodeStub() {
|
| + // Determine the parameters.
|
| + HValue* length = GetParameter(RegExpConstructResultStub::kLength);
|
| + HValue* index = GetParameter(RegExpConstructResultStub::kIndex);
|
| + HValue* input = GetParameter(RegExpConstructResultStub::kInput);
|
| +
|
| + return BuildRegExpConstructResult(length, index, input);
|
| +}
|
| +
|
| +
|
| +Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) {
|
| + return DoGenerateCode(isolate, this);
|
| +}
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|