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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return parse_info()->literal()->debug_name()->ToCString(); | 321 return parse_info()->literal()->debug_name()->ToCString(); |
322 } | 322 } |
323 const char* str = debug_name_ ? debug_name_ : "unknown"; | 323 const char* str = debug_name_ ? debug_name_ : "unknown"; |
324 size_t len = strlen(str) + 1; | 324 size_t len = strlen(str) + 1; |
325 base::SmartArrayPointer<char> name(new char[len]); | 325 base::SmartArrayPointer<char> name(new char[len]); |
326 memcpy(name.get(), str, len); | 326 memcpy(name.get(), str, len); |
327 return name; | 327 return name; |
328 } | 328 } |
329 | 329 |
330 | 330 |
331 bool CompilationInfo::MustReplaceUndefinedReceiverWithGlobalProxy() { | 331 bool CompilationInfo::ExpectsJSReceiverAsReceiver() { |
332 return is_sloppy(language_mode()) && !is_native() && | 332 return is_sloppy(language_mode()) && !is_native(); |
333 scope()->has_this_declaration() && scope()->receiver()->is_used(); | |
334 } | 333 } |
335 | 334 |
336 | 335 |
337 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { | 336 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { |
338 public: | 337 public: |
339 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) | 338 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) |
340 : HOptimizedGraphBuilder(info) { | 339 : HOptimizedGraphBuilder(info) { |
341 } | 340 } |
342 | 341 |
343 #define DEF_VISIT(type) \ | 342 #define DEF_VISIT(type) \ |
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 } | 1793 } |
1795 | 1794 |
1796 #if DEBUG | 1795 #if DEBUG |
1797 void CompilationInfo::PrintAstForTesting() { | 1796 void CompilationInfo::PrintAstForTesting() { |
1798 PrintF("--- Source from AST ---\n%s\n", | 1797 PrintF("--- Source from AST ---\n%s\n", |
1799 PrettyPrinter(isolate()).PrintProgram(literal())); | 1798 PrettyPrinter(isolate()).PrintProgram(literal())); |
1800 } | 1799 } |
1801 #endif | 1800 #endif |
1802 } // namespace internal | 1801 } // namespace internal |
1803 } // namespace v8 | 1802 } // namespace v8 |
OLD | NEW |