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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 143633007: A64: Synchronize with r18764. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.cc ('k') | src/codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 785b9ca9ac679facf17147930569c054e5e7cecd..5b1ae39c7dd6727cf95574968674346c4a836f88 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -323,7 +323,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()));
}
@@ -652,10 +652,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 +841,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 +868,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 +889,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 +909,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 +983,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 +1000,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 +1020,7 @@ HValue* CodeStubGraphBuilder<NewStringAddStub>::BuildCodeInitializedStub() {
}
-Handle<Code> NewStringAddStub::GenerateCode(Isolate* isolate) {
+Handle<Code> StringAddStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
}
@@ -1333,6 +1330,60 @@ 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(), 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);
« no previous file with comments | « src/code-stubs.cc ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698