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

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

Issue 11941016: Migrate FunctionPrototype (Keyed|Named)LoadIC to CodeStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 KeyedLoadStubCompiler compiler(isolate_); 341 KeyedLoadStubCompiler compiler(isolate_);
342 Handle<Code> code = 342 Handle<Code> code =
343 compiler.CompileLoadCallback(name, receiver, holder, callback); 343 compiler.CompileLoadCallback(name, receiver, holder, callback);
344 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 344 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
345 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 345 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
346 JSObject::UpdateMapCodeCache(receiver, name, code); 346 JSObject::UpdateMapCodeCache(receiver, name, code);
347 return code; 347 return code;
348 } 348 }
349 349
350 350
351 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype(
352 Handle<String> name,
353 Handle<JSFunction> receiver) {
354 Code::Flags flags =
355 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS);
356 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
357 isolate_);
358 if (probe->IsCode()) return Handle<Code>::cast(probe);
359
360 KeyedLoadStubCompiler compiler(isolate_);
361 Handle<Code> code = compiler.CompileLoadFunctionPrototype(name);
362 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
363 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
364 JSObject::UpdateMapCodeCache(receiver, name, code);
365 return code;
366 }
367
368
369 Handle<Code> StubCache::ComputeStoreField(Handle<String> name, 351 Handle<Code> StubCache::ComputeStoreField(Handle<String> name,
370 Handle<JSObject> receiver, 352 Handle<JSObject> receiver,
371 int field_index, 353 int field_index,
372 Handle<Map> transition, 354 Handle<Map> transition,
373 StrictModeFlag strict_mode) { 355 StrictModeFlag strict_mode) {
374 Code::StubType type = 356 Code::StubType type =
375 (transition.is_null()) ? Code::FIELD : Code::MAP_TRANSITION; 357 (transition.is_null()) ? Code::FIELD : Code::MAP_TRANSITION;
376 Code::Flags flags = Code::ComputeMonomorphicFlags( 358 Code::Flags flags = Code::ComputeMonomorphicFlags(
377 Code::STORE_IC, type, strict_mode); 359 Code::STORE_IC, type, strict_mode);
378 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), 360 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 Handle<FunctionTemplateInfo>( 1551 Handle<FunctionTemplateInfo>(
1570 FunctionTemplateInfo::cast(signature->receiver())); 1552 FunctionTemplateInfo::cast(signature->receiver()));
1571 } 1553 }
1572 } 1554 }
1573 1555
1574 is_simple_api_call_ = true; 1556 is_simple_api_call_ = true;
1575 } 1557 }
1576 1558
1577 1559
1578 } } // namespace v8::internal 1560 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698