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

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

Issue 976053002: Fix exception for assignment to uninitialised const (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 9 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
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/messages.js » ('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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 Handle<String> str_name = Handle<String>::cast(name); 1544 Handle<String> str_name = Handle<String>::cast(name);
1545 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object); 1545 Handle<GlobalObject> global = Handle<GlobalObject>::cast(object);
1546 Handle<ScriptContextTable> script_contexts( 1546 Handle<ScriptContextTable> script_contexts(
1547 global->native_context()->script_context_table()); 1547 global->native_context()->script_context_table());
1548 1548
1549 ScriptContextTable::LookupResult lookup_result; 1549 ScriptContextTable::LookupResult lookup_result;
1550 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { 1550 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) {
1551 Handle<Context> script_context = ScriptContextTable::GetContext( 1551 Handle<Context> script_context = ScriptContextTable::GetContext(
1552 script_contexts, lookup_result.context_index); 1552 script_contexts, lookup_result.context_index);
1553 if (lookup_result.mode == CONST) { 1553 if (lookup_result.mode == CONST) {
1554 return TypeError("harmony_const_assign", object, name); 1554 return TypeError("const_assign", object, name);
1555 } 1555 }
1556 1556
1557 if (FLAG_use_ic && 1557 if (FLAG_use_ic &&
1558 StoreScriptContextFieldStub::Accepted(&lookup_result)) { 1558 StoreScriptContextFieldStub::Accepted(&lookup_result)) {
1559 StoreScriptContextFieldStub stub(isolate(), &lookup_result); 1559 StoreScriptContextFieldStub stub(isolate(), &lookup_result);
1560 PatchCache(name, stub.GetCode()); 1560 PatchCache(name, stub.GetCode());
1561 } 1561 }
1562 1562
1563 script_context->set(lookup_result.slot_index, *value); 1563 script_context->set(lookup_result.slot_index, *value);
1564 return value; 1564 return value;
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 static const Address IC_utilities[] = { 3048 static const Address IC_utilities[] = {
3049 #define ADDR(name) FUNCTION_ADDR(name), 3049 #define ADDR(name) FUNCTION_ADDR(name),
3050 IC_UTIL_LIST(ADDR) NULL 3050 IC_UTIL_LIST(ADDR) NULL
3051 #undef ADDR 3051 #undef ADDR
3052 }; 3052 };
3053 3053
3054 3054
3055 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3055 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3056 } 3056 }
3057 } // namespace v8::internal 3057 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698