OLD | NEW |
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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 Handle<Object> result; | 716 Handle<Object> result; |
717 ASSIGN_RETURN_ON_EXCEPTION( | 717 ASSIGN_RETURN_ON_EXCEPTION( |
718 isolate(), result, | 718 isolate(), result, |
719 Runtime::GetElementOrCharAt(isolate(), object, index), Object); | 719 Runtime::GetElementOrCharAt(isolate(), object, index), Object); |
720 return result; | 720 return result; |
721 } | 721 } |
722 | 722 |
723 bool use_ic = MigrateDeprecated(object) ? false : FLAG_use_ic; | 723 bool use_ic = MigrateDeprecated(object) ? false : FLAG_use_ic; |
724 | 724 |
725 if (FLAG_harmony_scoping && object->IsGlobalObject() && name->IsString()) { | 725 if (object->IsGlobalObject() && name->IsString()) { |
726 // Look up in script context table. | 726 // Look up in script context table. |
727 Handle<String> str_name = Handle<String>::cast(name); | 727 Handle<String> str_name = Handle<String>::cast(name); |
728 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); | 728 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); |
729 Handle<ScriptContextTable> script_contexts( | 729 Handle<ScriptContextTable> script_contexts( |
730 global->native_context()->script_context_table()); | 730 global->native_context()->script_context_table()); |
731 | 731 |
732 ScriptContextTable::LookupResult lookup_result; | 732 ScriptContextTable::LookupResult lookup_result; |
733 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { | 733 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { |
734 Handle<Object> result = | 734 Handle<Object> result = |
735 FixedArray::get(ScriptContextTable::GetContext( | 735 FixedArray::get(ScriptContextTable::GetContext( |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 } | 1536 } |
1537 | 1537 |
1538 it->PrepareTransitionToDataProperty(value, NONE, store_mode); | 1538 it->PrepareTransitionToDataProperty(value, NONE, store_mode); |
1539 return it->IsCacheableTransition(); | 1539 return it->IsCacheableTransition(); |
1540 } | 1540 } |
1541 | 1541 |
1542 | 1542 |
1543 MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name, | 1543 MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name, |
1544 Handle<Object> value, | 1544 Handle<Object> value, |
1545 JSReceiver::StoreFromKeyed store_mode) { | 1545 JSReceiver::StoreFromKeyed store_mode) { |
1546 if (FLAG_harmony_scoping && object->IsGlobalObject() && name->IsString()) { | 1546 if (object->IsGlobalObject() && name->IsString()) { |
1547 // Look up in script context table. | 1547 // Look up in script context table. |
1548 Handle<String> str_name = Handle<String>::cast(name); | 1548 Handle<String> str_name = Handle<String>::cast(name); |
1549 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); | 1549 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); |
1550 Handle<ScriptContextTable> script_contexts( | 1550 Handle<ScriptContextTable> script_contexts( |
1551 global->native_context()->script_context_table()); | 1551 global->native_context()->script_context_table()); |
1552 | 1552 |
1553 ScriptContextTable::LookupResult lookup_result; | 1553 ScriptContextTable::LookupResult lookup_result; |
1554 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { | 1554 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { |
1555 Handle<Context> script_context = ScriptContextTable::GetContext( | 1555 Handle<Context> script_context = ScriptContextTable::GetContext( |
1556 script_contexts, lookup_result.context_index); | 1556 script_contexts, lookup_result.context_index); |
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3055 static const Address IC_utilities[] = { | 3055 static const Address IC_utilities[] = { |
3056 #define ADDR(name) FUNCTION_ADDR(name), | 3056 #define ADDR(name) FUNCTION_ADDR(name), |
3057 IC_UTIL_LIST(ADDR) NULL | 3057 IC_UTIL_LIST(ADDR) NULL |
3058 #undef ADDR | 3058 #undef ADDR |
3059 }; | 3059 }; |
3060 | 3060 |
3061 | 3061 |
3062 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3062 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
3063 } | 3063 } |
3064 } // namespace v8::internal | 3064 } // namespace v8::internal |
OLD | NEW |