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

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

Issue 1422443006: [Intepreter] Don't throw reference errors for globals in typeof. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 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
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/interpreter-assembler.h" 9 #include "src/compiler/interpreter-assembler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // 236 //
237 // Load the global with name in constant pool entry <name_index> into the 237 // Load the global with name in constant pool entry <name_index> into the
238 // accumulator using FeedBackVector slot <slot> in strict mode. 238 // accumulator using FeedBackVector slot <slot> in strict mode.
239 void Interpreter::DoLdaGlobalStrict(compiler::InterpreterAssembler* assembler) { 239 void Interpreter::DoLdaGlobalStrict(compiler::InterpreterAssembler* assembler) {
240 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, 240 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
241 STRICT, UNINITIALIZED); 241 STRICT, UNINITIALIZED);
242 DoLoadGlobal(ic, assembler); 242 DoLoadGlobal(ic, assembler);
243 } 243 }
244 244
245 245
246 // LdaGlobalInsideTypeofSloppy <name_index> <slot>
247 //
248 // Load the global with name in constant pool entry <name_index> into the
249 // accumulator using FeedBackVector slot <slot> in sloppy mode.
250 void Interpreter::DoLdaGlobalInsideTypeofSloppy(
251 compiler::InterpreterAssembler* assembler) {
252 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
253 SLOPPY, UNINITIALIZED);
254 DoLoadGlobal(ic, assembler);
255 }
256
257
258 // LdaGlobalInsideTypeofStrict <name_index> <slot>
259 //
260 // Load the global with name in constant pool entry <name_index> into the
261 // accumulator using FeedBackVector slot <slot> in strict mode.
262 void Interpreter::DoLdaGlobalInsideTypeofStrict(
263 compiler::InterpreterAssembler* assembler) {
264 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
265 STRICT, UNINITIALIZED);
266 DoLoadGlobal(ic, assembler);
267 }
268
269
246 // LdaGlobalSloppyWide <name_index> <slot> 270 // LdaGlobalSloppyWide <name_index> <slot>
247 // 271 //
248 // Load the global with name in constant pool entry <name_index> into the 272 // Load the global with name in constant pool entry <name_index> into the
249 // accumulator using FeedBackVector slot <slot> in sloppy mode. 273 // accumulator using FeedBackVector slot <slot> in sloppy mode.
250 void Interpreter::DoLdaGlobalSloppyWide( 274 void Interpreter::DoLdaGlobalSloppyWide(
251 compiler::InterpreterAssembler* assembler) { 275 compiler::InterpreterAssembler* assembler) {
252 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, 276 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
253 SLOPPY, UNINITIALIZED); 277 SLOPPY, UNINITIALIZED);
254 DoLoadGlobal(ic, assembler); 278 DoLoadGlobal(ic, assembler);
255 } 279 }
256 280
257 281
258 // LdaGlobalSloppyWide <name_index> <slot> 282 // LdaGlobalSloppyWide <name_index> <slot>
259 // 283 //
260 // Load the global with name in constant pool entry <name_index> into the 284 // Load the global with name in constant pool entry <name_index> into the
261 // accumulator using FeedBackVector slot <slot> in strict mode. 285 // accumulator using FeedBackVector slot <slot> in strict mode.
262 void Interpreter::DoLdaGlobalStrictWide( 286 void Interpreter::DoLdaGlobalStrictWide(
263 compiler::InterpreterAssembler* assembler) { 287 compiler::InterpreterAssembler* assembler) {
264 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, 288 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
265 STRICT, UNINITIALIZED); 289 STRICT, UNINITIALIZED);
266 DoLoadGlobal(ic, assembler); 290 DoLoadGlobal(ic, assembler);
267 } 291 }
268 292
269 293
294 // LdaGlobalInsideTypeofSloppyWide <name_index> <slot>
295 //
296 // Load the global with name in constant pool entry <name_index> into the
297 // accumulator using FeedBackVector slot <slot> in sloppy mode.
298 void Interpreter::DoLdaGlobalInsideTypeofSloppyWide(
299 compiler::InterpreterAssembler* assembler) {
300 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
301 SLOPPY, UNINITIALIZED);
302 DoLoadGlobal(ic, assembler);
303 }
304
305
306 // LdaGlobalInsideTypeofSloppyWide <name_index> <slot>
307 //
308 // Load the global with name in constant pool entry <name_index> into the
309 // accumulator using FeedBackVector slot <slot> in strict mode.
310 void Interpreter::DoLdaGlobalInsideTypeofStrictWide(
311 compiler::InterpreterAssembler* assembler) {
312 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
313 STRICT, UNINITIALIZED);
314 DoLoadGlobal(ic, assembler);
315 }
316
317
270 void Interpreter::DoStoreGlobal(Callable ic, 318 void Interpreter::DoStoreGlobal(Callable ic,
271 compiler::InterpreterAssembler* assembler) { 319 compiler::InterpreterAssembler* assembler) {
272 // Get the global object. 320 // Get the global object.
273 Node* context = __ GetContext(); 321 Node* context = __ GetContext();
274 Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX); 322 Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX);
275 323
276 // Store the global via the StoreIC. 324 // Store the global via the StoreIC.
277 Node* code_target = __ HeapConstant(ic.code()); 325 Node* code_target = __ HeapConstant(ic.code());
278 Node* constant_index = __ BytecodeOperandIdx(0); 326 Node* constant_index = __ BytecodeOperandIdx(0);
279 Node* name = __ LoadConstantPoolEntry(constant_index); 327 Node* name = __ LoadConstantPoolEntry(constant_index);
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); 1426 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3);
1379 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); 1427 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length);
1380 __ SetAccumulator(result); 1428 __ SetAccumulator(result);
1381 __ Dispatch(); 1429 __ Dispatch();
1382 } 1430 }
1383 1431
1384 1432
1385 } // namespace interpreter 1433 } // namespace interpreter
1386 } // namespace internal 1434 } // namespace internal
1387 } // namespace v8 1435 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698