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

Side by Side Diff: src/ic.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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 639
640 Handle<Code> CallICBase::ComputeMonomorphicStub(LookupResult* lookup, 640 Handle<Code> CallICBase::ComputeMonomorphicStub(LookupResult* lookup,
641 State state, 641 State state,
642 Code::ExtraICState extra_state, 642 Code::ExtraICState extra_state,
643 Handle<Object> object, 643 Handle<Object> object,
644 Handle<String> name) { 644 Handle<String> name) {
645 int argc = target()->arguments_count(); 645 int argc = target()->arguments_count();
646 Handle<JSObject> holder(lookup->holder()); 646 Handle<JSObject> holder(lookup->holder());
647 switch (lookup->type()) { 647 switch (lookup->type()) {
648 case FIELD: { 648 case FIELD: {
649 int index = lookup->GetFieldIndex(); 649 PropertyIndex index = lookup->GetFieldIndex();
650 return isolate()->stub_cache()->ComputeCallField( 650 return isolate()->stub_cache()->ComputeCallField(
651 argc, kind_, extra_state, name, object, holder, index); 651 argc, kind_, extra_state, name, object, holder, index);
652 } 652 }
653 case CONSTANT_FUNCTION: { 653 case CONSTANT_FUNCTION: {
654 // Get the constant function and compute the code stub for this 654 // Get the constant function and compute the code stub for this
655 // call; used for rewriting to monomorphic state and making sure 655 // call; used for rewriting to monomorphic state and making sure
656 // that the code stub is in the stub cache. 656 // that the code stub is in the stub cache.
657 Handle<JSFunction> function(lookup->GetConstantFunction()); 657 Handle<JSFunction> function(lookup->GetConstantFunction());
658 return isolate()->stub_cache()->ComputeCallConstant( 658 return isolate()->stub_cache()->ComputeCallConstant(
659 argc, kind_, extra_state, name, object, holder, function); 659 argc, kind_, extra_state, name, object, holder, function);
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 // current state. 1460 // current state.
1461 PropertyType type = lookup->type(); 1461 PropertyType type = lookup->type();
1462 1462
1463 // Compute the code stub for this store; used for rewriting to 1463 // Compute the code stub for this store; used for rewriting to
1464 // monomorphic state and making sure that the code stub is in the 1464 // monomorphic state and making sure that the code stub is in the
1465 // stub cache. 1465 // stub cache.
1466 Handle<JSObject> holder(lookup->holder()); 1466 Handle<JSObject> holder(lookup->holder());
1467 Handle<Code> code; 1467 Handle<Code> code;
1468 switch (type) { 1468 switch (type) {
1469 case FIELD: 1469 case FIELD:
1470 code = isolate()->stub_cache()->ComputeStoreField(name, 1470 code = isolate()->stub_cache()->ComputeStoreField(
1471 receiver, 1471 name, receiver, lookup->GetFieldIndex().FieldIndex(),
1472 lookup->GetFieldIndex(), 1472 Handle<Map>::null(), strict_mode);
1473 Handle<Map>::null(),
1474 strict_mode);
1475 break; 1473 break;
1476 case NORMAL: 1474 case NORMAL:
1477 if (receiver->IsGlobalObject()) { 1475 if (receiver->IsGlobalObject()) {
1478 // The stub generated for the global object picks the value directly 1476 // The stub generated for the global object picks the value directly
1479 // from the property cell. So the property must be directly on the 1477 // from the property cell. So the property must be directly on the
1480 // global object. 1478 // global object.
1481 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); 1479 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
1482 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(lookup)); 1480 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(lookup));
1483 code = isolate()->stub_cache()->ComputeStoreGlobal( 1481 code = isolate()->stub_cache()->ComputeStoreGlobal(
1484 name, global, cell, strict_mode); 1482 name, global, cell, strict_mode);
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 PropertyType type = lookup->type(); 1972 PropertyType type = lookup->type();
1975 1973
1976 // Compute the code stub for this store; used for rewriting to 1974 // Compute the code stub for this store; used for rewriting to
1977 // monomorphic state and making sure that the code stub is in the 1975 // monomorphic state and making sure that the code stub is in the
1978 // stub cache. 1976 // stub cache.
1979 Handle<Code> code; 1977 Handle<Code> code;
1980 1978
1981 switch (type) { 1979 switch (type) {
1982 case FIELD: 1980 case FIELD:
1983 code = isolate()->stub_cache()->ComputeKeyedStoreField( 1981 code = isolate()->stub_cache()->ComputeKeyedStoreField(
1984 name, receiver, lookup->GetFieldIndex(), 1982 name, receiver, lookup->GetFieldIndex().FieldIndex(),
1985 Handle<Map>::null(), strict_mode); 1983 Handle<Map>::null(), strict_mode);
1986 break; 1984 break;
1987 case TRANSITION: { 1985 case TRANSITION: {
1988 Handle<Map> transition(lookup->GetTransitionTarget()); 1986 Handle<Map> transition(lookup->GetTransitionTarget());
1989 int descriptor = transition->LastAdded(); 1987 int descriptor = transition->LastAdded();
1990 1988
1991 DescriptorArray* target_descriptors = transition->instance_descriptors(); 1989 DescriptorArray* target_descriptors = transition->instance_descriptors();
1992 PropertyDetails details = target_descriptors->GetDetails(descriptor); 1990 PropertyDetails details = target_descriptors->GetDetails(descriptor);
1993 1991
1994 if (details.type() == FIELD && details.attributes() == NONE) { 1992 if (details.type() == FIELD && details.attributes() == NONE) {
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 #undef ADDR 2700 #undef ADDR
2703 }; 2701 };
2704 2702
2705 2703
2706 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2704 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2707 return IC_utilities[id]; 2705 return IC_utilities[id];
2708 } 2706 }
2709 2707
2710 2708
2711 } } // namespace v8::internal 2709 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/json-stringifier.h » ('j') | src/property.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698