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

Unified Diff: src/ic.cc

Issue 11316151: Revert r13025 and r13026 (they introduced a bug on arm and regressed octane crypto). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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/ia32/lithium-codegen-ia32.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 19f6eda38b4ccb7f36fb1ed352c2a1de71d73e37..bf2a649f7f298d1e53fb53b035b5dcfb323a7ee7 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -855,6 +855,26 @@ MaybeObject* LoadIC::Load(State state,
return Smi::FromInt(String::cast(*string)->length());
}
+ // Use specialized code for getting the length of arrays.
+ if (object->IsJSArray() &&
+ name->Equals(isolate()->heap()->length_symbol())) {
+ Handle<Code> stub;
+ if (state == UNINITIALIZED) {
+ stub = pre_monomorphic_stub();
+ } else if (state == PREMONOMORPHIC) {
+ stub = isolate()->builtins()->LoadIC_ArrayLength();
+ } else if (state != MEGAMORPHIC) {
+ stub = megamorphic_stub();
+ }
+ if (!stub.is_null()) {
+ set_target(*stub);
+#ifdef DEBUG
+ if (FLAG_trace_ic) PrintF("[LoadIC : +#length /array]\n");
+#endif
+ }
+ return JSArray::cast(*object)->length();
+ }
+
// Use specialized code for getting prototype of functions.
if (object->IsJSFunction() &&
name->Equals(isolate()->heap()->prototype_symbol()) &&
@@ -986,17 +1006,6 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
if (!holder->HasFastProperties()) return;
code = isolate()->stub_cache()->ComputeLoadViaGetter(
name, receiver, holder, Handle<JSFunction>::cast(getter));
- } else if (holder->IsJSArray() &&
- name->Equals(isolate()->heap()->length_symbol())) {
- ASSERT(callback->IsForeign());
- ASSERT(reinterpret_cast<AccessorDescriptor*>(
- Handle<Foreign>::cast(callback)->foreign_address())
- == &Accessors::ArrayLength);
- // Use a "load field" IC for getting the array length.
- // Note that the resulting code object is marked as "Code::FIELD"
- // and not as "Code::CALLBACKS".
- code = isolate()->stub_cache()->ComputeLoadField(
- name, receiver, holder, JSArray::ArrayLengthIndex());
} else {
ASSERT(callback->IsForeign());
// No IC support for old-style native accessors.
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698