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

Side by Side Diff: src/stub-cache.cc

Issue 11365221: Allow property indexes to refer to slots inside the object header. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *cache_name)); 129 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *cache_name));
130 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *cache_name, *code)); 130 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *cache_name, *code));
131 JSObject::UpdateMapCodeCache(receiver, cache_name, code); 131 JSObject::UpdateMapCodeCache(receiver, cache_name, code);
132 return code; 132 return code;
133 } 133 }
134 134
135 135
136 Handle<Code> StubCache::ComputeLoadField(Handle<String> name, 136 Handle<Code> StubCache::ComputeLoadField(Handle<String> name,
137 Handle<JSObject> receiver, 137 Handle<JSObject> receiver,
138 Handle<JSObject> holder, 138 Handle<JSObject> holder,
139 int field_index) { 139 PropertyIndex field_index) {
140 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 140 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
141 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD); 141 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD);
142 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 142 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
143 if (probe->IsCode()) return Handle<Code>::cast(probe); 143 if (probe->IsCode()) return Handle<Code>::cast(probe);
144 144
145 LoadStubCompiler compiler(isolate_); 145 LoadStubCompiler compiler(isolate_);
146 Handle<Code> code = 146 Handle<Code> code =
147 compiler.CompileLoadField(receiver, holder, field_index, name); 147 compiler.CompileLoadField(receiver, holder, field_index, name);
148 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 148 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
149 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 149 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 254 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
255 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 255 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
256 JSObject::UpdateMapCodeCache(receiver, name, code); 256 JSObject::UpdateMapCodeCache(receiver, name, code);
257 return code; 257 return code;
258 } 258 }
259 259
260 260
261 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name, 261 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name,
262 Handle<JSObject> receiver, 262 Handle<JSObject> receiver,
263 Handle<JSObject> holder, 263 Handle<JSObject> holder,
264 int field_index) { 264 PropertyIndex field_index) {
265 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 265 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
266 Code::Flags flags = 266 Code::Flags flags =
267 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD); 267 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD);
268 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 268 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
269 if (probe->IsCode()) return Handle<Code>::cast(probe); 269 if (probe->IsCode()) return Handle<Code>::cast(probe);
270 270
271 KeyedLoadStubCompiler compiler(isolate_); 271 KeyedLoadStubCompiler compiler(isolate_);
272 Handle<Code> code = 272 Handle<Code> code =
273 compiler.CompileLoadField(name, receiver, holder, field_index); 273 compiler.CompileLoadField(name, receiver, holder, field_index);
274 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 274 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 return code; 625 return code;
626 } 626 }
627 627
628 628
629 Handle<Code> StubCache::ComputeCallField(int argc, 629 Handle<Code> StubCache::ComputeCallField(int argc,
630 Code::Kind kind, 630 Code::Kind kind,
631 Code::ExtraICState extra_state, 631 Code::ExtraICState extra_state,
632 Handle<String> name, 632 Handle<String> name,
633 Handle<Object> object, 633 Handle<Object> object,
634 Handle<JSObject> holder, 634 Handle<JSObject> holder,
635 int index) { 635 PropertyIndex index) {
636 // Compute the check type and the map. 636 // Compute the check type and the map.
637 InlineCacheHolderFlag cache_holder = 637 InlineCacheHolderFlag cache_holder =
638 IC::GetCodeCacheForObject(*object, *holder); 638 IC::GetCodeCacheForObject(*object, *holder);
639 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); 639 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder));
640 640
641 // TODO(1233596): We cannot do receiver map check for non-JS objects 641 // TODO(1233596): We cannot do receiver map check for non-JS objects
642 // because they may be represented as immediates without a 642 // because they may be represented as immediates without a
643 // map. Instead, we check against the map in the holder. 643 // map. Instead, we check against the map in the holder.
644 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { 644 if (object->IsNumber() || object->IsBoolean() || object->IsString()) {
645 object = holder; 645 object = holder;
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 Handle<FunctionTemplateInfo>( 1579 Handle<FunctionTemplateInfo>(
1580 FunctionTemplateInfo::cast(signature->receiver())); 1580 FunctionTemplateInfo::cast(signature->receiver()));
1581 } 1581 }
1582 } 1582 }
1583 1583
1584 is_simple_api_call_ = true; 1584 is_simple_api_call_ = true;
1585 } 1585 }
1586 1586
1587 1587
1588 } } // namespace v8::internal 1588 } } // namespace v8::internal
OLDNEW
« src/property.h ('K') | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698