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

Side by Side Diff: src/ic/ic.cc

Issue 712973002: harmony-scoping: Implement StoreIC handler for stores to global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments + rebased Created 6 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
« no previous file with comments | « src/hydrogen.cc ('k') | test/cctest/test-decls.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 Handle<GlobalContextTable> global_contexts( 1389 Handle<GlobalContextTable> global_contexts(
1390 global->native_context()->global_context_table()); 1390 global->native_context()->global_context_table());
1391 1391
1392 GlobalContextTable::LookupResult lookup_result; 1392 GlobalContextTable::LookupResult lookup_result;
1393 if (GlobalContextTable::Lookup(global_contexts, str_name, &lookup_result)) { 1393 if (GlobalContextTable::Lookup(global_contexts, str_name, &lookup_result)) {
1394 Handle<Context> global_context = GlobalContextTable::GetContext( 1394 Handle<Context> global_context = GlobalContextTable::GetContext(
1395 global_contexts, lookup_result.context_index); 1395 global_contexts, lookup_result.context_index);
1396 if (lookup_result.mode == CONST) { 1396 if (lookup_result.mode == CONST) {
1397 return TypeError("harmony_const_assign", object, name); 1397 return TypeError("harmony_const_assign", object, name);
1398 } 1398 }
1399
1400 if (FLAG_use_ic &&
1401 StoreGlobalContextFieldStub::Accepted(&lookup_result)) {
1402 StoreGlobalContextFieldStub stub(isolate(), &lookup_result);
1403 PatchCache(name, stub.GetCode());
1404 }
1405
1399 global_context->set(lookup_result.slot_index, *value); 1406 global_context->set(lookup_result.slot_index, *value);
1400 return value; 1407 return value;
1401 } 1408 }
1402 } 1409 }
1403 1410
1404 // TODO(verwaest): Let SetProperty do the migration, since storing a property 1411 // TODO(verwaest): Let SetProperty do the migration, since storing a property
1405 // might deprecate the current map again, if value does not fit. 1412 // might deprecate the current map again, if value does not fit.
1406 if (MigrateDeprecated(object) || object->IsJSProxy()) { 1413 if (MigrateDeprecated(object) || object->IsJSProxy()) {
1407 Handle<Object> result; 1414 Handle<Object> result;
1408 ASSIGN_RETURN_ON_EXCEPTION( 1415 ASSIGN_RETURN_ON_EXCEPTION(
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 static const Address IC_utilities[] = { 2781 static const Address IC_utilities[] = {
2775 #define ADDR(name) FUNCTION_ADDR(name), 2782 #define ADDR(name) FUNCTION_ADDR(name),
2776 IC_UTIL_LIST(ADDR) NULL 2783 IC_UTIL_LIST(ADDR) NULL
2777 #undef ADDR 2784 #undef ADDR
2778 }; 2785 };
2779 2786
2780 2787
2781 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 2788 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
2782 } 2789 }
2783 } // namespace v8::internal 2790 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698