summaryrefslogtreecommitdiff
path: root/deps/v8/src/stub-cache.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-02-09 10:24:26 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-02-09 10:24:26 -0800
commita0702b54d1db35a6006644882c0b5420d8670958 (patch)
treee246bb342237e8caabd45450301cb7cc5e4ccf24 /deps/v8/src/stub-cache.cc
parenta48a0755358d322f4a593d09c331432c10a500bc (diff)
downloadnode-new-a0702b54d1db35a6006644882c0b5420d8670958.tar.gz
Upgrade V8 to 3.1.2
Diffstat (limited to 'deps/v8/src/stub-cache.cc')
-rw-r--r--deps/v8/src/stub-cache.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/deps/v8/src/stub-cache.cc b/deps/v8/src/stub-cache.cc
index 15f128da4c..731714138b 100644
--- a/deps/v8/src/stub-cache.cc
+++ b/deps/v8/src/stub-cache.cc
@@ -441,6 +441,12 @@ MaybeObject* StubCache::ComputeKeyedLoadFunctionPrototype(
MaybeObject* StubCache::ComputeKeyedLoadSpecialized(JSObject* receiver) {
+ // Using NORMAL as the PropertyType for array element loads is a misuse. The
+ // generated stub always accesses fast elements, not slow-mode fields, but
+ // some property type is required for the stub lookup. Note that overloading
+ // the NORMAL PropertyType is only safe as long as no stubs are generated for
+ // other keyed field loads. This is guaranteed to be the case since all field
+ // keyed loads that are not array elements go through a generic builtin stub.
Code::Flags flags =
Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, NORMAL);
String* name = Heap::KeyedLoadSpecialized_symbol();
@@ -461,6 +467,33 @@ MaybeObject* StubCache::ComputeKeyedLoadSpecialized(JSObject* receiver) {
}
+MaybeObject* StubCache::ComputeKeyedLoadPixelArray(JSObject* receiver) {
+ // Using NORMAL as the PropertyType for array element loads is a misuse. The
+ // generated stub always accesses fast elements, not slow-mode fields, but
+ // some property type is required for the stub lookup. Note that overloading
+ // the NORMAL PropertyType is only safe as long as no stubs are generated for
+ // other keyed field loads. This is guaranteed to be the case since all field
+ // keyed loads that are not array elements go through a generic builtin stub.
+ Code::Flags flags =
+ Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, NORMAL);
+ String* name = Heap::KeyedLoadPixelArray_symbol();
+ Object* code = receiver->map()->FindInCodeCache(name, flags);
+ if (code->IsUndefined()) {
+ KeyedLoadStubCompiler compiler;
+ { MaybeObject* maybe_code = compiler.CompileLoadPixelArray(receiver);
+ if (!maybe_code->ToObject(&code)) return maybe_code;
+ }
+ PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), 0));
+ Object* result;
+ { MaybeObject* maybe_result =
+ receiver->UpdateMapCodeCache(name, Code::cast(code));
+ if (!maybe_result->ToObject(&result)) return maybe_result;
+ }
+ }
+ return code;
+}
+
+
MaybeObject* StubCache::ComputeStoreField(String* name,
JSObject* receiver,
int field_index,