Revision: 18682
Author: [email protected]
Date: Mon Jan 20 09:48:05 2014 UTC
Log: We no longer need to recover type cells from the oracle.
We only need the values within them. Function calls to Array from optimized
code needed the cell in the past, but no longer.
[email protected]
Review URL: https://codereview.chromium.org/141893002
http://code.google.com/p/v8/source/detail?r=18682
Modified:
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/ast.cc
/branches/bleeding_edge/src/ast.h
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/type-info.cc
/branches/bleeding_edge/src/type-info.h
/branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Fri Jan 17
11:08:24 2014 UTC
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Jan 20
09:48:05 2014 UTC
@@ -4055,7 +4055,7 @@
ASSERT(ToRegister(instr->result()).is(r0));
__ mov(r0, Operand(instr->arity()));
- __ mov(r2, Operand(instr->hydrogen()->property_cell()));
+ __ mov(r2, Operand(factory()->undefined_value()));
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
=======================================
--- /branches/bleeding_edge/src/ast.cc Fri Jan 17 14:08:50 2014 UTC
+++ /branches/bleeding_edge/src/ast.cc Mon Jan 20 09:48:05 2014 UTC
@@ -756,16 +756,13 @@
void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- allocation_info_cell_ =
- oracle->GetCallNewAllocationInfoCell(CallNewFeedbackId());
+ allocation_site_ =
+ oracle->GetCallNewAllocationSite(CallNewFeedbackId());
is_monomorphic_ = oracle->CallNewIsMonomorphic(CallNewFeedbackId());
if (is_monomorphic_) {
target_ = oracle->GetCallNewTarget(CallNewFeedbackId());
- Object* value = allocation_info_cell_->value();
- ASSERT(!value->IsTheHole());
- if (value->IsAllocationSite()) {
- AllocationSite* site = AllocationSite::cast(value);
- elements_kind_ = site->GetElementsKind();
+ if (!allocation_site_.is_null()) {
+ elements_kind_ = allocation_site_->GetElementsKind();
}
}
}
=======================================
--- /branches/bleeding_edge/src/ast.h Fri Jan 17 14:08:50 2014 UTC
+++ /branches/bleeding_edge/src/ast.h Mon Jan 20 09:48:05 2014 UTC
@@ -1837,8 +1837,8 @@
virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; }
Handle<JSFunction> target() const { return target_; }
ElementsKind elements_kind() const { return elements_kind_; }
- Handle<Cell> allocation_info_cell() const {
- return allocation_info_cell_;
+ Handle<AllocationSite> allocation_site() const {
+ return allocation_site_;
}
BailoutId ReturnId() const { return return_id_; }
@@ -1862,7 +1862,7 @@
bool is_monomorphic_;
Handle<JSFunction> target_;
ElementsKind elements_kind_;
- Handle<Cell> allocation_info_cell_;
+ Handle<AllocationSite> allocation_site_;
const BailoutId return_id_;
};
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Jan 17 11:08:24
2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Mon Jan 20 09:48:05
2014 UTC
@@ -2510,10 +2510,9 @@
class HCallNewArray V8_FINAL : public HBinaryCall {
public:
- DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray,
+ DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNewArray,
HValue*,
int,
- Handle<Cell>,
ElementsKind);
HValue* context() { return first(); }
@@ -2521,23 +2520,17 @@
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- Handle<Cell> property_cell() const {
- return type_cell_;
- }
-
ElementsKind elements_kind() const { return elements_kind_; }
DECLARE_CONCRETE_INSTRUCTION(CallNewArray)
private:
HCallNewArray(HValue* context, HValue* constructor, int argument_count,
- Handle<Cell> type_cell, ElementsKind elements_kind)
+ ElementsKind elements_kind)
: HBinaryCall(context, constructor, argument_count),
- elements_kind_(elements_kind),
- type_cell_(type_cell) {}
+ elements_kind_(elements_kind) {}
ElementsKind elements_kind_;
- Handle<Cell> type_cell_;
};
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri Jan 17 12:18:57 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Mon Jan 20 09:48:05 2014 UTC
@@ -7944,8 +7944,8 @@
HValue* constructor = environment()->ExpressionStackAt(argument_count);
ElementsKind kind = expr->elements_kind();
- Handle<Cell> cell = expr->allocation_info_cell();
- Handle<AllocationSite> site(AllocationSite::cast(cell->value()));
+ Handle<AllocationSite> site = expr->allocation_site();
+ ASSERT(!site.is_null());
// Register on the site for deoptimization if the transition feedback
changes.
AllocationSite::AddDependentCompilationInfo(
@@ -8019,8 +8019,9 @@
int argument_count = expr->arguments()->length();
// We should have the function plus array arguments on the environment
stack.
ASSERT(environment()->length() >= (argument_count + 1));
- Handle<Cell> cell = expr->allocation_info_cell();
- AllocationSite* site = AllocationSite::cast(cell->value());
+ Handle<AllocationSite> site = expr->allocation_site();
+ ASSERT(!site.is_null());
+
if (site->CanInlineCall()) {
// We also want to avoid inlining in certain 1 argument scenarios.
if (argument_count == 1) {
@@ -8159,7 +8160,6 @@
Handle<JSFunction> array_function(
isolate()->global_context()->array_function(), isolate());
bool use_call_new_array =
expr->target().is_identical_to(array_function);
- Handle<Cell> cell = expr->allocation_info_cell();
if (use_call_new_array && IsCallNewArrayInlineable(expr)) {
// Verify we are still calling the array function for our native
context.
Add<HCheckValue>(function, array_function);
@@ -8170,7 +8170,7 @@
HBinaryCall* call;
if (use_call_new_array) {
Add<HCheckValue>(function, array_function);
- call = New<HCallNewArray>(function, argument_count, cell,
+ call = New<HCallNewArray>(function, argument_count,
expr->elements_kind());
} else {
call = New<HCallNew>(function, argument_count);
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri Jan 17
11:08:24 2014 UTC
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Mon Jan 20
09:48:05 2014 UTC
@@ -4290,7 +4290,7 @@
ASSERT(ToRegister(instr->result()).is(eax));
__ Set(eax, Immediate(instr->arity()));
- __ mov(ebx, instr->hydrogen()->property_cell());
+ __ mov(ebx, factory()->undefined_value());
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Fri Jan 17
11:08:24 2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jan 20
09:48:05 2014 UTC
@@ -3972,7 +3972,7 @@
ASSERT(ToRegister(instr->result()).is(v0));
__ li(a0, Operand(instr->arity()));
- __ li(a2, Operand(instr->hydrogen()->property_cell()));
+ __ li(a2, Operand(factory()->undefined_value()));
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
=======================================
--- /branches/bleeding_edge/src/type-info.cc Fri Jan 17 11:28:22 2014 UTC
+++ /branches/bleeding_edge/src/type-info.cc Mon Jan 20 09:48:05 2014 UTC
@@ -72,17 +72,6 @@
}
return Handle<Object>::cast(isolate_->factory()->undefined_value());
}
-
-
-Handle<Cell> TypeFeedbackOracle::GetInfoCell(
- TypeFeedbackId ast_id) {
- int entry = dictionary_->FindEntry(IdToKey(ast_id));
- if (entry != UnseededNumberDictionary::kNotFound) {
- Cell* cell = Cell::cast(dictionary_->ValueAt(entry));
- return Handle<Cell>(cell, isolate_);
- }
- return Handle<Cell>::null();
-}
bool TypeFeedbackOracle::LoadIsUninitialized(TypeFeedbackId id) {
@@ -214,9 +203,13 @@
}
-Handle<Cell> TypeFeedbackOracle::GetCallNewAllocationInfoCell(
+Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite(
TypeFeedbackId id) {
- return GetInfoCell(id);
+ Handle<Object> info = GetInfo(id);
+ if (info->IsAllocationSite()) {
+ return Handle<AllocationSite>::cast(info);
+ }
+ return Handle<AllocationSite>::null();
}
=======================================
--- /branches/bleeding_edge/src/type-info.h Tue Jan 14 16:15:05 2014 UTC
+++ /branches/bleeding_edge/src/type-info.h Mon Jan 20 09:48:05 2014 UTC
@@ -95,7 +95,7 @@
CheckType GetCallCheckType(TypeFeedbackId id);
Handle<JSFunction> GetCallTarget(TypeFeedbackId id);
Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id);
- Handle<Cell> GetCallNewAllocationInfoCell(TypeFeedbackId id);
+ Handle<AllocationSite> GetCallNewAllocationSite(TypeFeedbackId id);
bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id);
bool LoadIsStub(TypeFeedbackId id, ICStub* stub);
@@ -145,9 +145,6 @@
// there is no information.
Handle<Object> GetInfo(TypeFeedbackId id);
- // Return the cell that contains type feedback.
- Handle<Cell> GetInfoCell(TypeFeedbackId id);
-
private:
Handle<Context> native_context_;
Isolate* isolate_;
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Mon Jan 20
04:59:40 2014 UTC
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Mon Jan 20
09:48:05 2014 UTC
@@ -3863,7 +3863,7 @@
ASSERT(ToRegister(instr->result()).is(rax));
__ Set(rax, instr->arity());
- __ Move(rbx, instr->hydrogen()->property_cell());
+ __ Move(rbx, factory()->undefined_value());
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.