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

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

Issue 128683002: Array constructor can be simplified by loading context from JSFunction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simple ports. Created 6 years, 11 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.h ('k') | src/hydrogen.h » ('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 374f55f06879ffe12ecf7685f39f450d4eaa98dc..783384d45285f3e5325038a34ea6d3705e45042e 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -81,24 +81,6 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
HContext* context() { return context_; }
Isolate* isolate() { return info_.isolate(); }
- class ArrayContextChecker {
- public:
- ArrayContextChecker(HGraphBuilder* builder, HValue* constructor,
- HValue* array_function)
- : checker_(builder) {
- checker_.If<HCompareObjectEqAndBranch, HValue*>(constructor,
- array_function);
- checker_.Then();
- }
-
- ~ArrayContextChecker() {
- checker_.ElseDeopt("Array constructor called from different context");
- checker_.End();
- }
- private:
- IfBuilder checker_;
- };
-
enum ArgumentClass {
NONE,
SINGLE,
@@ -106,7 +88,6 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
};
HValue* BuildArrayConstructor(ElementsKind kind,
- ContextCheckMode context_mode,
AllocationSiteOverrideMode override_mode,
ArgumentClass argument_class);
HValue* BuildInternalArrayConstructor(ElementsKind kind,
@@ -672,15 +653,9 @@ Handle<Code> TransitionElementsKindStub::GenerateCode(Isolate* isolate) {
HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
ElementsKind kind,
- ContextCheckMode context_mode,
AllocationSiteOverrideMode override_mode,
ArgumentClass argument_class) {
HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor);
- if (context_mode == CONTEXT_CHECK_REQUIRED) {
- HInstruction* array_function = BuildGetArrayFunction();
- ArrayContextChecker checker(this, constructor, array_function);
- }
-
HValue* property_cell = GetParameter(ArrayConstructorStubBase::kPropertyCell);
// Walk through the property cell to the AllocationSite
HValue* alloc_site = Add<HLoadNamedField>(property_cell,
@@ -787,9 +762,8 @@ HValue* CodeStubGraphBuilderBase::BuildArrayNArgumentsConstructor(
template <>
HValue* CodeStubGraphBuilder<ArrayNoArgumentConstructorStub>::BuildCodeStub() {
ElementsKind kind = casted_stub()->elements_kind();
- ContextCheckMode context_mode = casted_stub()->context_mode();
AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
- return BuildArrayConstructor(kind, context_mode, override_mode, NONE);
+ return BuildArrayConstructor(kind, override_mode, NONE);
}
@@ -802,9 +776,8 @@ template <>
HValue* CodeStubGraphBuilder<ArraySingleArgumentConstructorStub>::
BuildCodeStub() {
ElementsKind kind = casted_stub()->elements_kind();
- ContextCheckMode context_mode = casted_stub()->context_mode();
AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
- return BuildArrayConstructor(kind, context_mode, override_mode, SINGLE);
+ return BuildArrayConstructor(kind, override_mode, SINGLE);
}
@@ -817,9 +790,8 @@ Handle<Code> ArraySingleArgumentConstructorStub::GenerateCode(
template <>
HValue* CodeStubGraphBuilder<ArrayNArgumentsConstructorStub>::BuildCodeStub() {
ElementsKind kind = casted_stub()->elements_kind();
- ContextCheckMode context_mode = casted_stub()->context_mode();
AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
- return BuildArrayConstructor(kind, context_mode, override_mode, MULTIPLE);
+ return BuildArrayConstructor(kind, override_mode, MULTIPLE);
}
« no previous file with comments | « src/code-stubs.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698